Domotibart wrote: ↑Sunday 02 December 2018 21:40
I have been using the OTGW in domoticz for 2 years now. The first year by USB connection. To get more flexibility i added a esp8266 to connect the OTGW via LAN.
Unfortunately i never got this to work flawless. In the beginning i could not even connect domoticz to the esp8266. For some reason the otmonitor tool worked at once without any problems.
After experimenting with some different firmware for the esp8266 i got it working. At this time use the latest espeasy firmware. But ..... stil i get a lot of errors. It works at startup but after a few hours i reguelarly get zero valuesto eventualy lose the connection. Setting the room temperature from domoticz never worked.
So why does everything work perfect with the otmonitor software and does not in domoticz. I beleive the big difference is that domoticz uses PS=1 to control OTGW and otmonitor does not.
So here my weekend project was born. Let domoticz do the same as otmonitor does. This is how;
The plan is that the ESP is going to parse all the opentherm codes and put the all the sensor data in its dummy sensors. The ESPeasy firmware takes care of sending all the data to Domoticz. Bonus with this method is that i can use domoticz and otmonitor at the same time.
1- First step is to change the ser2net ino from the easyesp firmware. I added some code to parse the opentherm data and create events in the ESP8266. I had never done this so this took some time with trial and error.
2 - Second step make some rules in espeasy to add the parsed data in the corresponding dummy sensors. This is a standard procedure and was easy to do.
3 - Third step was to create virtual sensors in domoticz so that the esp8266 transfers the data to domoticz.
4 - fouth step was to make a virtual setpoint device in domoticz and send the new temperature setpoint to the esp8266 so that the esp8266 can send a serial command to the OTGW setting a temporary temperature. This was the most challenging part becouse i had to make a lua script in domoticz so send a command to the esp8266.
Its now sunday and i have got three values in domoticz; room temperature, room setpoint , boiler temperature and a setpoint temperature thermostat.
It is working for a few hours but it look promising, its the first time that i can set a the therostat from domoticz!
I will put the codes from the ser2net.ino , the lua script, and the esp rules in my next post maybe someone who has more coding skills can optimize them. If not, for me it is a nice workaround to get opentherm working without any errors in domoticz.