{"record":{"id":"b4fad119cd7fd68f","repo":"home-assistant/core","slug":"unsupported-thermostat-mode","errorCode":"UNSUPPORTED_THERMOSTAT_MODE","errorMessage":"The requested thermostat mode {ha_preset} is not supported","messagePattern":"The requested thermostat mode (.+?) is not supported","errorType":"exception","errorClass":"AlexaUnsupportedThermostatModeError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/alexa/handlers.py","lineNumber":1044,"sourceCode":"    context: ha.Context,\n) -> AlexaResponse:\n    \"\"\"Process a set thermostat mode request.\"\"\"\n    operation_list: list[str]\n\n    entity = directive.entity\n    mode = directive.payload[\"thermostatMode\"]\n    mode = mode if isinstance(mode, str) else mode[\"value\"]\n\n    data: dict[str, Any] = {ATTR_ENTITY_ID: entity.entity_id}\n\n    ha_preset = next((k for k, v in API_THERMOSTAT_PRESETS.items() if v == mode), None)\n\n    if ha_preset:\n        presets = entity.attributes.get(climate.ATTR_PRESET_MODES) or []\n\n        if ha_preset not in presets:\n            msg = f\"The requested thermostat mode {ha_preset} is not supported\"\n            raise AlexaUnsupportedThermostatModeError(msg)\n\n        service = climate.SERVICE_SET_PRESET_MODE\n        data[climate.ATTR_PRESET_MODE] = ha_preset\n\n    elif mode == \"CUSTOM\":\n        operation_list = entity.attributes.get(climate.ATTR_HVAC_MODES) or []\n        custom_mode = directive.payload[\"thermostatMode\"][\"customName\"]\n        custom_mode = next(\n            (k for k, v in API_THERMOSTAT_MODES_CUSTOM.items() if v == custom_mode),\n            None,\n        )\n        if custom_mode not in operation_list:\n            msg = (\n                f\"The requested thermostat mode {mode}: {custom_mode} is not supported\"\n            )\n            raise AlexaUnsupportedThermostatModeError(msg)\n\n        service = climate.SERVICE_SET_HVAC_MODE","sourceCodeStart":1026,"sourceCodeEnd":1062,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/alexa/handlers.py#L1026-L1062","documentation":"Handling Alexa.ThermostatController.SetThermostatMode: the requested Alexa mode (ECO, AUTO, OFF...) is reverse-mapped to an HA preset via API_THERMOSTAT_PRESETS. If that preset is not present in the climate entity's preset_modes attribute list, AlexaUnsupportedThermostatModeError (UNSUPPORTED_THERMOSTAT_MODE) is raised.","triggerScenarios":"User says 'set the thermostat to eco/automatic mode' when the entity's preset_modes attribute does not contain the corresponding HA preset (e.g. 'eco' or 'none'), even though the Alexa mode name itself is recognized.","commonSituations":"Climate entities that implement hvac_mode but not preset modes; integrations naming presets differently ('Energy' vs 'eco'); Alexa defaulting to ECO for 'away' phrasing.","solutions":["Expose/implement the matching preset in the climate integration so preset_modes includes it (e.g. add 'eco').","Teach users to phrase the request as an HVAC mode ('heat', 'cool', 'off') instead of a preset.","Check the entity's preset_modes attribute and align names via integration options or entity customization."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"presets = state.attributes.get('preset_modes') or []\nif requested_preset not in presets:\n    # reject or map to an hvac_mode call instead\n    ...","typeGuard":"def preset_supported(preset: str, attrs: dict) -> bool:\n    return preset in (attrs.get('preset_modes') or [])","tryCatchPattern":"try:\n    await process_directive(directive)\nexcept AlexaUnsupportedThermostatModeError:\n    _LOGGER.warning('Preset %s not in preset_modes %s', ha_preset, attrs.get('preset_modes'))","preventionTips":["Check preset_modes before routing preset voice commands to set_preset_mode.","Keep preset names identical across the integration and Alexa capability definitions.","Re-discover devices in Alexa after changing supported presets."],"tags":["alexa","smart-home","climate","thermostat","preset-mode","unsupported-mode"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}