-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Z-Wave setpoint incorrectly reports temperature out of range #124471
Comments
Hey there @home-assistant/z-wave, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) zwave_js documentation |
Probably related to #118649. It looks to me that the Z-Wave integration doesn't pick up the customized attributes. But I'm at a loss why that is. Everything still works perfectly with the Generic Thermostat integration. Also reporting the correct range when setting an 'invalid' temperature. |
Duplicate of #123612 It works with the Generic Thermostat because the values are set in the YAML configuration, or if unset defers back to the climate integration base class. Z-Wave JS hard-codes it to a default value when the device doesn't report it. |
This seems like a pretty simple fix, although I haven't tested it myself. The Z-Wave integration hard-codes the min/max temps when a device doesn't support it. Now you should just be able to defer to the super class, which will lookup the customized attributes. I don't have time at the moment to make a PR (add tests, etc.), but here's what I'd try with the least amount of changes needed: diff --git a/homeassistant/components/zwave_js/climate.py b/homeassistant/components/zwave_js/climate.py
index 14a3fe579c..8755dc4dcb 100644
--- a/homeassistant/components/zwave_js/climate.py
+++ b/homeassistant/components/zwave_js/climate.py
@@ -24,8 +24,6 @@ from homeassistant.components.climate import (
ATTR_HVAC_MODE,
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
- DEFAULT_MAX_TEMP,
- DEFAULT_MIN_TEMP,
DOMAIN as CLIMATE_DOMAIN,
PRESET_NONE,
ClimateEntity,
@@ -421,34 +419,32 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
@property
def min_temp(self) -> float:
"""Return the minimum temperature."""
- min_temp = DEFAULT_MIN_TEMP
- base_unit: str = UnitOfTemperature.CELSIUS
try:
temp = self._setpoint_value_or_raise(self._current_mode_setpoint_enums[0])
if temp.metadata.min:
- min_temp = temp.metadata.min
- base_unit = self.temperature_unit
+ return TemperatureConverter.convert(
+ temp.metadata.min, self.temperature_unit, self.temperature_unit
+ )
# In case of any error, we fallback to the default
except (IndexError, ValueError, TypeError):
pass
- return TemperatureConverter.convert(min_temp, base_unit, self.temperature_unit)
+ return super().min_temp
@property
def max_temp(self) -> float:
"""Return the maximum temperature."""
- max_temp = DEFAULT_MAX_TEMP
- base_unit: str = UnitOfTemperature.CELSIUS
try:
temp = self._setpoint_value_or_raise(self._current_mode_setpoint_enums[0])
if temp.metadata.max:
- max_temp = temp.metadata.max
- base_unit = self.temperature_unit
+ return TemperatureConverter.convert(
+ temp.metadata.max, self.temperature_unit, self.temperature_unit
+ )
# In case of any error, we fallback to the default
except (IndexError, ValueError, TypeError):
pass
- return TemperatureConverter.convert(max_temp, base_unit, self.temperature_unit)
+ return super().max_temp
async def async_set_fan_mode(self, fan_mode: str) -> None:
"""Set new target fan mode.""" |
The problem
When setting a target setpoint for my Z-Wave thermostats I get the error message that the temperature is out of range. Setting a temperature outside of the default range yields the error Provided temperature 5.0 is not valid. Accepted range is 7 to 35. and the temperature not being set.
However I have adjusted the
min_temp
andmax_temp
's for my devices because they don't reflect reality:This has worked for me since at least October 2019 because that's when I created the file according to version control 😛.
What version of Home Assistant Core has the issue?
core-2024.8.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Z-Wave
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zwave_js/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: