Laxilef / OTGateway

OpenTherm gateway for HomeAssistant
GNU General Public License v3.0
150 stars 20 forks source link

Begginer's frustration... #10

Closed kulisau closed 9 months ago

kulisau commented 10 months ago

Hi, I very recently started using the Home assistant and bought Igor's wemos hat, assembled it and was about to install it and then it clicked that I don't even know how to set the desired room temperature using OpenTherm. I can't find any quides online for OpenTherm in particular. I was looking at DYILESS guide, but they assume I have an MQQT sensor. My current setup is a Shelly relay inside of my boiler and Sonoff zigbee thermometer in my living room working in ZHA mode . From my understanding generic_thermostat isn't suitable for the OpenTherm as it's just a relay controller.

Apologies if this is something obvious :)

Laxilef commented 10 months ago

Hi, Does your boiler support OpenTerm? If it is supported, you can flash your ESP8266 with this firmware and the boiler will be integrated into your home assistant.

Just don't forget to install Mosquitto broker :)

The temperature from the zigbee thermometer can be transferred to the controller using automation in HA.

kulisau commented 10 months ago

Yes, it does :) My boiler is Radiant R2KA. I already have flashed the wemos and soldered all the headers needed. I do have mosquitto container running. I flashed the Shelly relay to tasmota. My question is how can I setup a card/thermometer to set the desired temperature at the room?

Laxilef commented 10 months ago

If I understand correctly, then you need to create a "thermostat" card and select the entity "climate.opentherm_heating" there

kulisau commented 10 months ago

Can you please provide any example how to use that with a zigbee thermometer in mind?

Laxilef commented 10 months ago

Have you created an automation that transfers temperature from a zigbee sensor to a controller?

kulisau commented 10 months ago

Not yet. I haven't even connected the OT solution to my boiler as I don't understand how to set the desired inside temp up.

Laxilef commented 10 months ago

You need to flash your ESP, configure it: set pins and mqtt (server IP, login and password). Then create automation as written in the example and configure the PID or equitherm algorithm in the device settings in HA.

The controller itself will maintain the set temperature in the house by adjusting the heat carrier temperature.

bigbrother72 commented 10 months ago

Hi I think you need to disconnect Shelly relay and connect the Opentherm controller instead. r2ka-1

After that you must connect to Opentherm contorller and make some settings for MQTT etc https://github.com/Laxilef/OTGateway#quick-start

r2ka-2

After that in HA go to MQTT intergartions 192.168.xxx.xxx:8123/config/integrations/dashboard

Screenshot 2023-11-12 at 13-03-26 Settings – Home Assistant

Then MQTT

Screenshot 2023-11-12 at 13-05-30 Settings – Home Assistant

Then Devices

Choose Opentherm controller

Screenshot 2023-11-12 at 13-05-47 Settings – Home Assistant

Then add controls to dashboard: Screenshot 2023-11-12 at 13-06-17 Settings – Home Assistant

kulisau commented 10 months ago

Thank you for your answers! The biggest question is how to set the desired temperature of the room. Is it possible to use a card like generic_thermostat to set the temperature? Or maybe this isn't possible at all and the software always tries to keep 23 degrees?

Laxilef commented 10 months ago

You can set the target temperature via the thermostat "climate.opentherm_heating".

The integration already includes all the necessary entities for control. Therefore, there is no need to create a generic thermostat.

bigbrother72 commented 10 months ago

you will see the control elements after completing the last point of my previous message.

like this: Screenshot 2023-11-12 at 17-23-30 Overview – Home Assistant

kulisau commented 10 months ago

I just now found some time to get back to this... So I do have another problem. I can flash D1 mini firmware no problem, the device boots ok, I connect to it and setup wifi, so far so good, however, as soon as I set MQQT and pins (D5 out and D6 in) for OT communication device keeps boot looping. I tried different firmwares but to no avail. My board is cheap Wemos D1 mini clone from the Aliexpress. I can confirm the board is working as I also tried Tasmota firmware and it managed to communicate with the boiler ok.

Laxilef commented 10 months ago

What firmware file did you flash?

Can you attach a log from the serial port at the time of the cyclic reboot?

kulisau commented 10 months ago

