olegtarasov / esphome-opentherm

Create your own smart modulating thermostat using the OpenTherm component for ESPHome
BSD 2-Clause "Simplified" License
30 stars 5 forks source link

[WARNING] Receive response timed out at a protocol level #13

Open clau-bucur opened 2 weeks ago

clau-bucur commented 2 weeks ago

Hi, and thanks for this component! I've just started using it with a thehognl OpenTherm shield + Wemos D1 Mini32 board (ESP32) + Viessmann Vitodens 100-W boiler.

When ESP starts things work alright and device responds to commands but after a while not sure what happens but I see the following warning in the logs: [W][opentherm:339]: Receive response timed out at a protocol level.

It appears every second and when that starts to happen my boiler starts heating all by itself. Visible here: image

The warnings stop after a while and boiler starts to work correctly. But only temporary.

I've attached the ESPHome logs, maybe you can see anything there suspicious? logs_opentherm_logs.zip

My config:

external_components:
  source: github://olegtarasov/esphome-opentherm@main

opentherm:
  in_pin: GPIO19
  out_pin: GPIO18

output:
  - platform: opentherm
    t_set:
      id: ch_setpoint
      min_value: 40
      max_value: 60
      zero_means_zero: true

# Values that can be set maually from HA interface
number:
  - platform: opentherm
    t_dhw_set:
      id: dhw_setpoint
      name: "Hot water target temperature"
      min_value: 10
      max_value: 60
      initial_value: 45
      restore_value: true

switch:
  - platform: opentherm

    ch_enable:
      id: ch_enable
      name: "Central Heating enabled"
      restore_mode: RESTORE_DEFAULT_OFF
    dhw_enable:
      id: dhw_enable
      name: "Hot Water enabled"
      restore_mode: RESTORE_DEFAULT_OFF

climate:
  - platform: pid
    name: "Central heating"
    heat_output: ch_setpoint
    default_target_temperature: 22
    sensor: ch_room_temperature
    visual:
      min_temperature: 15
      max_temperature: 30
      temperature_step:
        target_temperature: 0.5
        current_temperature: 0.1
    control_parameters:
      kp: 0.4
      ki: 0.004

sensor:
  - platform: opentherm
    rel_mod_level:
      name: "Relative modulation level"
    ch_pressure:
      name: "Water pressure"
    t_boiler:
      name: "Heating water temperature"
    t_dhw:
      name: "Hot water temperature"
    t_exhaust:
      name: "Exhaust temperature"
    t_ret:
      name: "Return water temperature"

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

binary_sensor:
  - platform: opentherm
    ch_active:
      name: "Central Heating active"
    dhw_active:
      name: "Hot Water active"
    flame_on:
      name: "Flame on"
    fault_indication:
      name: "Fault indication"
      entity_category: diagnostic
    diagnostic_indication:
      name: "Diagnostic event"
      entity_category: diagnostic
clau-bucur commented 2 weeks ago

BTW, I used for a some hours an ESP8266 Wemos D1 Mini and this problem appeared too. So I thought I'll switch to an ESP32 as per your other suggestions. But the issue seems to persist.

olegtarasov commented 2 weeks ago

Hi @clau-bucur! Please try setting sync_mode: true in opentherm section.

clau-bucur commented 2 weeks ago

I remember I tried for the ESP8266 and it did not fix the issue, but I'll set it the same for the current ESP32 board and see if it works.

FreeBear-nc commented 1 week ago

Another Viessmann user here (an 050 combi). You might find that the boiler is automatically firing up to keep the system hot for when you want hot water (DHW). One of two ways to disable this:

clau-bucur commented 1 week ago

@FreeBear-nc thanks for the input! I'm using the boiler DHW only as a backup because I have solar panels which heat up my DHW so I have dhw_enable switch set exactly as your second suggestion.

What behaviour I find strange about my boiler is this: If the OpenTherm master is powered off or disconnected the boiler starts heating! Do you experience the same behaviour? Can we disable it somehow?

I find it very annoying and does not make sense to me. If my OT master somehow breaks or loses power the boiler just starts heating like crazy? What kind of silly fallback behavriour is this?

dmd79 commented 1 week ago

@FreeBear-nc thanks for the input! I'm using the boiler DHW only as a backup because I have solar panels which heat up my DHW so I have dhw_enable switch set exactly as your second suggestion.

