unfoldedcircle / feature-and-bug-tracker

Feature and bug tracker repository for Unfolded Circle products
22 stars 0 forks source link

[bug] Remote is spamming Hue bridge with requests #192

Open mvdwetering opened 8 months ago

mvdwetering commented 8 months ago

Is there an existing issue for this?

Description

Note that I did see issue #150, but looking at those logs this seems to be different.

While looking at something else I noticed that the Remote is continuously spamming the Hue bridge with many requests per second.

After looking at it a bit more I would guess it is about 11 requests per second. Initially it looked like a lot more because the requests probably need more network packets.

How to Reproduce

Not sure, I just setup the integration and added my lights (about 50).

Expected behavior

Be a good citizen and not spam the bridge.

System version

1.4.5

What part of the system affected by the problem?

Integration

Additional context

In the Remote logs for the Hue integration I see about 11 lines per second like below (different light each line and then it seems to repeat) which seems to match my initial guess about the amount of requests per second.

2023-11-15 19:55:51.714018 +00:00   intg-philipshue INFO    Got hue light with id: 46 Hue Bloom

I have about 50 lights which might be amplifiying the amount of requests.

Some notes/remarks about the integration

Based on the logging with the line-per-light and ids used I get the impression that the integration is still using CLIPv1 and it is polling each light individually. If that is the case I would recommend looking at CLIPv2 (check the Hue developer website) as it is the newer API and has features like a push channel so you don't need to poll.

edit: This is while the remote is in the dock, it stops when it is out.

zehnm commented 6 months ago

Sorry for the late reply. You are correct about the polling, this is definitely not optimal (or suitable at all) if there are many lights. We've started with push, but the communication wasn't reliable. I'll have another look to sort out the push issues.