home-assistant/core · error · HomeAssistantError

failed_to_set_temp

failed_to_set_temp

Error message

Failed to set temperature

What it means

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.

Source

Thrown at homeassistant/components/bryant_evolution/climate.py:246

            self._attr_target_temperature_high = temp

        if value := kwargs.get(ATTR_TARGET_TEMP_LOW):
            temp = int(value)
            if not await self._client.set_heating_setpoint(temp):
                raise HomeAssistantError(
                    translation_domain=DOMAIN, translation_key="failed_to_set_htsp"
                )
            self._attr_target_temperature_low = temp

        if value := kwargs.get(ATTR_TEMPERATURE):
            temp = int(value)
            fn = (
                self._client.set_heating_setpoint
                if self.hvac_mode == HVACMode.HEAT
                else self._client.set_cooling_setpoint
            )
            if not await fn(temp):
                raise HomeAssistantError(
                    translation_domain=DOMAIN, translation_key="failed_to_set_temp"
                )
            self._attr_target_temperature = temp

        # If we get here, we must have changed something unless HA allowed an
        # invalid service call (without any recognized kwarg).
        self._async_write_ha_state()

    @override
    async def async_set_fan_mode(self, fan_mode: str) -> None:
        """Set new target fan mode."""
        if not await self._client.set_fan_mode(fan_mode):
            raise HomeAssistantError(
                translation_domain=DOMAIN, translation_key="failed_to_set_fan_mode"
            )
        self._attr_fan_mode = fan_mode.lower()
        self.async_write_ha_state()

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Check gateway connectivity and retry after the entity refreshes
  2. Reload the integration to re-establish the session
  3. For heat/cool (AUTO) systems, prefer target_temp_high/target_temp_low instead of the single 'temperature' kwarg
  4. Confirm the value lies within the thermostat's min/max range
Defensive patterns

Strategy: try-catch

Validate before calling

# Prefer explicit high/low setpoints on heat_cool systems; single 'temperature'
# routes to heating or cooling based on hvac_mode
if climate.hvac_mode == HVACMode.HEAT:
    bound_min, bound_max = 40, 68
else:
    bound_min, bound_max = 60, 99
if bound_min <= temp <= bound_max:
    await climate.async_set_temperature(temperature=temp)

Try / catch

try:
    await climate.async_set_temperature(temperature=72)
except HomeAssistantError as err:
    if 'failed_to_set_temp' in str(err):
        # single-target write not acknowledged; check connectivity and retry

Prevention

When it happens

Trigger: 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.

Common situations: Dashboard temperature card changes failing during gateway downtime; scripts setting a single temperature while the system is in heat vs cool mode.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/f555295c2731a58c. Report an issue: GitHub.