What behaviour I find strange about my boiler is this: If the OpenTherm master is powered off or disconnected the boiler starts heating! Do you experience the same behaviour? Can we disable it somehow?

I find it very annoying and does not make sense to me. If my OT master somehow breaks or loses power the boiler just starts heating like crazy? What kind of silly fallback behavriour is this?

Hi, I have the same behaviour on my Daikin D2C, but I think you can check the electric schematic, maybe there's some configurable wiring to enable or disable this thing

FreeBear-nc commented 1 week ago

What behaviour I find strange about my boiler is this: If the OpenTherm master is powered off or disconnected the boiler starts heating! Do you experience the same behaviour? Can we disable it somehow?

With the 050, when the OT master goes offline, it has no affect on my boiler. When it comes back online, the boiler goes through a startup & purge cycle for a minute or so. But this doesn't help you... Looking at the most recent installation manual for the 100, I one possible answer - From the control panel on the front of the boiler, select the three vertical squiggly lines (heating circuit 1), press the down arrow until "OFF" appears, and then press OK. Do the same for heating circuit No.2. You could also try accessing menu option P1 and setting HC1 & HC2 to n1. The manual gives further information: https://viessmanndirect.co.uk/files//92bc109d-eb87-4231-9a05-adec818a1b7d/6167584VBA00008_1.pdf

There are a few other settings that can be changed only if you have the ViCare app. The installation manual documents some of them. I've not used the ViCare app, so can't comment on what it does.

clau-bucur commented 1 week ago

When my boiler is set in OpenTherm mode none of these options are available, it won't allow changing the heating circuit or DHW temperature values, by any means:

This makes sense because OpenTherm is in control. But that fallback behavior does not.

olegtarasov commented 1 week ago

