{"record":{"id":"fced4aa268e3da8c","repo":"home-assistant/core","slug":"unsupported-preset-mode-preset-mode","errorCode":null,"errorMessage":"Unsupported preset mode {preset_mode}","messagePattern":"Unsupported preset mode (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/aprilaire/climate.py","lineNumber":321,"sourceCode":"\n        mode_value = list(HVAC_MODE_MAP.keys())[mode_value_index]\n\n        await self.coordinator.client.update_mode(mode_value)\n\n        await self.coordinator.client.read_control()\n\n    @override\n    async def async_set_preset_mode(self, preset_mode: str) -> None:\n        \"\"\"Set the preset mode.\"\"\"\n\n        if preset_mode == PRESET_AWAY:\n            await self.coordinator.client.set_hold(3)\n        elif preset_mode == PRESET_VACATION:\n            await self.coordinator.client.set_hold(4)\n        elif preset_mode == PRESET_NONE:\n            await self.coordinator.client.set_hold(0)\n        else:\n            raise ValueError(f\"Unsupported preset mode {preset_mode}\")\n\n        await self.coordinator.client.read_scheduling()\n","sourceCodeStart":303,"sourceCodeEnd":324,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/aprilaire/climate.py#L303-L324","documentation":"Raised as ValueError by AprilaireClimateEntity.async_set_preset_mode when the requested preset is not one of the three hardcoded presets. Aprilaire maps presets directly to thermostat hold levels: PRESET_AWAY -> set_hold(3), PRESET_VACATION -> set_hold(4), PRESET_NONE -> set_hold(0); anything else has no hold level and is rejected.","triggerScenarios":"A climate.set_preset_mode service call with a preset_mode other than 'Away', 'Vacation', or 'None' (the component's PRESET_AWAY/PRESET_VACATION/PRESET_NONE values) on an Aprilaire climate entity.","commonSituations":"Generic dashboards that list presets like 'Eco', 'Boost', 'Home' from other integrations; automations copied from a different thermostat; user-authored scripts assuming a common preset vocabulary across integrations.","solutions":["Use only the presets exposed by the entity's preset_mode/preset_modes attributes ('Away', 'Vacation', 'None').","Map custom preset names to one of the three supported presets in the calling automation.","Clear a preset with preset_mode 'None' rather than 'none'/'off' variants."],"exampleFix":"# before\naction:\n  - action: climate.set_preset_mode\n    target:\n      entity_id: climate.aprilaire\n    data:\n      preset_mode: \"eco\"\n\n# after\naction:\n  - action: climate.set_preset_mode\n    target:\n      entity_id: climate.aprilaire\n    data:\n      preset_mode: \"away\"","handlingStrategy":"type-guard","validationCode":"SUPPORTED_PRESETS = {\"Away\", \"Vacation\", \"None\"}\nif preset_mode not in SUPPORTED_PRESETS:\n    return","typeGuard":"def is_aprilaire_preset(preset: str) -> bool:\n    return preset in {\"Away\", \"Vacation\", \"None\"}","tryCatchPattern":"try:\n    await climate_entity.async_set_preset_mode(preset_mode)\nexcept ValueError:\n    # unsupported preset; log and skip\nraise","preventionTips":["Use only the presets listed in the entity's preset_modes attribute.","Map generic preset names (eco/boost) to Away/Vacation/None for Aprilaire.","Clear holds with preset 'None'."],"tags":["home-assistant","aprilaire","climate","preset-mode","service-validation"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}