Snippet: OpenTherm Gateway for Home Assistant
Adding the OpenTherm Gateway to Home Assistant
These are the steps I took to add my own opentherm gateway to home assistant. May this example help you add yours.
Assumptions: You have a working home assistant installation, you have a working MQTT broker on the same machine or enabled the embedded MQTT broker (which is what i’m using) and you have connected the OTGW via serial or FTDI usb.
Firstly follow the installation instructions available on py-otgw-mqtt’s github page.
On step 4 of those instructions you make your configuration settings. These are mine.
{ "otgw" : { "type": "serial", "device": "/dev/ttyS0", "baudrate": 9600 }, "mqtt" : { "client_id": "otgw", "host": "127.0.0.1", "port": 1883, "keepalive": 60, "bind_address": "", "username": "username", "password": "password", "qos": 0, "pub_topic_namespace": "value/otgw", "sub_topic_namespace": "set/otgw", "retain": false } }
Then edit your configuration.yaml file, I’m not very familiar with this syntax yet but spacing seems very important.
climate otgw: - platform: mqtt name: "Thermostaat" modes: - auto current_temperature_topic: "value/otgw/room_temperature" temperature_command_topic: "set/otgw/room_setpoint/temporary" temperature_state_topic: "value/otgw/room_setpoint"
And that’s it. If all went well you should see a new section on reloading your configuration.
Edit 2019-03-22: Shortly after writing this snippet a proper HA OpenTherm component was added, I would advice the use of that over this snippet.
Just to address one thing I left out originally, you can change the step amount by adding the following entry to you customization. (it might also work in the main config but i’m not sure about that)
climate.thermostaat: target_temp_step: 0.5
Thanks a lot for this! It works great, although I have a couple of small issues:
– The state is always off, nothing like heating or idle, as with the HomeAssistant opentherm_gw component
– The sensors (manually created) have a precision of 0.01, I would prefer 0.5 or 0.1
– Changing the temperature is in steps of 1 full degrees, no way to set 19.5C for instance
– Changing the temperature takes almost a minute to actually come through, but that doesn’t really bother me
Thanks again!
Hi, when I wrote this article the OpenTherm component was not yet available. I would encourage anyone to use that instead. Will update the article with a link to that.
And just to address one of your points, i’ve added a way to change the step amount.
I do believe the delay is something that is OpenTherm related, the protocol was not made with immediacy in mind.
Thank you!
BTW: I don’t have my HA server near my OTGW, so I am bound to serial over TCP which isn’t very reliable, therefor I prefer an MQTT solution like this.