Friday, December 30, 2022

Quest for lower electricity consumption - OpenTherm

The first article ends by the need to get more data from boiler because it heats warm water too often.

The first step I did was actually disabling circulating warm water every 15 minutes which I used to have always warm water immediately instead of waiting until it reaches a tap. Surprisingly, I observe almost no difference. There is still quite warm water immediately in the tap but the boiler heats water with the same frequency...

My home heating setup consists of two main heating branches - one with central heating (additionally split to radiators and floor heating) and the second with external tank for warm water. For some reason there is no three-way valve to stop flowing water to external tank when running in central heating mode. I suspect this is the culprit why boiler heats external tank approximately every two hours. To confirm it, I need data about what mode the boiler runs (although it can be guessed from the power consumption) and temperature in the external tank which triggers its heating. All can be retrieved via OpenTherm protocol.

OpenTherm standard is designed for communication between boiler and thermostat. Mine boiler - Thermona Therm EL 9 - does support it.

Googling how to get data from OpenTherm resulted in several links:

  1. https://www.home-assistant.io/integrations/opentherm_gw/
    Hurray - there is a way how to get data to Home Assistant!
  2. http://otgw.tclcode.com/ - the gateway. Unfortunately, it looks quite complex...
  3. https://github.com/jpraus/arduino-opentherm - library for Arduino by Jiří Praus with his HW looks much easier to use and I went for this option.
  4. Only later I have found out it would be enough to use https://ihormelnyk.com/opentherm_adapter (because I don't need to communicate with thermostat).
I have ordered OpenTherm Gateway Arduino Shield. I struggled to find 24V power supply, even wrote to Jiří who quickly suggested GME but eventually I've ordered it from Tipa. Soldering it together was a challenge as I have soldered only big electronic parts till now. Because of my "huge" experiences, I've managed to solder headers upside down so I need to use wires to connect it to Arduino Uno for testing.

Eventually, I was able to put everything together and test the hardware, interfaces and self-test. All tests have passed. The only issue/difference I saw was in step 6 where I measured ~4.7V instead of 5-7V.

Here is the wiring because it was not obvious for me; pin constants in code are the same:
  • OpenTherm jumper set to 5V
  • OpenTherm D3 - Uno D3 (via header) : #define BOILER_IN 3
  • OpenTherm D5 - Uno D5 (via header) : #define BOILER_OUT 5
  • OpenTherm 5V - Uno 5V
  • OpenTherm GND - Uno GND

Having wired the OpenThem shield with Arduino, next step was to get data from boiler using sample code. The code uses arduino-opentherm library which needs to be put into Arduino IDE Sketchbook library folder (e.g. C:\Users\{username}\Documents\Arduino\libraries\arduino-opentherm on Windows).


It worked! Going through OpenThem 2.2 specification, I've identified useful messages for my boiler:
  • OT_MSGID_STATUS - boiler's status (what does it heat)
  • OT_MSGID_FAULT_FLAGS - current fault code
  • OT_MSGID_MODULATION_LEVEL - boiler's power (0-100%)
  • OT_MSGID_CH_WATER_PRESSURE - boiler's water pressure
  • OT_MSGID_FEED_TEMP - boiler's water temperature
  • OT_MSGID_DHW_TEMP - warm tank's water temperature
  • OT_MSGID_OUTSIDE_TEMP - outside temperature (for equithermal regulation)
  • OT_MSGID_DHW_SETPOINT - target water tank temperature
Next step is to switch from Arduino Uno to WeMos D1 so I can send the data wirelessly to my Home Assistant.

No comments: