Hi Jodur,
In my use case, the MQTT client/OTGW host is on a separate machine than HASS, so writing a component wouldn’t really work without at least some code on the OTGW-side.
I guess that if you’re using an esp and connecting from your HASS host, a built-in component would seem better. However, I still think a better solution would be to connect to HASS from the esp. This way you could push data instead of pulling it, potentially reducing network load.
This does mean you’ll have to write a client for your esp (in C, probably). If you want to use my program, you could replace your esp module with a RPi Zero W. That one costs around €11 and has WiFi built-in.
I’m using the MQTT climate component to control my thermostat, and that works great.
I don’t have a good way to debug a TCP version, that’s why I didn’t build it yet.
Hi martenjacobs,
I would be better as you suggested that the MQTT client is running on the ESP.
This should be possible with micropyhton on the ESP. Perhaps your code could easily ported to use with micropython. I will also investigate this further.
I also tried the MQTT climate component, i do not permanent control the temperature from homeassistant. My thermostat has its own clock programm, and i only want to override the setpoint temporary. The gateway is supporting this with the <TT= xx> and the original otmonitor uses this command for the setpoint topic. After the next switchpoint of the thermostat the temperature setpoint is set back to the temperature that is set in the clock programm. The MQTT climate component doesn’t support this, so this is not really an option for me.
martenjacobs,
I have added the code for the tcp variant. (Your phyton framwork was universal, so it was very easy for me to fill in the tcp/ip variant, despite the lack of phyton knowledge yet. I am also new to github (used svn in the past when i was active in coding) so i am looking how to get these modifications to you. Also i wan to make a modification that for example the flame status is not send every time. This current programm create a large amount of data within homeassistant.
I agree that there should be a filter of some sort, to make sure we don’t send duplicate data. If you don’t want the flame data to take up space in your event database, you could simply not subscribe any listener to it. This way, while some traffic is generated (we’re talking less than a kB per minute), it’s not saved anywhere.
In my config, I can set the temperature from HASS, and override it again from my thermostat. This is my config:
climate otgw:
- platform: mqtt
name: "OTGW"
modes:
- auto
current_temperature_topic: "value/otgw/room_temperature"
temperature_command_topic: "set/otgw/room_setpoint/temporary"
temperature_state_topic: "value/otgw/room_setpoint"
Hi, I always used the OTGW plugin in Vera. This communicates directly with the gateways. HASS sees this as a thermostat. This always worked but sometime in the past it stopped working correctly (please see this post)
Anyone else using OTGW this way?
It would be nice that HA can connect directly to the OTGW without the otmonitor software running.
For now I got this working with the otmonitor software running and configured MQTT. In HA i used the setting that MartenJacobs used.
Maybe someone can script this in Python as an addon for HA.
How do i start the otmonitor on my raspberry? I got my otgw working with a esp.
Hi Jodur,
Can you please share the code for the TCP variant?
Thanks!
You can find it on my github: https://github.com/jodur/py-otgw-mqtt/commits/tcp, This is a fork of the original github from the tcp branch ( https://github.com/martenjacobs/py-otgw-mqtt)
I made a pull-request to the original author, but i never got a reply.
Thanks Jodur!
I changed the setup. Removed the NodeMCU from the OTGW, and attached it (with serial USB cable) to a Pi Zero. On the Pi Zero i installed the py-otgw-mqqt script and let is publish (over wifi) to the HA builtin MQTT broker.
Guys, I’ve found this thread as most suitable.I’d like to connect my system to the heater, the controller (don’t know if boiler too ;-)) supports opentherm.
What’s the cheapest suitable way for now to connect it via MQTT? It doesn’t have to be LAN, can be ESP too.
I’d be grateful. I’ve found board on NODO shop but wondering if there are cheaper ways (shipping is almost the cost of board).
Hello! OpenTherm Gateway integration works great for me, thanks to developers! But I wish to have more options. May be I miss something and it is possible to change domestic hot water set point, switch on and off central heating? And maybe change set point of room temperature?
Also using the integration without problems.
You can add entities with AA=MsgID if they are returned from boiler.
Look at http://otgw.tclcode.com/firmware.html#dataids
Domestic hot water only editable if set manually in boiler.
Look in tabels boiler and thermostat what is possible with your devices
Thank you. Yes I found that I was not able to change hot water set point, because it was off.
service: opentherm_gw.set_hot_water_ovrd
data:
gateway_id: thermostat
dhw_override: ‘1’
Just tried again. I can change domestic hot water temperature with Otmonitor sending command like SW=60. But could not found corresponding service like opentherm_gw.set_control_setpoint for hot water in HA.
Could you please point me out what service i should use to set domestic hot water?
The developer of this script didn’t create this service I believe.
Create a pr if you want this
It is not my level yet ! But I looked at the code. HA use python library pyotgw for this integration an library contain all method I wish to be implemented:
pyotgw.set_target_temp(self, temp, temporary=True, timeout=OTGW_DEFAULT_TIMEOUT)
pyotgw.set_dhw_setpoint(self, temperature, timeout=OTGW_DEFAULT_TIMEOUT)
pyotgw.set_ch_enable_bit(self, ch_bit, timeout=OTGW_DEFAULT_TIMEOUT)
So may be one day…
If I use the new integration method for opentherm no climate device is created. Has anyone else seen this before?
Other opentherm devices and sensors are normally created and have actual values.
I have used this integration in the past with succes but after that I deleted it and added again the climate device doesn’t appear. I’am using version 102.2 and use the openthem gateway via lan(socket)
Hi @DJTerentjev do you know any other way to call these methods without their implementation in HA? I’m particularly interested in switching off central heating. However, it looks like currently it’s achievable only with passing control back to thermostat. That is not acceptable on the long run.