home-assistant/core · error · HomeAssistantError
The bond API returned an error calling set_light_state_belie
Error message
The bond API returned an error calling set_light_state_belief for {self.entity_id}. Code: {ex.status} Message: {ex.message} What it means
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.
Source
Thrown at homeassistant/components/bond/light.py:106
try:
await self._bond.action(
self._device_id,
Action.set_brightness_belief(round((brightness * 100) / 255)),
)
except ClientResponseError as ex:
raise HomeAssistantError(
"The bond API returned an error calling set_brightness_belief for"
f" {self.entity_id}. Code: {ex.status} Message: {ex.message}"
) from ex
async def async_set_power_belief(self, power_state: bool) -> None:
"""Set the belief state of the light."""
try:
await self._bond.action(
self._device_id, Action.set_light_state_belief(power_state)
)
except ClientResponseError as ex:
raise HomeAssistantError(
"The bond API returned an error calling set_light_state_belief for"
f" {self.entity_id}. Code: {ex.status} Message: {ex.message}"
) from ex
class BondLight(BondBaseLight, BondEntity, LightEntity):
"""Representation of a Bond light."""
def __init__(
self,
data: BondData,
device: BondDevice,
sub_device: str | None = None,
) -> None:
"""Create HA entity representing Bond light."""
super().__init__(data, device, sub_device)
if device.supports_set_brightness():
self._attr_color_mode = ColorMode.BRIGHTNESSView on GitHub (pinned to 58a3fdb3ea)
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.
Defensive patterns
Strategy: try-catch
Try / catch
try:
await light.async_set_power_belief(state)
except HomeAssistantError as err:
if "Code: 401" in str(err): trigger_reauth()
else: log_and_notify(err) Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Stale access token (401), device removed from the Bond hub (404), transient 5xx while the hub is busy.
Related errors
- The bond API returned an error calling set_brightness_belief
- The bond API returned an error calling set_power_state_belie
- The bond API returned an error calling set_power_state_belie
- The bond API returned an error calling set_power_state_belie
- unknown
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/eaa009c0607a076f.
Report an issue: GitHub.