jmcollin78 / versatile_thermostat

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

HA 2024.08 - Vtherm can no longer change underlying climate temperature - Provided temperature is not valid #489

Closed ssorgatem closed 1 month ago

ssorgatem commented 3 months ago

Version of the custom_component

6.2.9 and 6.2.8 Home Assistant 2024.8.1 on HAOS

Configuration

My VTherm attributes are the following:

hvac_modes:
  - "off"
  - heat_cool
  - cool
  - heat
  - fan_only
  - dry
min_temp: 15
max_temp: 26
target_temp_step: 0.1
fan_modes:
  - auto
  - low
  - medium
  - high
  - silent
  - turbo
preset_modes:
  - none
  - eco
  - comfort
  - boost
swing_modes:
  - "off"
  - vertical
current_temperature: 26.6
temperature: 25
fan_mode: low
preset_mode: eco
swing_mode: "off"
is_on: true
hvac_action: null
hvac_mode: cool
type: null
is_controlled_by_central_mode: true
last_central_mode: Auto
frost_temp: 0
eco_temp: 15
boost_temp: 23
comfort_temp: 20
frost_away_temp: 0
eco_away_temp: 0
boost_away_temp: 0
comfort_away_temp: 0
power_temp: 13
target_temperature_step: 0.1
ext_current_temperature: 25.9
ac_mode: true
current_power: null
current_power_max: null
saved_preset_mode: eco
saved_target_temp: 25
saved_hvac_mode: null
motion_sensor_entity_id: null
motion_state: null
power_sensor_entity_id: null
max_power_sensor_entity_id: null
overpowering_state: null
presence_sensor_entity_id: null
presence_state: null
window_state: "off"
window_auto_state: "off"
window_bypass_state: false
window_sensor_entity_id: null
window_delay_sec: 30
window_auto_enabled: false
window_auto_open_threshold: null
window_auto_close_threshold: null
window_auto_max_duration: null
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-08-11T22:12:35.835184+02:00"
last_ext_temperature_datetime: "2024-08-11T22:09:04.144376+02:00"
security_state: false
minimal_activation_delay_sec: 10
device_power: 1
mean_cycle_power: null
total_energy: 0
last_update_datetime: "2024-08-11T22:14:14.305072+02:00"
timezone: Europe/Madrid
temperature_unit: °C
is_device_active: true
ema_temp: 27.6
is_used_by_central_boiler: false
is_over_climate: true
start_hvac_action_date: null
underlying_climate_0: climate.despatx
underlying_climate_1: null
underlying_climate_2: null
underlying_climate_3: null
is_regulated: true
regulated_target_temperature: 23
auto_regulation_mode: auto_regulation_strong
regulation_accumulated_error: -7.944375457500068
auto_fan_mode: auto_fan_low
current_auto_fan_mode: auto_fan_low
auto_activated_fan_mode: low
auto_deactivated_fan_mode: auto
auto_regulation_use_device_temp: false
friendly_name: AC Despatx vt
supported_features: 441

Second Vtherm:

hvac_modes:
  - "off"
  - heat_cool
  - cool
  - heat
  - fan_only
  - dry
min_temp: 15
max_temp: 26
target_temp_step: 0.1
fan_modes:
  - auto
  - low
  - medium
  - high
  - silent
  - turbo
preset_modes:
  - none
  - eco
  - comfort
  - boost
swing_modes:
  - "off"
  - vertical
current_temperature: 25.5
temperature: 25
fan_mode: low
preset_mode: eco
swing_mode: "off"
is_on: true
hvac_action: null
hvac_mode: cool
type: null
is_controlled_by_central_mode: true
last_central_mode: Auto
frost_temp: 0
eco_temp: 15
boost_temp: 23
comfort_temp: 20
frost_away_temp: 0
eco_away_temp: 0
boost_away_temp: 0
comfort_away_temp: 0
power_temp: 13
target_temperature_step: 0.1
ext_current_temperature: 25.9
ac_mode: true
current_power: null
current_power_max: null
saved_preset_mode: eco
saved_target_temp: 16.900000000000002
saved_hvac_mode: null
motion_sensor_entity_id: null
motion_state: null
power_sensor_entity_id: null
max_power_sensor_entity_id: null
overpowering_state: null
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.finestra_habitacio_obrint
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_turn_off
security_delay_min: 60
security_min_on_percent: 0.5
security_default_on_percent: 0.1
last_temperature_datetime: "2024-08-11T22:14:05.839298+02:00"
last_ext_temperature_datetime: "2024-08-11T22:14:05.839298+02:00"
security_state: false
minimal_activation_delay_sec: 10
device_power: 1
mean_cycle_power: null
total_energy: 0
last_update_datetime: "2024-08-11T22:14:14.303201+02:00"
timezone: Europe/Madrid
temperature_unit: °C
is_device_active: true
ema_temp: 25.09
is_used_by_central_boiler: false
is_over_climate: true
start_hvac_action_date: null
underlying_climate_0: climate.habitacio
underlying_climate_1: null
underlying_climate_2: null
underlying_climate_3: null
is_regulated: true
regulated_target_temperature: 24.5
auto_regulation_mode: auto_regulation_medium
regulation_accumulated_error: -10.495166666666599
auto_fan_mode: auto_fan_low
current_auto_fan_mode: auto_fan_low
auto_activated_fan_mode: low
auto_deactivated_fan_mode: auto
auto_regulation_use_device_temp: false
icon: mdi:air-conditioner
friendly_name: AC Habitació vt
supported_features: 441

