jmcollin78 / versatile_thermostat

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

"Use window detection" checkbox in config is checked, even when deactivating it and saving the config #189

Closed maia closed 11 months ago

maia commented 1 year ago

I was using window detection for all my climate services, until today, when I turned them all off. Interestingly for most of the services the checkbox in the config "Use window detection" is checked again when re-opening the config. I've now opened all services 3 times, each time de-activated the window detection, clicked "submit" a couple of times and "finish" to save, but it's sticky, in more than half of the services the checkbox remains on.

Bildschirmfoto 2023-11-11 um 23 18 36

Here's the config for one of the services in which I cannot turn off the window detection. Or maybe it's just a display and in reality it is turned off, just for some strange reason the checkbox is marked sometimes?

hvac_modes:
  - "off"
  - heat
min_temp: 16
max_temp: 26
preset_modes:
  - none
  - eco
  - comfort
  - boost
current_temperature: 21.4
temperature: 20
hvac_action: heating
preset_mode: comfort
is_on: true
hvac_mode: heat
type: null
eco_temp: 19
boost_temp: 21
comfort_temp: 20
eco_away_temp: 18
boost_away_temp: 20
comfort_away_temp: 19
power_temp: null
ext_current_temperature: 6.40000009536743
ac_mode: false
current_power: null
current_power_max: null
saved_preset_mode: comfort
saved_target_temp: 20
saved_hvac_mode: null
window_state: "off"
motion_state: null
overpowering_state: null
presence_state: "on"
window_auto_state: "off"
window_bypass_state: false
security_delay_min: 60
security_min_on_percent: 0.5
security_default_on_percent: 0.1
last_temperature_datetime: "2023-11-11T22:48:46.384373+01:00"
last_ext_temperature_datetime: "2023-11-11T22:27:39.974018+01:00"
security_state: false
minimal_activation_delay_sec: 10
device_power: 1
mean_cycle_power: null
total_energy: 95.96
last_update_datetime: "2023-11-11T23:12:16.818962+01:00"
timezone: …
window_sensor_entity_id: null
window_delay_sec: 30
window_auto_open_threshold: 0.05
window_auto_close_threshold: 0
window_auto_max_duration: 30
motion_sensor_entity_id: null
presence_sensor_entity_id: input_boolean.presence_someone
power_sensor_entity_id: null
max_power_sensor_entity_id: null
temperature_unit: °C
is_device_active: true
is_over_climate: true
start_hvac_action_date: null
underlying_climate_0: climate.arbeitszimmer_eve_trv
underlying_climate_1: null
underlying_climate_2: null
underlying_climate_3: null
is_regulated: true
regulated_target_temperature: 20.5
auto_regulation_mode: auto_regulation_slow
regulation_accumulated_error: -2.799999999999997
friendly_name: Arbeitszimmer Heizung
supported_features: 17
maia commented 1 year ago

It seems I cannot turn off window detection. My climate services keep switching from heat to off and back again due to false positives, see below. I will try to set the threshold much higher to prevent this, but actually it should be possible to turn window detection off from the config after it was turned on previously.

2023-11-11 22:24:43.294 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Schlafzimmer Heizung - End auto detection of open window slope=0.024
2023-11-11 22:25:12.035 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Schlafzimmer Heizung - Start auto detection of open window slope=-0.093
2023-11-11 22:43:41.281 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Schlafzimmer Heizung - End auto detection of open window slope=0.022
2023-11-11 22:43:58.137 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Schlafzimmer Heizung - Start auto detection of open window slope=-0.171
2023-11-11 22:57:31.871 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Schlafzimmer Heizung - End auto detection of open window slope=0.028
2023-11-11 22:57:54.274 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Schlafzimmer Heizung - Start auto detection of open window slope=-0.120
2023-11-11 23:27:54.401 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Schlafzimmer Heizung - End auto detection of open window slope=-0.120
2023-11-11 23:40:19.149 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Schlafzimmer Heizung - Start auto detection of open window slope=-0.127
maia commented 1 year ago

The solution to disable window detection is to delete all four values in the config panel (window sensor delay, temperature decrease threshold, temperature increase threshold, maximum duration). When one deletes all these values, you can even let the checkmark set at "Use window detection" in the first config panel but still it will be disabled.

I think if the checkbox is disabled in the first panel, the window detection should be disabled – no matter if values are configured like a threshold or a maximum time.

jmcollin78 commented 1 year ago

It looks like a bug in the config panel.

jmcollin78 commented 11 months ago

Added in release 4.2.0