{"record":{"id":"2106404c4659e074","repo":"home-assistant/core","slug":"the-bond-api-returned-an-error-calling-set-power-s-210640","errorCode":null,"errorMessage":"The bond API returned an error calling set_power_state_belief for {self.entity_id}.  Code: {ex.status}  Message: {ex.message}","messagePattern":"The bond API returned an error calling set_power_state_belief for (.+?)\\.  Code: (.+?)  Message: (.+?)","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/bond/light.py","lineNumber":284,"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_power_state_belief(power_state)\n            )\n        except ClientResponseError as ex:\n            raise HomeAssistantError(\n                \"The bond API returned an error calling set_power_state_belief for\"\n                f\" {self.entity_id}.  Code: {ex.status}  Message: {ex.message}\"\n            ) from ex\n","sourceCodeStart":266,"sourceCodeEnd":288,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bond/light.py#L266-L288","documentation":"Raised by BondFireplaceLight.async_set_power_belief when Action.set_power_state_belief(power_state) fails with a ClientResponseError. Used for fireplace on/off belief (including the brightness==0 → off path of async_set_brightness_belief).","triggerScenarios":"Turning the fireplace on/off (or brightness 0) while the Bond hub returns an HTTP error: 401 bad token, 404 unknown device_id, 5xx hub fault.","commonSituations":"Access token rotated without re-authenticating Home Assistant, device deleted from hub, hub recovering from a reboot.","solutions":["Match Code: 401 → re-auth; 404 → reload after re-adding; 5xx → retry.","Test the fireplace from the Bond app to rule out the device/hub side.","Keep the bond integration and hub firmware current."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await fireplace.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":["Single re-auth after token rotation fixes all bond entities at once.","Avoid stacking many fireplace commands immediately after hub boot."],"tags":["bond","light","fireplace","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"}