jmcollin78 / versatile_thermostat

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

VTherm attempts to set a temperature below the min_temp causing to set the target temp to the max_temp #272

Closed gioele-antoci closed 11 months ago

gioele-antoci commented 11 months ago

Version of the custom_component

4.3

Configuration

versatile_thermostat: auto_regulation_expert: kp: 0.4 ki: 0.08 k_ext: 0.0 offset_max: 12 stabilization_threshold: 0.1 accumulated_error_threshold: 50

Describe the bug

You can see in the screenshot that I lower the temperature manually until I force the regulated temperature to be set below the min temperature. We don't see to have any guards in that respect and my Midea climate control wraps around and instead sets the max temperature

image

My VTherm attributes are the following:

hvac_modes: off, auto, cool, dry, heat, fan_only
min_temp: 17
max_temp: 35
target_temp_step: 0.5
preset_modes: none, eco, comfort, boost
current_temperature: 23.5
temperature: 18
preset_mode: none
friendly_name: Upstairs Versatile Thermostat
supported_features: 121
is_on: true
hvac_mode: heat
frost_temp: 0
eco_temp: 17
boost_temp: 24
comfort_temp: 21
frost_away_temp: 17
eco_away_temp: 17
boost_away_temp: 17
comfort_away_temp: 17
target_temperature_step: 0.5
ext_current_temperature: 2
ac_mode: false
saved_preset_mode: none
saved_target_temp: 18
window_state: off
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-12-12T23:35:20.612277-05:00
last_ext_temperature_datetime: 2023-12-12T23:34:38.950651-05:00
security_state: false
minimal_activation_delay_sec: 10
device_power: 1
total_energy: 0
last_update_datetime: 2023-12-12T23:35:43.374748-05:00
timezone: America/Toronto
window_auto_enabled: false
temperature_unit: °C
is_device_active: true
is_over_climate: true
underlying_climate_0: climate.150633093090947_climate
is_regulated: true
regulated_target_temperature: 15.5
auto_regulation_mode: auto_regulation_expert
regulation_accumulated_error: -5.5
auto_fan_mode: auto_fan_medium
fan_modes: Silent, Low, Medium, High, Full, Auto
swing_modes: Off, Vertical, Horizontal, Both
fan_mode: Low
swing_mode: Off
aux_heat: off
current_auto_fan_mode: auto_fan_medium
ema_temp: 23.5

Debug log

I can paste the logs if needed

gioele-antoci commented 11 months ago

We don't check that this value is between min and max. We send it to over to the underlying climate but as you can see the underclimate behaves erratically.

I suggest that in case the regulated temperature is outside of the min-max range (AC mode as well) that we should switch heat_mode to fan only mode (or off). Haven't gotten any feedback on whether this is a terrible idea or not.

Thoughts?

gioele-antoci commented 11 months ago

Another check we don't make is that (in heating mode) the regulated temperature should be lower than the under temperature if the thermostat temperature is above the target temperature and viceversa

gioele-antoci commented 11 months ago

I suggest that in case the regulated temperature is outside of the min-max range (AC mode as well) that we should switch heat_mode to fan only mode (or off). Haven't gotten any feedback on whether this is a terrible idea or not.

Slept on it and thought about it more. With the introduction of frost mode prevention, implementing the idea above would allow folks with thermostat_over_climate to set a frost temperature prevention that's below the min_temp of their device. Mine is 17c which is obviously way too hot for frost prevention

jmcollin78 commented 11 months ago

Same as #249. Regulation and normal setting should never go above the min and max given by the underlying climate or underlying number (which represent the valve).

I will make only one fix for both cases.

jmcollin78 commented 11 months ago

Hello, I publish the beta release just now: https://github.com/jmcollin78/versatile_thermostat/releases/tag/5.1.0.beta1

@gioele-antoci can you please give it a try ?

jmcollin78 commented 11 months ago

https://github.com/jmcollin78/versatile_thermostat/releases/tag/5.1.0

gioele-antoci commented 11 months ago

Hello, I publish the beta release just now: https://github.com/jmcollin78/versatile_thermostat/releases/tag/5.1.0.beta1

@gioele-antoci can you please give it a try ?

Sorry I had missed this, going to try now and let you know if any issues