{"record":{"id":"f555295c2731a58c","repo":"home-assistant/core","slug":"failed-to-set-temp","errorCode":"failed_to_set_temp","errorMessage":"Failed to set temperature","messagePattern":"Failed to set temperature","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/bryant_evolution/climate.py","lineNumber":246,"sourceCode":"            self._attr_target_temperature_high = temp\n\n        if value := kwargs.get(ATTR_TARGET_TEMP_LOW):\n            temp = int(value)\n            if not await self._client.set_heating_setpoint(temp):\n                raise HomeAssistantError(\n                    translation_domain=DOMAIN, translation_key=\"failed_to_set_htsp\"\n                )\n            self._attr_target_temperature_low = temp\n\n        if value := kwargs.get(ATTR_TEMPERATURE):\n            temp = int(value)\n            fn = (\n                self._client.set_heating_setpoint\n                if self.hvac_mode == HVACMode.HEAT\n                else self._client.set_cooling_setpoint\n            )\n            if not await fn(temp):\n                raise HomeAssistantError(\n                    translation_domain=DOMAIN, translation_key=\"failed_to_set_temp\"\n                )\n            self._attr_target_temperature = temp\n\n        # If we get here, we must have changed something unless HA allowed an\n        # invalid service call (without any recognized kwarg).\n        self._async_write_ha_state()\n\n    @override\n    async def async_set_fan_mode(self, fan_mode: str) -> None:\n        \"\"\"Set new target fan mode.\"\"\"\n        if not await self._client.set_fan_mode(fan_mode):\n            raise HomeAssistantError(\n                translation_domain=DOMAIN, translation_key=\"failed_to_set_fan_mode\"\n            )\n        self._attr_fan_mode = fan_mode.lower()\n        self.async_write_ha_state()\n","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bryant_evolution/climate.py#L228-L264","documentation":"HomeAssistantError with translation_key 'failed_to_set_temp', raised when ATTR_TEMPERATURE is provided and the chosen setter (set_heating_setpoint in HEAT mode, set_cooling_setpoint otherwise) returns falsy. This is the single-target-temperature path of async_set_temperature; the shared fallthrough comment notes a change must have occurred unless HA allowed a no-kwarg call.","triggerScenarios":"Calling set_temperature with 'temperature' while the gateway is offline or rejects the write; hvac_mode currently HEAT so the heating setter is used and fails; stale session after long uptime.","commonSituations":"Dashboard temperature card changes failing during gateway downtime; scripts setting a single temperature while the system is in heat vs cool mode.","solutions":["Check gateway connectivity and retry after the entity refreshes","Reload the integration to re-establish the session","For heat/cool (AUTO) systems, prefer target_temp_high/target_temp_low instead of the single 'temperature' kwarg","Confirm the value lies within the thermostat's min/max range"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# Prefer explicit high/low setpoints on heat_cool systems; single 'temperature'\n# routes to heating or cooling based on hvac_mode\nif climate.hvac_mode == HVACMode.HEAT:\n    bound_min, bound_max = 40, 68\nelse:\n    bound_min, bound_max = 60, 99\nif bound_min <= temp <= bound_max:\n    await climate.async_set_temperature(temperature=temp)","typeGuard":null,"tryCatchPattern":"try:\n    await climate.async_set_temperature(temperature=72)\nexcept HomeAssistantError as err:\n    if 'failed_to_set_temp' in str(err):\n        # single-target write not acknowledged; check connectivity and retry","preventionTips":["On heat_cool (AUTO) systems, send target_temp_high/target_temp_low instead of 'temperature'","Verify the chosen heating/cooling target matches the current hvac_mode before sending"],"tags":["bryant-evolution","climate","setpoint","temperature","command-failure","home-assistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}