Skip to content

meyerd/pymygw

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pymygw

a mysensors gw based on https://github.com/wbcode/ham

  • MQTT Support
  • Openhab Rest Api Support

MySensors Serial Protocol (1.4) support only

@vincentdm added v1.5 support


Outdated BLOG Post

Requirements

  • an arduino mysensors serial gateway connected via usb/serial on a linux host
  • an openhab installation (not required for testing, but it would be usefull)
  • configured openhab items (atm only NumberItems are supported)
  • some sensors
  • python pip installed

Installation

    git clone https://github.com/thehawkes/pymygw.git
    cd pymygw
    pip install -r requirements.txt

Configuration

config.py

# MQTT/Openhab
Publisher = 'MQTT'

'''
    Arduino Serial config
'''
SerialPort = '/dev/ttyACM0'


'''
    MQTT config


    TLS Attention
    !!!The broker dns name and the CN in the tls cert must be the same!!!
'''
MQTTBroker = 'mqtt.home'
MQTTTLS = True
MQTTPort = 1883
MQTTTLSPort = 8883
MQTTUsername = 'pymygw'
MQTTPassword = 'pymygw'
# https://github.com/jpmens/mqttwarn/issues/95
MQTTProtocol = 3
MQTTTopic = 'pymygw'
MQTTCert = 'pymygw.crt'
MQTTKey = 'pymygw.key'
MQTTCa = 'ca.crt'

'''
    Web Config
    only available if the OpenhabAPI is used
'''
WebPort = 5000
WebDir = 'web'

'''
    Openhab config
'''
OpenhabAPI = 'https://adugw.home:8080/rest/items'
OpenhabAPIList = 'item'
OpenhabCacheTimeout = 300

Start

    cd <<installdirectory>>
    python app.py

Webinterface

only available if the Openhab Rest Api is used as the publisher

The gateway offers a simple Webinterface on Port 5000 to "glue" sensors to openhab items.

Edit config.py to change the port

WebPort = 5000

About

mysensors to openhab gw

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 95.3%
  • HTML 4.7%