{"record":{"id":"91ad958f0c5d01b4","repo":"home-assistant/core","slug":"temperature-value-out-of-range","errorCode":"TEMPERATURE_VALUE_OUT_OF_RANGE","errorMessage":"The requested temperature {temp} is out of range","messagePattern":"The requested temperature (.+?) is out of range","errorType":"exception","errorClass":"AlexaTempRangeError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/alexa/handlers.py","lineNumber":888,"sourceCode":"    directive: AlexaDirective,\n    context: ha.Context,\n) -> AlexaResponse:\n    \"\"\"Process a set target temperature request.\"\"\"\n    entity = directive.entity\n    domain = entity.domain\n\n    min_temp = entity.attributes[MIN_MAX_TEMP[domain][\"min_temp\"]]\n    max_temp = entity.attributes[\"max_temp\"]\n    unit = hass.config.units.temperature_unit\n\n    data: dict[str, Any] = {ATTR_ENTITY_ID: entity.entity_id}\n\n    payload = directive.payload\n    response = directive.response()\n    if \"targetSetpoint\" in payload:\n        temp = temperature_from_object(hass, payload[\"targetSetpoint\"])\n        if temp < min_temp or temp > max_temp:\n            raise AlexaTempRangeError(hass, temp, min_temp, max_temp)\n        data[ATTR_TEMPERATURE] = temp\n        response.add_context_property(\n            {\n                \"name\": \"targetSetpoint\",\n                \"namespace\": \"Alexa.ThermostatController\",\n                \"value\": {\"value\": temp, \"scale\": API_TEMP_UNITS[unit]},\n            }\n        )\n    if \"lowerSetpoint\" in payload:\n        temp_low = temperature_from_object(hass, payload[\"lowerSetpoint\"])\n        if temp_low < min_temp or temp_low > max_temp:\n            raise AlexaTempRangeError(hass, temp_low, min_temp, max_temp)\n        data[climate.ATTR_TARGET_TEMP_LOW] = temp_low\n        response.add_context_property(\n            {\n                \"name\": \"lowerSetpoint\",\n                \"namespace\": \"Alexa.ThermostatController\",\n                \"value\": {\"value\": temp_low, \"scale\": API_TEMP_UNITS[unit]},","sourceCodeStart":870,"sourceCodeEnd":906,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/alexa/handlers.py#L870-L906","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"min_t = state.attributes['min_temp']\nmax_t = state.attributes['max_temp']\nif not (min_t <= requested_temp <= max_t):\n    # clamp or reject before calling climate.set_temperature\n    requested_temp = min(max(requested_temp, min_t), max_t)","typeGuard":"def temp_in_range(t: float, attrs: dict) -> bool:\n    return attrs['min_temp'] <= t <= attrs['max_temp']","tryCatchPattern":"try:\n    await process_directive(directive)\nexcept AlexaTempRangeError as err:\n    _LOGGER.warning('Setpoint %s outside %s..%s', err.temp, err.min_temp, err.max_temp)","preventionTips":["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."],"tags":["alexa","smart-home","climate","thermostat","temperature-range"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}