Remove setting hvac_mode from ClimateEntity.set_temperature service #1154
Replies: 3 comments 11 replies
-
I dont have any major opinion here, but i do know people do use it. Say having some automatic target heating temperature automation update the heating target, yet when climate is in cooling mode since its currently warm out. In practice we are overloading one attribute with multiple states. So maybe the correct change would be to deprecate the non high/low temperature attribute and only keep the two distinct values. So one always meaning setpoint for cooling and one for heating independent of mode, and... Importantly, supported even if only one hvac mode exist. |
Beta Was this translation helpful? Give feedback.
-
It seems to work fine as is and provides an easy mechanism to change the hvac mode and provide a new temperature. We create work for existing implementations whenever we change something that works that people use. For thermostats my preference would be for user definable limits - that can be used to override the defaults - and we can make these mode specific (e.g. heat hi limit, heat low limit, cool high limit, etc.). Just because a thermostat allow you to set 44-99 degrees as the heat setpoint; doesn't mean that I as a user of home assistant want the ability to set it that high or low Myself I would like to set the range to 59 - 71. I'd like to have the UI use those limits and the service to enforce those limits. But for the thermostat in the garage I'd set the heat range to 40-45 - as I never want it to be warmer. If I had a commercial freezer the limits would be -20 to 0. Historically customize has been used to change max and min and these are picked to by the UI. So we could use customize to do this or provide the ability to define new attributes on entities and store these in the entity registry. |
Beta Was this translation helpful? Give feedback.
-
Just a note for people that like to set both values in a single action, |
Beta Was this translation helpful? Give feedback.
-
Background
Currently in
ClimateEntity
there is a possibility to sethvac_mode
as part of using theset_temperature
service.This provides some challenges that becomes very integration specific for validation of a temperature as the
min
andmax
temperature can be different depending onhvac_mode
. As example see issue: home-assistant/core#128118All logic to handle temperature in combination with changing the mode needs to be in the integration and can't be managed by the
ClimateEntity
itself which limits what we can do in a validation method.The other service calls in
ClimateEntity
does not have this problem as they are single-purpose only.Couldn't track each PR but it seems it was there somehow from the beginning, then removed and in version 0.30 it came back with home-assistant/core#3646 but the logic for adding it seems fuzzy to say the least.
Proposal
Remove
hvac_mode
from theset_temperature
call so that it's purely used for setting temperature.Users would have to use two action calls for the same procedure e.g. one for changing
hvac_mode
and another for setting the appropriate temperature(s).During the deprecation period we would have to skip validation when
hvac_mode
is used as parameter to theset_temperature
service.Benefits
Alternatives to consider
skip_validation_for_set_temperature_action
attribute.set_hvac_mode
call andset_temperature
call so thathvac_mode
is set first and then secondly we call theset_temperature
method. This way we would not have issues with themin
/max
property to be different depending onhvac_mode
. See commentBeta Was this translation helpful? Give feedback.
All reactions