jmcollin78 / versatile_thermostat

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

Heater turning on even when thermostat in off state, also when thermostat disabled #458

Closed jezzaaa closed 4 months ago

jezzaaa commented 6 months ago

Version 6.2.3

Configuration

hvac_modes:
  - heat
  - "off"
min_temp: 7
max_temp: 30
target_temp_step: 0.5
friendly_name: Study Heater Thermostat
supported_features: 401
hvac_action: "off"
preset_modes:
  - none
  - frost
  - eco
  - comfort
  - boost
temperature: 13
preset_mode: none
is_on: false
hvac_mode: "off"
is_controlled_by_central_mode: true
frost_temp: 16
eco_temp: 19
boost_temp: 23
comfort_temp: 21
frost_away_temp: 0
eco_away_temp: 0
boost_away_temp: 0
comfort_away_temp: 0
target_temperature_step: 0.5
ac_mode: false
saved_preset_mode: none
saved_target_temp: 13
window_state: "off"
window_auto_state: "off"
window_bypass_state: false
window_auto_enabled: false
window_action: window_turn_off
security_delay_min: 60
security_min_on_percent: 0.5
security_default_on_percent: 0.1
last_temperature_datetime: "2024-05-03T21:54:03.215888+10:00"
last_ext_temperature_datetime: "2024-05-03T21:54:03.215888+10:00"
security_state: false
minimal_activation_delay_sec: 10
device_power: 1
mean_cycle_power: 0
total_energy: 5.52
last_update_datetime: "2024-05-03T21:54:03.215985+10:00"
timezone: Australia/Sydney
temperature_unit: °C
is_device_active: false
is_used_by_central_boiler: false
is_over_switch: true
is_inversed: false
keep_alive_sec: 0
underlying_switch_0: switch.study_heater
on_percent: 0
power_percent: 0
on_time_sec: 0
off_time_sec: 300
cycle_min: 5
function: tpi
tpi_coef_int: 0.6
tpi_coef_ext: 0.1
current_temperature: 16.3

Describe the bug

Thermostat is switched off, so is in manual mode. Turns on fire 30 second every 5 minutes.

Set temp is 13, current temp is 16.3, so turned on for 30, off for 270.

If I disable the device in the integration, it still goes on/off as above.

I'm trying to: Temporarily suspend the heater coming on.

And I expect: Heater to not come on when thermostat is off or disabled, or set temp is set very low.

But I observe this .... Heater is turned on by Versatile Thermostat even though the thermostat device is off or disabled or with low set temp. Debug logs confirm that Versatile Thermostat is turning heater on and off.

I read the documentation on the README.md file and I don't find any relevant information about this issue.

Debug log


2024-05-03 21:37:01.934 DEBUG (MainThread) [custom_components.versatile_thermostat.underlyings] VersatileThermostat-Study Heater-switch.study_heater - calling turn_on_later hvac_mode=heat, should_relaunch_later=False off_time_sec=30
2024-05-03 21:37:01.934 DEBUG (MainThread) [custom_components.versatile_thermostat.underlyings] VersatileThermostat-Study Heater-switch.study_heater - Stopping cycle during calculation
2024-05-03 21:37:01.934 DEBUG (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Study Heater - power not configured. check_overpowering not available
2024-05-03 21:37:01.934 DEBUG (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Study Heater - checking security delta_temp=645.1 delta_ext_temp=562.1 mod_cond=True temp_cond=True climate_cond=False switch_cond=True
2024-05-03 21:37:01.934 INFO (MainThread) [custom_components.versatile_thermostat.underlyings] VersatileThermostat-Study Heater-switch.study_heater - start heating for 0 min 30 sec
2024-05-03 21:37:01.934 DEBUG (MainThread) [custom_components.versatile_thermostat.underlyings] VersatileThermostat-Study Heater-switch.study_heater - Starting underlying entity switch.study_heater
jmcollin78 commented 6 months ago

Hello @jezzaaa ,

Because the logs are always running I can say that the VTherm is not switched off nor disabled or you have another VTherm running on the same device.

I can suggest to restart the integration or HA to see if it resolves the case. I guess yes.

jezzaaa commented 6 months ago

Hi @jmcollin78 . Thanks for looking into this.

Yes, I tried restarting the integration a few times, and HA a couple of times, but this seemed to make no difference.

I had to re-enable the v thermostat device in order to get the config dump and the logs, for opening this issue. So I'm treating that situation as a separate issue (the fact that the heater still gets turned on even when the vtherm device is disabled) with possibly the same cause. Instead I'll focus on the unexpected behaviour when the vtherm is enabled.

So, when vtherm is enabled, the issue is that the heater was still turning on when the set temp was well below the current temp. So where the config dump (above) shows:

temperature: 13 current_temperature: 16.3

the logs (above) show that the heater was started for 30 seconds, and the set temp and current temp were the same.

Since opening the issue, I disabled the physical smart plug for the heater, because I wasn't using it over the weekend. I've re-enabled it again today, and I'll see how it goes over the next few days. I also upgraded HA over the weekend, so there's been another reboot. I'll gather more data, if this continues to happen, and post it here.

jmcollin78 commented 6 months ago

This is really strange and I think we don't look in the right direction.

The first line of code says that if the hvac_mode: "off" then do nothing. So you shouldn't see the logs you have. You seems the only guy with this trouble, so I guess there is something on your side which make this happens.

The issue now is to find what. You can have a look in the .storage/core.registry and search for versatile_thermostat. Then you will be able to check all the configured VTherm. Can you please me all the VTherm configurations you have (including the central configuration if any).

jezzaaa commented 6 months ago

For now, everything is working OK. So it's possible I did something wrong without seeing it. I'll monitor for a while and see if the problem shows itself, and then I will provide the details you have suggested. For now, I will assume that the fault was with my understanding.

Thankyou for your work on this integration. It's very awesome. I'd be interested to know if you have plans to add more algorithms such as PID.

jmcollin78 commented 6 months ago

I'd be interested to know if you have plans to add more algorithms such as PID.

It was in my first plan, but it works really well with the TPI algo and the PI for auto-regulation in 'over climate' mode. So finally, I will certainly not add more algorithm with complex tuning.

jmcollin78 commented 4 months ago

Closing to avoid too much complexity.