{"record":{"id":"759636691e799a44","repo":"home-assistant/core","slug":"operation-mode-not-supported","errorCode":null,"errorMessage":"Operation mode not supported","messagePattern":"Operation mode not supported","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/aosmith/water_heater.py","lineNumber":137,"sourceCode":"        return self.device.status.temperature_setpoint_maximum\n\n    @property\n    @override\n    def current_operation(self) -> str:\n        \"\"\"Return the current operation mode.\"\"\"\n        return MODE_AOSMITH_TO_HA.get(self.device.status.current_mode, STATE_OFF)\n\n    @property\n    @override\n    def is_away_mode_on(self) -> bool:\n        \"\"\"Return True if away mode is on.\"\"\"\n        return self.device.status.current_mode is AOSmithOperationMode.VACATION\n\n    @override\n    async def async_set_operation_mode(self, operation_mode: str) -> None:\n        \"\"\"Set new target operation mode.\"\"\"\n        if operation_mode not in self.operation_list:\n            raise HomeAssistantError(\"Operation mode not supported\")\n\n        aosmith_mode = MODE_HA_TO_AOSMITH.get(operation_mode)\n        if aosmith_mode is not None:\n            await self.client.update_mode(self.junction_id, aosmith_mode)\n\n            await self.coordinator.async_request_refresh()\n\n    @override\n    async def async_set_temperature(self, **kwargs: Any) -> None:\n        \"\"\"Set new target temperature.\"\"\"\n        temperature = kwargs.get(\"temperature\")\n        if temperature is not None:\n            await self.client.update_setpoint(self.junction_id, temperature)\n\n            await self.coordinator.async_request_refresh()\n\n    @override\n    async def async_turn_away_mode_on(self) -> None:","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/aosmith/water_heater.py#L119-L155","documentation":"Raised by the A. O. Smith water heater entity when a service call asks it to switch to an operation mode it does not expose. The entity only accepts modes present in its operation_list, which is built from MODE_AOSMITH_TO_HA (the modes the device itself reports supporting). Any other mode string is rejected before the client call is made.","triggerScenarios":"Calling water_heater.set_operation_mode with a mode (e.g. 'heat_pump' or 'eco') that is not in this entity's operation_list; the list is derived from MODE_AOSMITH_TO_HA and may be narrower than the generic HA water heater modes. Can also happen if a script/automation was written for a different heater model and reused here.","commonSituations":"Automation or dashboard card hardcodes a mode string; YAML mode name typo; mode supported on one A. O. Smith model but not another; user copies example config from docs for a different device generation.","solutions":["Check the entity's current operation_list attribute in Developer Tools > States and use one of those exact strings","Update the automation/script/dashboard to use a supported mode (e.g. STATE_OFF, 'electric', 'heat_pump', 'vacation' as exposed)","If the mode should be supported, verify the device status/current_mode mapping in MODE_AOSMITH_TO_HA and file an issue with py-aosmith if the mapping is missing"],"exampleFix":"# before\naction:\n  service: water_heater.set_operation_mode\n  target: {entity_id: water_heater.my_heater}\n  data: {operation_mode: \"heat\"}\n# after - use a mode from the entity's operation_list\naction:\n  service: water_heater.set_operation_mode\n  target: {entity_id: water_heater.my_heater}\n  data: {operation_mode: \"electric\"}","handlingStrategy":"validation","validationCode":"# In HA, read the entity state before acting\nstate = hass.states.get(\"water_heater.my_heater\")\nsupported = state.attributes[\"operation_list\"]\nif mode not in supported:\n    # pick another or notify\n    ...","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read operation_list from the entity state before sending set_operation_mode","Never hardcode mode strings in reusable scripts; parameterize and validate them","Keep automations per-device instead of copying them across heater models"],"tags":["home-assistant","aosmith","water-heater","validation","entity"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}