@clau-bucur Do you have another thermostat that was connected to your boiler before the OpenTherm bridge? If so, we may have some luck in sniffing its messages in the future (my component doesn't have this feature yet). Other than that, I can't really figure out why protocol errors are happening for you :( It would make sense if things didn't work completely, but I see in your logs that sometimes your boiler sends valid responses. I'm really out of ideas on how to diagnose this except for trying to sniff traffic from the "official" thermostat.

As for the fallback behavior — I think it's normal with some boilers, I have the same behavior with my boiler. I didn't look into it much, but I thing the boiler just tries to heat the water to a setpoint that is specified in its own settings. Maybe you can view and change these settings while any kind of OpenTherm thermostat is disconnected.

olegtarasov commented 1 week ago

@clau-bucur By the way, you can also try to flash this sketch and see whether it works better: https://github.com/diyless/esp32-wifi-thermostat. It uses a different protocol library, so if it works better, we will know that there is a problem in protocol handling.

clau-bucur commented 1 week ago

@clau-bucur Do you have another thermostat that was connected to your boiler before the OpenTherm bridge?

No other thermostat, I was using it previously in On/Off mode.

As for the fallback behavior — I think it's normal with some boilers, I have the same behavior with my boiler. I didn't look into it much, but I thing the boiler just tries to heat the water to a setpoint that is specified in its own settings. Maybe you can view and change these settings while any kind of OpenTherm thermostat is disconnected.

Nothing is possible to be changed as long as the boiler is in OpenTherm control mode. Nevermind, I'm implementing some failsafe checks and will switch off the boiler if it's heating when it's not supposed to.

@clau-bucur By the way, you can also try to flash this sketch and see whether it works better: https://github.com/diyless/esp32-wifi-thermostat. It uses a different protocol library, so if it works better, we will know that there is a problem in protocol handling.

So, I've stared for some days to use https://github.com/Alexwijn/SAT integration with your component. There they have a predefined ESPHome configuration that one's supposed to have in order for SAT to properly control your component. Since I've started using that configuration I have had 0 issues and no protocol timeouts. I've waited a few days until I could confirm that this is the case. I have even removed sync_mode: true and it works. I am really not sure what is the reason, but here is the current config that works:

esphome:
  name: opentherm
  friendly_name: OpenTherm

esp32:
  board: wemos_d1_mini32

# Enable logging
logger:
  level: INFO

ota:
  - platform: esphome

external_components:
  source: github://olegtarasov/esphome-opentherm@main
  refresh: 0s

opentherm:
  in_pin: GPIO19
  out_pin: GPIO18
  # sync_mode: true
  ch_enable: true
  dhw_enable: true

number:
  - platform: opentherm
    t_dhw_set:
      name: "dhw_setpoint_temperature"
      min_value: 10.0
      max_value: 60.0
      step: 1
      initial_value: 45.0
      restore_value: true
    t_set:
      name: "ch_setpoint_temperature"
      min_value: 0.0
      max_value: 80.0
      step: 0.1
      initial_value: 0.0
      restore_value: true
    max_t_set:
      name: "max_ch_setpoint_temperature"
      min_value: 20.0
      max_value: 80.0
      initial_value: 80.0
      step: 1
      restore_value: true
    max_rel_mod_level:
      name: "max_modulation_level"
      entity_category: config
      min_value: 0
      max_value: 100
      step: 1
      initial_value: 100
      restore_value: true

sensor:
  - platform: opentherm
    rel_mod_level:
      name: "modulation"
    device_id:
      name: "boiler_member_id"
    t_boiler:
      name: "boiler_temperature"
    t_ret:
      name: "return_temperature"
    t_dhw_set_lb:
      name: "dhw_min_temperature"
    t_dhw_set_ub:
      name: "dhw_max_temperature"
    t_dhw:
      name: "Hot Water Temperature"
    ch_pressure:
      name: "Heating Water Pressure"
      unit_of_measurement: hPa
    t_exhaust:
      name: "Exhaust temperature"
    max_capacity:
      name: "max_capacity"
    min_mod_level:
      name: "min_mod_level"

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

switch:
  - platform: opentherm
    dhw_enable:
      name: "dhw_enabled"
      restore_mode: RESTORE_DEFAULT_OFF
      entity_category: config
    ch_enable:
      name: "ch_enabled"
      restore_mode: RESTORE_DEFAULT_OFF
      entity_category: config
olegtarasov commented 1 week ago

@clau-bucur That's unusual :) Can you please post full configs for both cases (excluding passwords of course)?

clau-bucur commented 1 week ago

@olegtarasov what you see are the full configs, I don't have anything else configured on the ESPHome device. And I've not made any hardware changes at all since the first post and the last.

olegtarasov commented 1 week ago

@clau-bucur Did you have the same board specified before? I don't see the board section in your first config. If board is the same, can you add the following section to your first config and see if it works better?

sensor
  - platform: opentherm
    device_id:
      name: "boiler_member_id"
clau-bucur commented 1 week ago

Yeah, sorry, I see now my first post was missing non OT-related config. But it was indeed the same as my last config. I'll add that sensor to my first config and report back.

ties-s commented 5 days ago

I have this same issue.

This set of logs keeps looping:

[15:24:36][D][opentherm:317]: Sending request with id 0 (STATUS) [15:24:36][D][opentherm:318]: 00000000 00000000 00000010 00000000 type: READ_DATA; id: 0; HB: 2; LB: 0; uint_16: 512; float: 2.000000 [15:24:37][W][opentherm:357]: Receive response timed out at a protocol level

config:

external_components:
  source: github://olegtarasov/esphome-opentherm

opentherm:
  in_pin: 13
  out_pin: 14

(i have tried switching pin numbers, as well as defining them as GPIOXX)

adapter: https://ihormelnyk.com/opentherm_adapter (measured 3.3V on power inputs, 32VDC on open therm bus) board: ESP32-S3

FreeBear-nc commented 2 days ago

@clau-bucur By the way, you can also try to flash this sketch and see whether it works better: https://github.com/diyless/esp32-wifi-thermostat. It uses a different protocol library, so if it works better, we will know that there is a problem in protocol handling.

I've updated my fork of Arthur Rump's external OpenTherm component - This uses the Ihor Melnyk's OT library. Tried to keep the sensor names the same so that minimal changes are needed to the yaml. Just the following lines need to be added:

esphome:
  platformio_options:
    lib_deps:
    - https://github.com/freebear-nc/opentherm_library.git

external_components:
  - source:
      type: git
      url: https://github.com/FreeBear-nc/esphome-opentherm.git
      ref: main
    components: [ opentherm ]
    refresh: 0s
olegtarasov commented 1 day ago

@ties-s Can you post full debug log collected over wired connection to esp (so that no messages are missed while establishing wireless connection)? Also please post you entire config (excluding secrets).