home-assistant/core · error · AlexaTempRangeError
TEMPERATURE_VALUE_OUT_OF_RANGE
TEMPERATURE_VALUE_OUT_OF_RANGE
Error message
The requested temperature {temp} is out of range What it means
While handling Alexa.ThermostatController.SetTargetTemperature, HA validates the requested targetSetpoint against the climate entity's min_temp/max_temp attributes. An out-of-range value raises AlexaTempRangeError, which builds a TEMPERATURE_VALUE_OUT_OF_RANGE response containing the value and allowed range. This instance covers the single targetSetpoint payload member.
Source
Thrown at homeassistant/components/alexa/handlers.py:888
directive: AlexaDirective,
context: ha.Context,
) -> AlexaResponse:
"""Process a set target temperature request."""
entity = directive.entity
domain = entity.domain
min_temp = entity.attributes[MIN_MAX_TEMP[domain]["min_temp"]]
max_temp = entity.attributes["max_temp"]
unit = hass.config.units.temperature_unit
data: dict[str, Any] = {ATTR_ENTITY_ID: entity.entity_id}
payload = directive.payload
response = directive.response()
if "targetSetpoint" in payload:
temp = temperature_from_object(hass, payload["targetSetpoint"])
if temp < min_temp or temp > max_temp:
raise AlexaTempRangeError(hass, temp, min_temp, max_temp)
data[ATTR_TEMPERATURE] = temp
response.add_context_property(
{
"name": "targetSetpoint",
"namespace": "Alexa.ThermostatController",
"value": {"value": temp, "scale": API_TEMP_UNITS[unit]},
}
)
if "lowerSetpoint" in payload:
temp_low = temperature_from_object(hass, payload["lowerSetpoint"])
if temp_low < min_temp or temp_low > max_temp:
raise AlexaTempRangeError(hass, temp_low, min_temp, max_temp)
data[climate.ATTR_TARGET_TEMP_LOW] = temp_low
response.add_context_property(
{
"name": "lowerSetpoint",
"namespace": "Alexa.ThermostatController",
"value": {"value": temp_low, "scale": API_TEMP_UNITS[unit]},View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Request a setpoint within the entity's min_temp/max_temp attributes (check them in developer tools).
- If the range itself is wrong, fix the climate integration's min_temp/max_temp reporting or its unit configuration.
- Verify HA's unit system and the Alexa device's temperature scale agree so no unintended conversion occurs.
Defensive patterns
Strategy: validation
Validate before calling
min_t = state.attributes['min_temp']
max_t = state.attributes['max_temp']
if not (min_t <= requested_temp <= max_t):
# clamp or reject before calling climate.set_temperature
requested_temp = min(max(requested_temp, min_t), max_t) Type guard
def temp_in_range(t: float, attrs: dict) -> bool:
return attrs['min_temp'] <= t <= attrs['max_temp'] Try / catch
try:
await process_directive(directive)
except AlexaTempRangeError as err:
_LOGGER.warning('Setpoint %s outside %s..%s', err.temp, err.min_temp, err.max_temp) Prevention
- Read min_temp/max_temp attributes before issuing setpoint commands or building voice UIs.
- Clamp user-supplied values to the entity range in your own skill/routine code.
- Verify HA and Alexa temperature units match to avoid conversion pushing values out of range.
When it happens
Trigger: User says 'set the thermostat to 30 degrees' when the entity's min_temp/max_temp is e.g. 7-35 in the wrong direction, or asks for a value outside the integration's reported limits; unit conversion (C vs F) can also push the value out of range.
Common situations: Integrations reporting min_temp/max_temp in a different unit than the request, Celsius/Fahrenheit confusion after changing HA's unit system, or narrow custom ranges on Mitsubishi/evohome style climates.
Related errors
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/91ad958f0c5d01b4.
Report an issue: GitHub.