{"record":{"id":"69ec16d235521ae7","repo":"home-assistant/core","slug":"failed-to-parse-hvac-mode","errorCode":"failed_to_parse_hvac_mode","errorMessage":"Cannot parse response to HVACMode: {mode}","messagePattern":"Cannot parse response to HVACMode: (.+?)","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/bryant_evolution/climate.py","lineNumber":160,"sourceCode":"        # Note: depends on current temperature and target temperature low read\n        # above.\n        self._attr_hvac_action = await self._read_hvac_action()\n\n    async def _read_hvac_mode(self) -> HVACMode:\n        mode_and_active = await self._client.read_hvac_mode()\n        if not mode_and_active:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN, translation_key=\"failed_to_read_hvac_mode\"\n            )\n        mode = mode_and_active[0]\n        mode_enum = {\n            \"HEAT\": HVACMode.HEAT,\n            \"COOL\": HVACMode.COOL,\n            \"AUTO\": HVACMode.HEAT_COOL,\n            \"OFF\": HVACMode.OFF,\n        }.get(mode.upper())\n        if mode_enum is None:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"failed_to_parse_hvac_mode\",\n                translation_placeholders={\"mode\": mode},\n            )\n        return mode_enum\n\n    async def _read_hvac_action(self) -> HVACAction:\n        \"\"\"Return the current running hvac operation.\"\"\"\n        mode_and_active = await self._client.read_hvac_mode()\n        if not mode_and_active:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN, translation_key=\"failed_to_read_hvac_action\"\n            )\n        mode, is_active = mode_and_active\n        if not is_active:\n            return HVACAction.OFF\n        match mode.upper():\n            case \"HEAT\":","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bryant_evolution/climate.py#L142-L178","documentation":"HomeAssistantError with translation_key 'failed_to_parse_hvac_mode' (placeholder: mode), raised when read_hvac_mode() did return data but the mode string is not one of HEAT/COOL/AUTO/OFF after upper-casing. The gateway reported a mode the mapping dict does not know, so the raw mode is included for diagnosis.","triggerScenarios":"Gateway firmware exposing additional or renamed modes (e.g. a proprietary 'EMERGENCY HEAT' string) not covered by the four-entry map; localized or malformed responses from a non-standard system configuration.","commonSituations":"Newer Evolution firmware adding modes; systems with accessories (humidifier/dehumidifier modes) leaking into the mode register; library lag behind firmware.","solutions":["Check the logged placeholder value — the unrecognized mode string identifies the gap","Update the bryant_evolution integration / evolutionhttp library for extended mode support","Report the unknown mode string upstream with your system model/firmware","As a workaround, use the thermostat's physical controls for the unsupported mode"],"exampleFix":"# conceptually, in the mapping (integration code, upstream fix)\n# before\nmode_enum = {'HEAT': HVACMode.HEAT, 'COOL': HVACMode.COOL,\n              'AUTO': HVACMode.HEAT_COOL, 'OFF': HVACMode.OFF}.get(mode.upper())\n\n# after (once upstream adds the mode)\nmode_enum = {'HEAT': HVACMode.HEAT, 'COOL': HVACMode.COOL,\n              'AUTO': HVACMode.HEAT_COOL, 'OFF': HVACMode.OFF,\n              'EMERGENCY HEAT': HVACMode.HEAT}.get(mode.upper())","handlingStrategy":"validation","validationCode":"mode_and_active = await client.read_hvac_mode()\nmode = mode_and_active[0] if mode_and_active else None\nmode_supported = mode is not None and mode.upper() in {'HEAT', 'COOL', 'AUTO', 'OFF'}\nif not mode_supported:\n    # avoid the parse error; surface the raw mode instead","typeGuard":"from homeassistant.components.climate import HVACMode\n\nSUPPORTED_MODES = {'HEAT', 'COOL', 'AUTO', 'OFF'}\n\ndef is_supported_hvac_mode(mode_and_active: tuple[str, bool] | None) -> bool:\n    \"\"\"True when the gateway mode maps to an HVACMode.\"\"\"\n    if not mode_and_active:\n        return False\n    return mode_and_active[0].upper() in SUPPORTED_MODES","tryCatchPattern":null,"preventionTips":["Check gateway firmware release notes for new HVAC modes","Report unmapped mode strings (visible in the error placeholders) upstream"],"tags":["bryant-evolution","climate","parse-error","hvac-mode","home-assistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}