I tried 1.3.3, 1.3.2 and one older for d1 mini lite and pro versions. The output is a bit mangled (not really sure which port speed I should use. 115200 seemed the best fit): ▒▒▒g▒{▒▒g|▒l ▒dc▒ |{▒d▒o▒▒n▒ l`▒▒;▒d▒l▒ ▒ ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset load 0x4010f000, len 3424, room 16 tail 0 chksum 0x2e load 0x3fff20b8, len 40, room 8 tail 0 chksum 0x2b csum 0x2b v000703c0 ~ld ▒▒▒'▒r▒▒o|▒ l▒ l c▒▒|s▒l▒n▒ ▒g▒$▒▒{▒l▒d▒

Laxilef commented 10 months ago

Hmm, this is strange. Try flashing this build and please send the logs from the serial port here. firmware_d1_mini_1.3.4_debug.zip

kulisau commented 10 months ago

Flashed it, configured PINs and MQQT. Serial output: %▒▒w▒B▒Y.+▒h▒

         )▒\5▒▒PKT- )dУ▒    5Y
                              )L▒A▒ ▒▒T▒/▒[▒P9▒▒Z%  )l▒@▒▒!NZ       HHi▒9▒D▒ҭ9▒F▒PED ▒▒
                                                                                       rf cal sector: 1020

freq trace enable 0 rf[112] : 0▒

Laxilef commented 10 months ago

This is not the full log. Without a full log, I can’t understand where to look for the error.

kulisau commented 10 months ago

I turned off flow control and getting this now:

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset load 0x4010f000, len 3424, room 16 tail 0 chksum 0x2e load 0x3fff20b8, len 40, room 8 tail 0 chksum 0x2b csum 0x2b v00070090 ~ld ▒▒▒▒n▒s▒▒o|▒d ▒dc▒ |;▒d▒g▒▒o▒ d▒▒s▒$▒l ▒

kulisau commented 10 months ago
Screenshot 2023-11-19 122231
Laxilef commented 10 months ago

Ooops. I made a mistake. This build (new) should display all logs. firmware_d1_mini_1.3.4_debug.zip

kulisau commented 10 months ago

a step further now...

Screenshot 2023-11-19 122839

I have 64 chars long MQTT pass, might that be a problem?

Laxilef commented 10 months ago

Maybe. The password in the config is limited to 32 characters:

    char user[32];
    char password[32];
kulisau commented 10 months ago

dang it :D About a month or so ago when I installed MQTT and tried to attach a Tasmota switch with short (5-6 chars) pass, Tasmota refused to work. I read somewhere that the pass is suppose to be super long... I'll give a shorter pass a try and will let you know how that went

kulisau commented 10 months ago

It connected to MQTT now, however, it still boot looping...

Screenshot 2023-11-19 125218
Laxilef commented 10 months ago

I think this is a problem with the library PubSubClient =\ If I'm right, then this build will work. firmware_d1_mini_1.3.4_debug.zip

kulisau commented 10 months ago

still the same...

Laxilef commented 10 months ago

Ok, I need to think. I'll come back here a little later.

kulisau commented 10 months ago

I re-flashed the board again. This time I haven't changed MQTT settings at all, just changed PIN accordingly and it started boot looping. Can it be that some GPIOs are in-use and overlaps with those PINs I describe? I use the Ihor's Melnyk master shield. Reboots takes place regardless shield is installed on the Wemos board or not

Laxilef commented 10 months ago

What pins do you use?

kulisau commented 10 months ago

Out - 5 In - 6 Internal temp - 7 External temp - I leave as is

Laxilef commented 10 months ago

But on the wemos d1 mini there is no pin number 6 & 7: https://www.wemos.cc/en/latest/d1/d1_mini.html

Or did you mean D5 and D6?

Laxilef commented 10 months ago

9f81b9723d22d27b84d4548c2e12fff5 D5 = GPIO14 D6 = GPIO12 D7 = GPIO13

kulisau commented 10 months ago

Yes, I meant D5, D6 and D7. What has to be provided in PIN fields, D or GPIO values?

Laxilef commented 10 months ago

GPIO

kulisau commented 10 months ago

I adjusted GPIO values and it no longer reboots! Thanks! Will try to connect the shield to the boiler later today. P.S. I'd suggest using GPIO instead of PIN in the settings to avoid confusion 😀

kulisau commented 10 months ago

Great success!

Screenshot 2023-11-19 160716
Laxilef commented 10 months ago

Nice)

kulisau commented 10 months ago

My boiler does not seem to support heating min and max water temperatures. Is there a way to limit the max water temperature for heating? It goes as high as 80 degrees. It seems a bit excessive when just few decimal values are needed to reach the desired temp. Set temperature is 21.5, current temperature 21.1 Screenshot 2023-11-20 at 12 58 37

Laxilef commented 10 months ago

The maximum temperature can be configured through the entity "number.opentherm_heating_max_temp". If it is not activated, then it must be activated in the entity settings.

kulisau commented 10 months ago

It worked. Thanks!

Laxilef commented 10 months ago

I saw your post regarding the overheating of the house. Start by setting the equitherm mode. In most cases it regulates better than PID. There is no need for any precise temperature sensors. You can read how to set up equitherm mode in the readme.

kulisau commented 10 months ago

Will try that, thanks! Btw, I noticed that when DHW is being used, the flame modulation varies between 50-70%, however, when the heating kicks in, it's always 100%. Does it depend on Equitherm/PID settings or something else? I was under the impression that the OpenTherm should regulate the modulation to keep it as low as possible.

Laxilef commented 10 months ago

Modulation is controlled by the boiler software

kulisau commented 10 months ago

First of all, the excel spreadsheet is amazing! I hope I understood it correctly, though 😄 Not sure what's wrong, but second night in the row the software just gives up during the night. Last night I had to physically pull the plug of the boiler out of the socket because the wemos (it's connected internally inside of the boiler) wasn't responding, this morning I woke up by 17 degrees in the room. Had to turn the turbo heating to bring the temperature to somewhat liveable. I can't figure out why image P.S. I use automations to update internal and external temperatures.

Laxilef commented 10 months ago

Does the controller continue to send data to the mqtt server? Show graphs "Heating setpoint", "Heating temperature", "Heating" (on/off)

Laxilef commented 10 months ago

P.S. I use automations to update internal and external temperatures.

And graphs of external and internal temperatures.

kulisau commented 10 months ago

Outdoor temp: image Indoor temp: image I enabled the heating setpoint only yesterday, hence less data: image Heating temp: image

kulisau commented 10 months ago

I'm running the mosquitto in docker container. I'm not sure how can I check the history.

Laxilef commented 10 months ago

This is interesting :) Although I see that setpoint is correct.

Can you also show a graph of the "binary_sensor.opentherm_heating" entity?

kulisau commented 10 months ago

binary_sensor.opentherm_heating has no graphs, only log. You're probably looking for this one. Let me know if that's not the case image