DIY OpenTherm Thermostat?

@shcherban thanks for this. That is what I thought, that the room stat connection be shorted. I’ve not had the time today to test this. I purchased the bundle, and the solder joints looked good.

On another note, I have soldered the ds1820 but the code / serial output seems to ignore it’s existence, and instead the temperature is permanently 15.00 (internal sensor) – which I struggle to believe is permanently at the same value. This did work with the DIYLESS blog code.

Please could someone share both their working DIYLESS code for the purchased OT Master and ESP32 Min132 v1.0.0 and HA configuration.yaml ?


EDIT: Which is the better, and what are the differences between the ESP code on diyless blog post and github? Both seem quite old.

https://diyless.com/blog/home-assistant-opentherm-thermostat

I have resolved my opentherm blues, and now have a working system. I utilised GitHub - arthurrump/esphome-opentherm: Create your own smart modulating thermostat using the OpenTherm component for ESPHome which easily integrated with esphome.

Would you mind sharing your esphome config file?
I tested it out too, but with their PID parameters, it was too aggresively heating.

Of course. I’m still learning myself, so out of interest what do you mean it was too aggressive?

It is actually just the one from the example in github here, with the sensor changed (security creds trimmed):

esphome:
  name: esp32-01
...
captive_portal:

opentherm:
  in_pin: 21
  out_pin: 22
  ch_enable: true
  dhw_enable: true

output:
  - platform: opentherm
    t_set:
      id: t_set
      min_value: 20
      max_value: 65
      zero_means_zero: true

sensor:
  - platform: opentherm
    rel_mod_level:
      name: "Boiler Relative modulation level"
    t_boiler:
      name: "Boiler water temperature"
    t_ret:
      name: "Boiler Return water temperature"

  - platform: homeassistant
    id: ch_room_temperature
    entity_id: sensor.average_temperature
    filters: 
      # Push room temperature every second to update PID parameters
      - heartbeat: 1s  

binary_sensor:
  - platform: opentherm
    ch_active:
      name: "Boiler Central Heating active"
    dhw_active:
      name: "Boiler Domestic Hot Water active"
    flame_on:
      name: "Boiler Flame on"
    fault_indication:
      name: "Boiler Fault indication"
      entity_category: diagnostic
    diagnostic_indication:
      name: "Boiler Diagnostic event"
      entity_category: diagnostic

switch:
  - platform: opentherm
    ch_enable:
      name: "Boiler Central Heating enabled"
      mode: restore_default_on

climate:
  - platform: pid
    name: "Central heating"
    heat_output: t_set
    default_target_temperature: 20
    sensor: ch_room_temperature
    control_parameters: 
      kp: 0.4
      ki: 0.004

EDIT: I’d be interested to know too how to tell what of the opentherm parameters a boiler supports. I’ve tested other OT sensors and they return wild values, I assume that means those particular sensors are not available on my boiler. Just interested to know what others have discovered in this area.

I meant with ‘aggressively heating’ that it was heating up really fast, with too much overshoot. So for me, these parameters should be changed, but they are not really explained. Even in the esphome documentation, i did not find a lot. Is the 0.4 a percentage with maximum 100 for example, what happens when taking a higher or lower value. It would also help if you could find a table with used values in certain circumstances (regarding how big is the room, how well isolated is the house/age of the house, …). There is a autotune function in esphome, but it seems not to produces always good results. I did not try it yet however.
Regarding the number of sensors your boiler supports, i think it’s trial and error. I think most of the basic sensors are everywhere supported. Probably you could find some more info when looking in other opentherm open source initiatives.

1 Like

Hi has anyone been able to use powercalc in conjunction with your diy OT install to get a fairly accurate gas consumption reading?? My gas meter doesn’t have the p1 port nor the magnetic ticker…

@shcherban, do you also have a blueprint for the thermostat so you can add automations and schedules for the thermostat? I have it working but only by manual controle. Other question do you also have a sugestion for a hardware knop to change see the temperature and change it? By girlfriend like physical buttons/knops to see and change the temp.

