Light.turn_on with Hue lights: not more than 7 entities per service call allowed?

Since HA 101.x, I have a weird problem with my Hue lights (1 bridge only, ca. 20 bulbs and lightstrips). I have an automation that kicks in every 10 minutes and adjusts the brightness and color temp during the day - it’s my own circadian light implementation.

This automation loops through all of my lights and applies a light.turn_on to every light that is currently switched on. Everything was fine until I upgraded to HA 101. Since this upgrade I have lots of errors in my log like these:

2019-11-26 21:10:20 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 564, in async_request_call
    await coro
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/hue/light.py", line 439, in async_turn_on
    await self.light.set_state(**command)
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohue/lights.py", line 117, in set_state
    json=data)
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohue/bridge.py", line 62, in request
    'Invalid content type: {}'.format(res.content_type))
2019-11-26 21:10:20 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 564, in async_request_call
    await coro
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/hue/light.py", line 439, in async_turn_on
    await self.light.set_state(**command)
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohue/lights.py", line 117, in set_state
    json=data)
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohue/bridge.py", line 69, in request
    ) from None
aiohue.errors.RequestError: Error requesting data from 192.168.1.33: [Errno 104] Connection reset by peer

Using trial-and-error, I found out that the light.turn_on service stops working as soon as it is called with more than 7 entities in entity_id. That’s also the reason why the errors only occur sporadically, i. e. every time 8 or more lights are switched on.

Can anybody confirm this behaviour? What has changed with HA 101?

Thanks in advance & best regards,
cicero22

I just found out that my Hue bridge updated to firmware 193544020 recently. Does anybody encounter issues with HA with this version? I cannot find any release notes…

I have recently started experimenting with scenes. Since I only have HUE bulbs I soon created scenes with 15+ bulbs and i noticed that only 7/8 bulbs moved to the new colors/light of the new scene while switching.

My logs are full of the errors you als have. I am on the same firware version of the HUE bridge 193544020.

Since these errors are also reproduced by a simple scene I am guessing this must be a bug. Hope somebody can help out since my scenes are kinda useless now.

Hey,

I have the same problem. I used to have a group of lights in HomeKit. The group was about 12 lights. When turning the group on or off 1-3 lights didn’t react and stayed on/off.

So I separated the Group into two 6 lights big groups. That works now. But it’s not so nice.

Are your lights grouped in the Hue app? Lights grouped in the Hue hub are in a ZigBee group, lights grouped in Home assistant are not in a ZigBee group. When you send a request to a group containing e.g. 8 bulbs, home assistant sends 8 requests, one for each bulb, and because the Hue bridge can’t handle a lot of requests at the same time you can get delays, errors, lost packets etc. However if the same lights are in a ZigBee group home assistant sends only one request to the Hue hub.

2 Likes

They are in a HA group.
Didn’t expect that the hue api is not that developed.

Has anyone figured out a good work around on this yet? I am having this same issue currently.