{"record":{"id":"eaa009c0607a076f","repo":"home-assistant/core","slug":"the-bond-api-returned-an-error-calling-set-light-s","errorCode":null,"errorMessage":"The bond API returned an error calling set_light_state_belief for {self.entity_id}.  Code: {ex.status}  Message: {ex.message}","messagePattern":"The bond API returned an error calling set_light_state_belief for (.+?)\\.  Code: (.+?)  Message: (.+?)","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/bond/light.py","lineNumber":106,"sourceCode":"        try:\n            await self._bond.action(\n                self._device_id,\n                Action.set_brightness_belief(round((brightness * 100) / 255)),\n            )\n        except ClientResponseError as ex:\n            raise HomeAssistantError(\n                \"The bond API returned an error calling set_brightness_belief for\"\n                f\" {self.entity_id}.  Code: {ex.status}  Message: {ex.message}\"\n            ) from ex\n\n    async def async_set_power_belief(self, power_state: bool) -> None:\n        \"\"\"Set the belief state of the light.\"\"\"\n        try:\n            await self._bond.action(\n                self._device_id, Action.set_light_state_belief(power_state)\n            )\n        except ClientResponseError as ex:\n            raise HomeAssistantError(\n                \"The bond API returned an error calling set_light_state_belief for\"\n                f\" {self.entity_id}.  Code: {ex.status}  Message: {ex.message}\"\n            ) from ex\n\n\nclass BondLight(BondBaseLight, BondEntity, LightEntity):\n    \"\"\"Representation of a Bond light.\"\"\"\n\n    def __init__(\n        self,\n        data: BondData,\n        device: BondDevice,\n        sub_device: str | None = None,\n    ) -> None:\n        \"\"\"Create HA entity representing Bond light.\"\"\"\n        super().__init__(data, device, sub_device)\n        if device.supports_set_brightness():\n            self._attr_color_mode = ColorMode.BRIGHTNESS","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bond/light.py#L88-L124","documentation":"Raised by BondBaseLight.async_set_power_belief when Action.set_light_state_belief(power_state) fails with a ClientResponseError. This is the belief path used when Home Assistant records an assumed on/off state for the light (e.g. brightness 0 → off, restore state) rather than commanding the device.","triggerScenarios":"async_set_brightness_belief(0) routes to power-belief off; turn_on/turn_off belief updates; any of these while the hub returns an HTTP error status.","commonSituations":"Stale access token (401), device removed from the Bond hub (404), transient 5xx while the hub is busy.","solutions":["Map the Code: value: 401 re-enter token via re-auth; 404 reload integration after re-adding the device; 5xx retry later.","Confirm the light is online in the Bond app.","Update hub firmware if set_light_state_belief is rejected with 400."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await light.async_set_power_belief(state)\nexcept HomeAssistantError as err:\n    if \"Code: 401\" in str(err): trigger_reauth()\n    else: log_and_notify(err)","preventionTips":["Treat any 401 from Bond entities as a signal to re-authenticate once, globally.","Avoid issuing belief commands while the hub is being updated/rebooted."],"tags":["bond","light","http","home-assistant","belief-command"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}