{"record":{"id":"efb7aa0b1074eede","repo":"home-assistant/core","slug":"failed-to-set-value","errorCode":null,"errorMessage":"Failed to set value.","messagePattern":"Failed to set value\\.","errorType":"exception","errorClass":"ServiceValidationError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/airobot/number.py","lineNumber":94,"sourceCode":"    ) -> None:\n        \"\"\"Initialize the number entity.\"\"\"\n        super().__init__(coordinator)\n        self.entity_description = description\n        self._attr_unique_id = f\"{coordinator.data.status.device_id}_{description.key}\"\n\n    @property\n    @override\n    def native_value(self) -> float:\n        \"\"\"Return the current value.\"\"\"\n        return self.entity_description.value_fn(self.coordinator)\n\n    @override\n    async def async_set_native_value(self, value: float) -> None:\n        \"\"\"Set the value.\"\"\"\n        try:\n            await self.entity_description.set_value_fn(self.coordinator, value)\n        except AirobotError as err:\n            raise ServiceValidationError(\n                translation_domain=DOMAIN,\n                translation_key=\"set_value_failed\",\n            ) from err\n        else:\n            await self.coordinator.async_request_refresh()\n","sourceCodeStart":76,"sourceCodeEnd":100,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/airobot/number.py#L76-L100","documentation":"Raised by the Airobot number entity's async_set_native_value when entity_description.set_value_fn raises any AirobotError. ServiceValidationError with translation key set_value_failed stops the service call with a clean message; the coordinator refresh only runs on success (else branch).","triggerScenarios":"Setting a numeric configuration (e.g. target temperatures/settings values) via number.set_value when the cloud API rejects the value or the connection fails — out-of-range value for the device, robot offline, or transient error.","commonSituations":"Slider set beyond what the robot accepts, commands during robot downtime, or stale auth (AirobotError parent class also covers auth failures caught generically here).","solutions":["Retry with a value within the entity's min/max (check native_min_value/native_max_value)","Confirm the robot is online","Reload the integration if auth may have expired (coordinator will surface reauth separately)","Check the chained AirobotError in logs for the exact API reason"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"attrs = hass.states.get(entity_id).attributes\nvalue = min(max(value, attrs[\"min\"]), attrs[\"max\"])  # native min/max attrs","typeGuard":null,"tryCatchPattern":"from homeassistant.exceptions import ServiceValidationError\n\ntry:\n    await hass.services.async_call(\"number\", \"set_value\", {...}, blocking=True)\nexcept ServiceValidationError as err:\n    _LOGGER.warning(\"Airobot set_value rejected: %s\", err)","preventionTips":["Clamp values to the number entity's min/max before setting","Ensure the robot is online when automations adjust settings","Watch for auth expiry surfacing as generic AirobotError here"],"tags":["airobot","home-assistant","number-entity","service-validation"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}