Hi everyone, I've changed my set-up so I now use Node-RED for most of my home automation, including control of my OTGW. That means I don't really have any use for this package anymore. If someone would like maintain this package, please let me know. Otherwise, I'll still try to respond to issues, but I'm probably not going to add any features or fix bugs anytime soon.
You may want to look at one of the forks of this repo to find a maintained version. If you just want to connect your OTGW to Home Assistant, I suggest you look at the official component. It's possible to use this component over TCP with ser2net as per the example here.
This package allows for communication between an OpenTherm Gateway, running the firmware by Schelte Bron and an MQTT service. It was tested using Home Assistant's built-in MQTT broker.
Currently, only direct serial communication is supported, but implementing further types is pretty easy. I'm open to pull requests.
The MQTT client used is paho. It's one of the most widely-used MQTT clients for Python, so it should work on most brokers. If you're having problems with a certain type, please open an issue or send me a pull request with a fix.
The configuration for the bridge is located in config.json.
{
"otgw" : {
"type": "serial",
"device": "/dev/ttyUSB0",
"baudrate": 9600
},
"mqtt" : {
"client_id": "otgw",
"host": "127.0.0.1",
"port": 1883,
"keepalive": 60,
"bind_address": "",
"username": null,
"password": null,
"qos": 0,
"pub_topic_namespace": "value/otgw",
"sub_topic_namespace": "set/otgw"
}
}
To install this script as a daemon, run the following commands (on a Debian-based distribution):
sudo apt install python python-serial
sudo mkdir -p /usr/lib/py-otgw-mqtt
cd /usr/lib/py-otgw-mqtt
sudo git clone https://github.com/martenjacobs/py-otgw-mqtt.git .
config.json
with your favorite text editor/usr/lib/py-otgw-mqtt
you will need to change the WorkingDirectory
in the file first.
sudo cp ./py-otgw-mqtt.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable py-otgw-mqtt.service
sudo systemctl start py-otgw-mqtt.service
journalctl -u py-otgw-mqtt.service -f
By default, the service publishes messages to the following MQTT topics:
If you've changed the pub_topic_namespace value in the configuration, replace
value/otgw
with your configured value. TODO: Add description of all topics
By default, the service listens to messages from the following MQTT topics:
TODO: Add description of all topics