Describe the bug

Underlying climate temperature does not change

I'm trying to: Change the target temperature

And I expect: The target temperature to be changed in the underlying climate entity (I know it will not be an exact match to what is shown on the Vtherm climate)

But I observe this .... The underlying climate temperature does not change.

Before, when setting a manual temperature, or when changing between climate presets, i could see the temperature of the underlying climate entity changed. This was also reflected on the AC unit's display. The displayed temperature did not match exactly Vtherm's temperature, but that was expected. Now, however, the temperature doesn't change. I can manually change it from the Esphome integration, and whatever value I set there is left unchanged regardless of any change I do from Vtherm, and so is the actual functioning of the AC unit. his is happening with 2 different AC units, both controlled through Esphome.

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

Debug log

2024-08-11 22:34:16.947 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-AC Despatx vt - The device offset temp for regulation is 0.00 - internal temp is 0.00. New target is 20.50
2024-08-11 22:34:16.948 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall climate.set_temperature (c:01J51JC77K4GNQWDH94KHXXJ04): entity_id=['climate.despatx'], temperature=20.5, target_temp_high=26.0, target_temp_low=15.0>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2783, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 939, in async_service_temperature_set
    raise ServiceValidationError(
homeassistant.exceptions.ServiceValidationError: Provided temperature 15.0 is not valid. Accepted range is 16.0 to 30.0
ssorgatem commented 3 months ago

They had been working for months with the config above.

Now I tried removing the use of central configuration and setting minimum temperature to 16 and the temperature interval to 1 degree and now it works again.

So it looks like service validation got more strict in the latest core release and that's making those calls fall.

That's annoying because I alos have heating controlled by Vtherm and had everything in the centralized configuration, but the ACs don't accept temperatures below 16 while for the heating they are even part of some presets, so I cannot centrally put minimum temp to 16...

gunmalmg commented 3 months ago

I have experienced the same problem. After updating to 2024.8(2024.8.1)

jmcollin78 commented 3 months ago

Hello, same experience with HA 2024.8. It was possible before but have been change somewhere in HA 2024.8

benzo8 commented 3 months ago

Does "Won't Fix" mean we're waiting for it to be fixed in Home Assistant? If so, has it been raised as an issue there yet? It seems like a fairly fundamental issue with HA, if it won't let thermostats control AC units!

jmcollin78 commented 3 months ago

Wont fix means I cannot fix this because it is related to HA 2024.8. I will try to know more about this. But you just have to fix the min and max temperature accordingly to the error log you have: Accepted range is 16.0 to 30.0.

You cannot set the temperature to 15°.

benzo8 commented 3 months ago

Thanks for the clarification. I've changed my minimums, and that's got things running again for me. Strangely, some of my minimums needed to be 16 and some 17, despite all my underlyings being the same equipment!

Also, for anyone who finds this conversation in the future through Google - 15, 16, or even 17 degrees is ridiculously cold for AC! Please aim for somewhere in the 21-25 region - better for you, better for the enviroment!

gunmalmg commented 3 months ago

Just to clarify the need for temperature range: I use the VT to control many heat pumps that doubles as heating devices in the autumn/winter and AC in the summer. When used as heat pumps in my house & cottage - in the winter - the heat pumps is set to 10c to just keep it frost free when we are away (to save energy). The same goes for floor heating cables that I also control via VT. Conclusion: The VT needs to be able to operate from minimum 10c. (I actually have a need for VT to control an outdoor heating cable that should only kick inn below 1c - so I would like it to function even lower than 10c.)

I really love the VT integration – and it functions really well om my heat pumps and heating cables.

All credit to jmcollin78 👍

ssorgatem commented 3 months ago

Thanks for the clarification. I've changed my minimums, and that's got things running again for me. Strangely, some of my minimums needed to be 16 and some 17, despite all my underlyings being the same equipment!

Also, for anyone who finds this conversation in the future through Google - 15, 16, or even 17 degrees is ridiculously cold for AC! Please aim for somewhere in the 21-25 region - better for you, better for the enviroment!

15, 16 and 17 are not unreasonsable in the winter though. Even lower temperatures for stuff like a greenhouse in the winter.

Also, even if the underlying climate doesn't support, say, 15, I think it should be possible for Vtherm to support it by just turning on and off the underlying climate as needed, but i guess this would be a different issue.

jmcollin78 commented 3 months ago

Just to clarify the need for temperature range: I use the VT to control many heat pumps that doubles as heating devices in the autumn/winter and AC in the summer. When used as heat pumps in my house & cottage - in the winter - the heat pumps is set to 10c to just keep it frost free when we are away (to save energy). The same goes for floor heating cables that I also control via VT. Conclusion: The VT needs to be able to operate from minimum 10c. (I actually have a need for VT to control an outdoor heating cable that should only kick inn below 1c - so I would like it to function even lower than 10c.)

I agree with that and my anti-frost temperature that was programmed to 10 is no more possible yet. I will try to have a look and understand why this change (not documented !).

gunmalmg commented 2 months ago

Hello

I have now studied these issues in more detail in my installations of HA.

It seems that the problem originates from the underlying climate entity that VT is controlling. It seems that the 2024.8 update resulted in several updates of the min/max set-temp settings in many of my underlying climate entities. In many cases the underlying climate entity got a narrower min/max set-temp range. Resulting in errors/malfunction when VT tried to set regulated temperature outside of these narrower boundaries that the underlying climate entities got after the 2024.8 update. I have heat pumps that previously accepted a 10-35c set-temp range. But after 2024.8 they only accepted 16-31c. And that narrowing - for those exact heat pumps - was actually correct.
Other of my heat pumps kept the set-temp range from 10-35c. And that was also correct because those heat pumps actually are able to go as low as 10c.
I have also checked temp-range changes on heating cable thermostats. And there I also see some adjustment in the underlying climate entities temp-range. I have updated the min-max set-temp range in my VT configs to be within the boundaries of the narrower min/max set-temp range of my underlying entities - and then everything works fine again.

So my conclusion is that the problem with malfunction when VT is trying to set underlying set-temp relates to an update in a narrower min/max set-temp range of some of the underlying climate entities. Thus the problem is not within the VT integration.

But the VT algorithm must not try to set regulated temp outside the min/max temp-range set in the VT config.

Regards Gunnar

raphpa commented 2 months ago

Stumbled across the same. Seems like HA is now strictly enforcing the min and max setting of a climate entity.

I would suggest that regardless of the configuration VT limits its output values to the min_temp and max_temp values of the underlying climate entities. So it would at least set the min/max temperature allowed and not just error out.

jmcollin78 commented 1 month ago

Hello, the change are documented here for your information: https://developers.home-assistant.io/blog/2024/07/24/climate-min-max-temperature-check/

There is also others changes that are coming with HA 2024.10. Then I have publish a new release with a complete fix of these behavior (I hope so...).

Can you please give a try to the new release 6.3.0 and let me know if it fixes your cases ?

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

gunmalmg commented 1 month ago

Hello I'm on a vacation this coming week. I'l test it when I'm back at home.

gunmalmg commented 1 month ago

Hello

I have now installed 6.3.0 and HA 2024.10 It seems like it functions well But I had previously adopted my min/max temp settings in VT to avoid the errors. And I have not provoked the 6.3.0 with "wrong setting". So I really don't know if it would handle "wrong setting"

But when I upgraded to HA 2024.10 - with the new Repair feature. I got several issues. See attached image. I chose the "Delete all old statistical data for the entity" to solve the issues. That seems to work.

Regards

Gunnar

IMG_4098

jmcollin78 commented 1 month ago

Hello @gunmalmg ,

Thank you for the report. I don't change anything on this, on this release. This is strange and when I install HA 2024.10.1 I got the same kinds of error but not on VTherm data.

By the way, you can safely remove the historical data