Help needed because automations don't get finished with multiple light groups

I created an automation see below which will not be completed because of errors. Can you guys help me to find the problem? The lights are via conbee 2 (philips hue) but during the automation not all the lights will change. The end of the automation is never be runned

alias: Sunset Evening Mode
description: ""
trigger:
  - platform: sun
    event: sunset
    offset: 0
condition: []
action:
  - service: scene.turn_on
    target:
      entity_id: scene.evening
    metadata: {}
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id: input_boolean.morning_mode
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id: input_boolean.night_mode
mode: single
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 142, in request_with_retry
    return await self.request(method, path, json)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 167, in request
    response: dict[str, Any] = await self._request(
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 194, in _request
    _raise_on_error(response)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 225, in _raise_on_error
    raise_error(data["error"])
  File "/usr/local/lib/python3.10/site-packages/pydeconz/errors.py", line 73, in raise_error
    raise cls(
pydeconz.errors.BridgeBusy: 901 /lights/11/state/on Internal error, 951

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 142, in request_with_retry
    return await self.request(method, path, json)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 167, in request
    response: dict[str, Any] = await self._request(
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 194, in _request
    _raise_on_error(response)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 225, in _raise_on_error
    raise_error(data["error"])
  File "/usr/local/lib/python3.10/site-packages/pydeconz/errors.py", line 73, in raise_error
    raise cls(
pydeconz.errors.BridgeBusy: 901 /lights/11/state/on Internal error, 951

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 142, in request_with_retry
    return await self.request(method, path, json)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 167, in request
    response: dict[str, Any] = await self._request(
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 194, in _request
    _raise_on_error(response)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 225, in _raise_on_error
    raise_error(data["error"])
  File "/usr/local/lib/python3.10/site-packages/pydeconz/errors.py", line 73, in raise_error
    raise cls(
pydeconz.errors.BridgeBusy: 901 /lights/11/state/on Internal error, 951

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/scene/__init__.py", line 114, in _async_activate
    await self.async_activate(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/scene.py", line 334, in async_activate
    await async_reproduce_state(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 116, in async_reproduce_state
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 110, in worker
    await platform.async_reproduce_states(
  File "/usr/src/homeassistant/homeassistant/components/light/reproduce_state.py", line 194, in async_reproduce_states
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/light/reproduce_state.py", line 181, in _async_reproduce_state
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 570, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/deconz/light.py", line 234, in async_turn_on
    await self.api.set_state(id=self._device.resource_id, **data)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/interfaces/lights.py", line 174, in set_state
    return await self.gateway.request_with_retry(
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 155, in request_with_retry
    return await self.request_with_retry(method, path, json, tries)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 155, in request_with_retry
    return await self.request_with_retry(method, path, json, tries)
  File "/usr/local/lib/python3.10/site-packages/pydeconz/gateway.py", line 158, in request_with_retry
    raise BridgeBusy
pydeconz.errors.BridgeBusy

The problem appears to be due to a failure difficulties in the deConz integration and/or the Conbee2 device.

pydeconz.errors.BridgeBusy: 901 /lights/11/state/on Internal error, 951

Someone else reported the same problem last February so maybe the following discussion can be helpful:

1 Like

For me the solution was to enable in deconz the Source Routing. Apparently when the stick controls the traffic on its own, in larger networks this type of issues can arise. I enabled Source Routing (so the routing is controlled by app) and all these problems dissapeared:


You can experiment with Maximum hops and Minimum LQI parameters, but I think 5 and 150 respectively are good starting point to stabilize situation.

1 Like