home-assistant/core · error · ServiceValidationError
Failed to set temperature to {temperature}.
Error message
Failed to set temperature to {temperature}. What it means
Raised by Airobot climate's async_set_temperature when set_home_temperature or set_away_temperature (chosen by the current mode flag) raises AirobotError. It is a ServiceValidationError with translation key set_temperature_failed, so the set_temperature service call shows a validation-style error naming the rejected temperature value.
Source
Thrown at homeassistant/components/airobot/climate.py:142
"""Return current preset mode."""
if self._settings.setting_flags.boost_enabled:
return PRESET_BOOST
if self._settings.is_home_mode:
return PRESET_HOME
return PRESET_AWAY
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
temperature = kwargs[ATTR_TEMPERATURE]
try:
if self._settings.is_home_mode:
await self.coordinator.client.set_home_temperature(float(temperature))
else:
await self.coordinator.client.set_away_temperature(float(temperature))
except AirobotError as err:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="set_temperature_failed",
translation_placeholders={"temperature": str(temperature)},
) from err
await self.coordinator.async_request_refresh()
@override
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set HVAC mode.
This thermostat only supports HEAT mode. The climate platform validates
that only supported modes are passed, so this method is a no-op.
"""
@override
async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set new preset mode."""View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Retry with a value inside the device's supported range (check the vendor app for min/max)
- Verify the robot is online and retry after a coordinator refresh
- If it fails persistently, reload the integration so settings and auth are refreshed
- Check the chained AirobotError in logs to see whether the API rejected the value or the connection failed
Defensive patterns
Strategy: try-catch
Validate before calling
# Clamp the requested value to the entity's range before calling: lo = float(hass.states.get(entity_id).attributes["min_temp"]) hi = float(hass.states.get(entity_id).attributes["max_temp"]) temperature = min(max(temperature, lo), hi)
Try / catch
from homeassistant.exceptions import ServiceValidationError
try:
await hass.services.async_call("climate", "set_temperature", {...}, blocking=True)
except ServiceValidationError as err:
_LOGGER.warning("Airobot set_temperature rejected: %s", err) Prevention
- Always clamp automation temperature values to the entity's min_temp/max_temp
- Refresh coordinator data before sending settings when the robot just came online
- Treat repeated failures as connectivity/auth problems, not value problems
When it happens
Trigger: Calling climate.set_temperature on an Airobot thermostat entity while the cloud API call fails: value rejected by the device (out of the robot's allowed range), robot offline, or transient cloud error.
Common situations: Automation sends a temperature the device refuses, robot loses connectivity mid-command, or the coordinator's cached settings are stale so the home/away branch picks the wrong endpoint.
Related errors
- Failed to set preset mode to {preset_mode}.
- Failed to set value.
- Unsupported fan mode {fan_mode}
- Unsupported HVAC mode {hvac_mode}
- Unsupported preset mode {preset_mode}
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/49a454ba77d3410c.
Report an issue: GitHub.