home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.61k stars 30.77k forks source link

Generic thermostats (and probably others) not conforming to set min/max range on websocket API call #126466

Open madmaniac73 opened 1 month ago

madmaniac73 commented 1 month ago

The problem

When setting a thermostat using websocket API the temperature is validated as invalid despite falling inside the configured range. The configured range of the thermostats are -6 to 35 degrees Celsius (as confirmed in developer mode entity view) yet sending a temperature of 4 degrees renders ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547308156912] Provided temperature 4.0 is not valid. Accepted range is 7 to 35

Also when manually setting temperature of a generic thermostat below 7 degrees renders a similar error.

Please note that this behaviour is the same with an Adax thermostat as well, so not limited to Generic Thermostat

What version of Home Assistant Core has the issue?

core-2024.9.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Generic thermostat

Link to integration documentation on our website

https://www.home-assistant.io/integrations/generic_thermostat/

Diagnostics information

2024-09-23 02:54:50.559 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547308156912] Provided temperature 4.0 is not valid. Accepted range is 7 to 35 2024-09-23 02:54:50.560 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547308156912] Provided temperature 4.0 is not valid. Accepted range is 7 to 35

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

generic_thermostat documentation generic_thermostat source

elupus commented 1 month ago

How did you configure the thermostat?

Ps. Adax i hardcoded as 5 to 35.

madmaniac73 commented 1 month ago

You are correct, so we can possibly disregard the Adax in this specific case. From HA:s point of view the Adax thermostat IS configured with -6 as min_temp, according to the entity state in Dev tools though.

Attaching two screenshots: The "climate.alex_sovrum" is a generic thermostat, the "climate.sovrum_2" is an Adax one, to answer your question of the configuration.

For reference they are all configured in configuration.yaml like this:

climate.alex_sovrum:
  templates:
    icon_color: 'if (attributes.hvac_action === ''heating'') return ''#d44a3a''; if (attributes.hvac_action === ''idle'') return ''#629e51'';'
  min_temp: -6

image image

elupus commented 1 month ago

You dont happen to be using customize to change attributes? That is never going to work. Adax aught to ve reporting 5 as minimum.

madmaniac73 commented 1 month ago

I do use customize, but let's disregard the Adax one as you are right about the 5 degree hard coding there. The issue is with the Generic one, and this used to work up until somewhere this summer. There are several open issues for other integrations (Zwave and others) that point to this same behaviour since 2024.8.x releases.

madmaniac73 commented 1 month ago

To clarify: I AM indeed using the generic thermostats for a use case where I need them to run at a min_temp of sub-zero so it is not an option for me to disable the thermostat instead of setting a temperature lower than 7 as suggested in other issues.