Dont know are you talking about master shield or thermostat (the one with ble sensor in bundle).

  1. For the thermostat (with BLE) schedule is in our plans to do as a built-in functions. For any other generic usage from HomeAssistant - i should check HA docs on how to create schedules and maybe will write some post on Diyless bolg.
  2. Physical control would be nice, but it requires a bit more work, like case, new board, knob itself, some display and software to glue all this together. We are considering this as some ‘next gen’ of our thermostat, but it wouldn’t be so fast(
1 Like

Check this tread: Smart heating scheduler for Home Assistant (extra: multi-zones version) - Share your Projects! - Home Assistant Community (home-assistant.io)

As for a physical button / touchscreen perhaps en ESP32 with OPenHASP can help you:

1 Like

@shcherban and @Keeze thanks both for your reply. Unfortunatly i used the ESP8266. I didn’t know at the time i started the project that the phiscal controle would have been an issue for the other users in my house. As this is not possible as off now with this setup what would you advice to use?

Hi Dolphinman, I have this exact problem too. Bought that kit last week. At first it seemed to work but after a while OT conn loss. Did you happen to find a solution yet?? I have an Intergas Kombi Kompakt HReco. The only thing that works is sending commands like on/off to the boiler. So there is some communication going on… but no data coming back to indicate what boiler status is after that.

Maybe boiler is waiting for some vendor-specific command, and if its not issued within some period - it rejects further communication.
Did i understood correctly that:

  1. It works for some time
  2. Starts loosing OT connection
  3. You restart the boiler/thermostat/whole setup
  4. Back to 1

?

Hi
Im using the DIYLESS code and Im facing with an problem (I guess) about pid modulation. The “float ophi = 50;”, but when is heating for the first time, this just increase by 1% until it reach its destination: 50. When the thermostat declare its heat reach, thermostat send command “off” to boiler. On the next “heat” command ![Screenshot 2023-02-04 at 22.50.34|635x415]
(after about 1 hour) the boiler-target-temperature stays on 50, no modulation, only the flame level seems to modulate. Is it normal what is happening?Screenshot 2023-02-04 at 22.50.34
Screenshot 2023-02-04 at 22.50.37

The screenshots above are from its first running after I flash it.

Hi, would you like to help me with this entry? I cant make it work; where to enter those values as I dontt have any. Please

Helllo
Great post. Yesterday I have set up the ophentherm termostat, hot water works like a charm, i love it, but heating is not turning on. Thats my thermostat:

climate:
    - name: "My Thermostat"
      unique_id: "my_thermostat_1"
      modes:
      - "off"
      - "heat"
      current_temperature_topic: "opentherm-thermostat/current-temperature/get"
      mode_command_topic: "opentherm-thermostat/mode/set"
      mode_state_topic: "opentherm-thermostat/mode/get"
      temperature_command_topic: "opentherm-thermostat/setpoint-temperature/set"
      temperature_state_topic: "opentherm-thermostat/setpoint-temperature/get"
      min_temp: 12
      max_temp: 28
      value_template: "{{ value }}"
      temp_step: 0.5

Its taken from website.
Can anyone help me?

Do you have mqtt explorer installed? That way you can see whats happening and check if your actually sending / receiving the setpoint and temperatures.

Are you using ready-made thermostat (preflashed one) or you have uploaded a sketch yourself?

We’ve released a second version of the thermostat, which is based on ESP32-S3, so it gets a bit better Bluetooth performance if you are using Xiaomi BLE Thermometer. Also it has a tiny display and a few buttons to be operated without HomeAssistant/web UI (just in case).
Also we added an expansion connector there, which is connected to ESP32. You can either write your own firmware or drop us some ideas which features would be nice to have. Using that connector you can drive/communicate to some external devices.

2 Likes

Nice work! I have the first version of this thermostat and it serves me well. I printed a small case and attached it to my boiler and send it commands over WiFi. I like the idea of a screen and buttons a lot, but the main barrier to buying on of these for me would be the external power supply. Most households have no power supply near their thermostat wire and running cable there has a low WAF. The strategically placed couch on your product image is there for good reason :slight_smile:

Are there any plans to make a version with an integrated buck converter so it can run over the power supplied on the opentherm cable? Or am I missing something here?

1 Like