jmcollin78 / versatile_thermostat

A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management
MIT License
330 stars 36 forks source link

Thermostat continue its heating cycle whatever the setpoint is, even when disabled. #538

Closed KipK closed 1 month ago

KipK commented 1 month ago

Configuration

Using Versatile with electric heaters using pilot wire modules. I have a switch template for each device, going from antifrost to confort.

My VTherm attributes are the following:

hvac_modes:
  - heat
  - "off"
min_temp: 7
max_temp: 23
target_temp_step: 0.5
friendly_name: Thermostat SdB
supported_features: 401
current_temperature: 19.6
temperature: 7
hvac_action: heating
preset_modes:
  - none
  - frost
  - eco
  - comfort
  - boost
preset_mode: frost
is_on: true
hvac_mode: heat
type: null
is_controlled_by_central_mode: true
last_central_mode: null
frost_temp: 7
eco_temp: 18
boost_temp: 21
comfort_temp: 19
frost_away_temp: 0
eco_away_temp: 0
boost_away_temp: 0
comfort_away_temp: 0
power_temp: 15
target_temperature_step: 0.5
ext_current_temperature: 16.05
ac_mode: false
current_power: 400
current_power_max: 9000
saved_preset_mode: frost
saved_target_temp: 7
saved_hvac_mode: null
motion_sensor_entity_id: null
motion_state: null
power_sensor_entity_id: sensor.linky_puissance_inst_no_evse
max_power_sensor_entity_id: sensor.linky_pcoup_marge_evse
overpowering_state: false
presence_sensor_entity_id: null
presence_state: null
window_state: "off"
window_auto_state: "off"
window_bypass_state: false
window_sensor_entity_id: binary_sensor.ouverture_sdb
window_delay_sec: 30
window_auto_enabled: false
window_auto_open_threshold: 3
window_auto_close_threshold: 0
window_auto_max_duration: 30
window_action: window_frost_temp
security_delay_min: 30
security_min_on_percent: 0.1
security_default_on_percent: 0
last_temperature_datetime: "2024-10-11T14:44:19.356048+02:00"
last_ext_temperature_datetime: "2024-10-11T14:35:32.771625+02:00"
security_state: false
minimal_activation_delay_sec: 60
device_power: 560
mean_cycle_power: 0
total_energy: 71.86
last_update_datetime: "2024-10-11T14:49:12.189119+02:00"
timezone: Europe/Paris
temperature_unit: °C
is_device_active: true
ema_temp: 19.58
is_used_by_central_boiler: false
is_over_switch: true
is_inversed: false
keep_alive_sec: 0
underlying_switch_0: switch.switch_rad_sdb
underlying_switch_1: null
underlying_switch_2: null
underlying_switch_3: null
on_percent: 0
power_percent: 0
on_time_sec: 0
off_time_sec: 420
cycle_min: 7
function: tpi
tpi_coef_int: 0.6
tpi_coef_ext: 0.02

I got this problem 3 times with 3 different thermostat this week. ( I have only started to test Versatile Therm this week )

Sometime, the thermostat still continue the heating cycle and never stop. When it's in this bugged state, I try to put the setpoint to a really low temperature, or set anti frost mode, the thermostat instantely cut off the heating. But a few mn later, I can see the heater is back on. It's the same if I set it to OFF. Heating continue in cycling state to a previously setted temperature ( on the example below it was 19.5°C )

Here on the screenshot below you can see at the beginning it was already still maintaining a 19.5°C temp on the room with a 18°C setpoint on the thermostat. ( it was already in this bugged state ) . At 13h20 I set the thermostat to anti-frost mode. But the heating cycle continue whatever the temperature was set.

versatile

Disabling the integration and enabling it don't solve the problem. But restarting Home assistant does.

Debug log

The related thermosatt is "thermosatt_sdb"

Complete log for the timeframe here: home-assistant_versatile_thermostat_2024-10-11T12-39-35.156Z.txt

KipK commented 1 month ago

As I'm in a testing phase for now, there's chance this issue wakes up after I've modifed some Versatile settings. But I can't confirm that yet. Perhaps a home assistant restart each time I change a parameter would avoid this.

jmcollin78 commented 1 month ago

As I'm in a testing phase for now, there's chance this issue wakes up after I've modifed some Versatile settings. But I can't confirm that yet. Perhaps a home assistant restart each time I change a parameter would avoid this.

No don't do this. That is not necessary.

What I see the first post, is that VTherm is not heating:

on_percent: 0
power_percent: 0
on_time_sec: 0

your heater is still heating I think you have to look at your virtual switch switch.switch_rad_sdb. I guess this is virtual switch ?

It's the same if I set it to OFF.

With OFF, this is not possible for VTherm to send command to the underlying. You have to look elsewhere.

KipK commented 1 month ago

The template switch works ok. I've double checked and tested it first before using it But in bugued state , even with the thermostat disabled, the zigbee module still continue to receive ON/OFF commands from hass and regulates the temperature like you can see in the screen capture in orange, but locked on a previous setted temp. There's nothing else that can send switch commands to z2m than versatile on my setup.

Also when removed the Versatile integration, the heaters stopped to received those ghost commands. It clearly comes from it.

edit: you can also see the temp is well regulated at 19.5° ( when in anti frost mode in bugued state ), if it was randomly switching the curve wouldn't look this stable.

KipK commented 1 month ago

However, I was using the normal switch from the pilot wire zigbee device before and got the same issue. I've changed to the template switch as I plan to mods my Lexman module with NodOn firmware ( those have no such switch internally but just climate commands )

jmcollin78 commented 1 month ago

I guess the change of parameter have created another VTherm leave the old running in background. I can't even thing how it is possible due to HA config entry behavior, but it seems to be the case.

Is this issue still present after a restart ? Does this reproduce after each change of parameters ?

KipK commented 1 month ago

That has sense and is coherent with what I've observed. I don't know well enough HASS code structure yet, but I'd like to add some debug trace on the different Versatile functions to track down what's happening in the background.

Will take me a bit of time to be comfortable with your codebase first.

Yes a home assistant restart solve the issue, not a restart of the integration ( disabling, enabling all the thermostats )

It doesn't seems to be systematic at each conf change ( not sure yet, but I haven't noticed that ) btw, so won't be an easy find.

jmcollin78 commented 1 month ago

debug trace on the different Versatile functions to track down what's happening in the background

Be careful, the debug mode is very verbose. It could degrade you sd-card if you have one.

I transform this issue into conversation to have a follow up.