Thanks again @sour_brambles . OpenTherm Thermostat will be actually sitting on D1 mini, so Iām guessing I donāt need to touching pins configuration in the arduino sketch. Esp32 I was mentioning previously will be only reading temp value from external ble sensor (in the room I want to control the temperature) and sending it back to HA via esphome. Then, HA will be publishing temp value to OpenTherm Thermostat topic.
In my heating setup OpenTherm Thermostat will be mounted next to boiler (as it needs to be connected via wires), and the room Iām trying to control temp in is couple of walls away from the boiler. I donāt want to be throwing cables all around my house, therefore I decided I need to look around for any wireless solution. And obviously Iām big HA fan, so I want to have it all in HA Thanks to OpenTherm Thermostat and your help guys I think I found exactly what I need. Will try to get it all implemented over the weekend.
Hi guys. So I got my open therm termostat working. Itās taking temp from external bluetooth sensor (ESPHome is reading temp from sensor and then HA is publishing it to OpenTherm thermostat ). Everything is working well, except one little problem. From time to time Open therm is showing 0 degree for current temp (the one measured remotely in controlled room). I have checked and there is no zeros coming from the ext temp sensor. Also HA is not publishing any zeros to OpenTherm Thermostat. I believe something is happening inside the thermostat itself. Iām using the sketch from this github link https://github.com/diyless/home-assistant-opentherm-thermostat. Any idea of what can be wrong? How can I trouble shoot this problem?
Hi
can you tell how often is temperature published to the MQTT?
you can try to increase timeout in sketch:
set 300 (5 min) or so and see if issue still happens.
P.S.that might be causing it
you can remove if statement and always return t to completely bypass timeout function. That was introduced as a fallback to the internal sensor (DS18B20) to avoid house freeze if broker fails or external temp is not published for a long time for some other reason.
Actually for a full shutdown/eco mode (low temp for floor only) im using slightly tuned basic sketch from home assistant example and all additional logicis done in node-red. That was faster for me than constantly uploading firmware to ESP and then bringing it to boiler, test, repeat etcā¦
If actual room temp is more than 0.1 Ā°C above setpoint - im sending some predefined value (29 in my case) to the opentherm-thermostat/setpoint-override/set topic.
Heres attached code:
thats an archive inside png since forum does not allow archives uploading. Download it and open with archiver.
Heres how does it look at the node red side:
Every 10 seconds im checking if difference is more than 0.1Ā°C, if so - second exit is active and sends setpoint override to the mqtt. If less 0.1 - no action performed, sketch works alone.
And eco-switch box is:
also thereās some additional logic for hysteresis, configuring floor mode temp via home assistant input and so on
Thanks a lot for light speed reply. Iām publishing temp value every 20 sec. It seems that zero values is showing up in some almost regular intervals (see below). I will check that Timeout option and will let you know whether it worked or not.
One more thing. One day my MQTT broker stoped working and at the same time I realised an error message āA9ā showed up on my Vitodens 111-W boiler. A9 is OpenTherm communication problem. Is it possible that MQTT broker failure could cause any communication issues to OpenTherm protocol.
Yep, it might be that ESP stuck trying to connect to the broker and āforgotā about OT communication. It depends on what exactly failed on the broker side. I.e. if socket was in open state but was not sending any reposnse - arduino library will freeze because it sees than connection is accepted and so waiting for a response. Maybe we need some watchdog in arduino code to reset if program hangs.
P.S. sorry, found actual reason: that is mistake by design
thermostat will try to reconnect indefinitely. Seems that at the moment of writing that sample i was not assuming that something might happen with broker (im using emqx failover setup, 2 brokers in parallel).
To fix that we would need some rewriting and disabling mqtt publish if broker not available
set 300 (5 min) or so and see if issue still happens.
I have set it to 300 and zeros are still showing up. Actually I can even see some -127 values in my HA history. I will leave it over the night and check again tomorrow morning. One thing I dont really understand. If that IF statement was meant to failback to internal sensor (which is very nice idea btw), why itās not getting correct values from it?
Strangeā¦ Either its faulty or some error in sketch. Flashed that sketch to my board, working without an issue so far. Let move a discussion to the private messages so not to flood forum. When we find error in a sketch - will post it here.
@wzbart figured out what was causing zeros in temperature readings. HomeAssistant can send āunavailableā payload if sensor was out of range for some time and arduino sketch treats any invalid string as zero, so response from thermostat was 0.
Iāll update the sketch to just skip non-numerical strings to avoid this issue.
Sorry for that, iāve forgot to update the sketch. Now should work, added flame status and level reporting on topics: opentherm-thermostat/flame-status/get for status (on/off) opentherm-thermostat/flame-level/get for current level (0ā¦100)
P.S. the sketch has been updated to support domestic hot water functions and also thereās now a check for temperature validity, if any string other than a valid number is sent to a setpoint or temperature topic - it is ignored.
Also added manual setpoint override, if for some reason you need set specific heating water temp (water going to your radiators/floors etc) - use setpoint-override/set topic. You should send temperature to this topic every 30 sec or less. To leave setpoint_override_mode - just stop sending, and it will return back to PID after 30 s or send any message to the setpoint-override/reset to return back immediately.
Thanks a lot @shcherban. New sketch is goin to be much of help if it comes to more advancet boiler control. Right now Iām using this thermostat to control one area with floor heating. Now I might use that new override topic to send out temp from a different room (with radiators) in case corrent temp is lower than target one.
Override topic is for heating water temperature, and not room temperature . If you just send 18-22Ā°C, radiators would not get enought thermal energy and wont heat your room.
To switch to coldest room just send room temp to the regular current_temp topic .
Actually in my setup I can use it to do exactly what I described. Right now OpenTherm Thermostat is only controlling my floor hearing in lining room (letās say set to 21 degree). In case I need to send more temperature to my kids room radiators (target temp 22 degree) I just close floor heating loop with electric valves and set override topic to letās say 60 degree until current temp in kids room actually hits the target one. On radiators I have zigbee thermostats and they will make sure current temp is not going to go above the target one. Then just I stop sending override topic and OprnTherm control is going back to my living room.
So this is my idea for using override topic at least. Let me know in case I missed anything
Now i see. All correct, youāve done all the setup as it was intended (i mean override topic). Write here a word about results when you test your system.