peter-murray / node-hue-api

Node.js Library for interacting with the Philips Hue Bridge and Lights
Apache License 2.0
1.19k stars 145 forks source link

How turn multiple lights on/of simultaneously? #210

Open RPiMS opened 2 years ago

RPiMS commented 2 years ago

Hi!

I am trying to turn on/of multiple lights simultaneously, but they only turn on/off one after one.

Is that a result of the preconfigured rate limits (maxConcurrent 1, wait 60 for lights)? If so, why don't you limit the rates per light (device)? or is there an other way to solve this?

Ty

peter-murray commented 2 years ago

It is primarily a limitation of the hub, as it will transform that type of request from REST into Zigbee messages to each light, resulting in this behaviour. The concurrency controls are there to be compliant with the bridge limits.

If you want to do this with a number of lights, use a group or zone these are properly sent to all the target lights simultaneously.

peter-murray commented 2 years ago

There was an issue with the rate limits being swapped between groups and lights, which I have just resolved meaning the limit is now correctly set to once per 60ms instead of the group limits of once per second. This has been released in 5.0.0-beta.11.

That said still the above usage of groups/zones is the recommended way to target more than one light changing state simultaneously.