-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to set multiple lights in a single http request? #839
Comments
There's not currently a way to do this with the API, but I'm open to adding one! There was at some point a way to fan out eg:
but that would send the cartesian product of all of those (so 3*2*2 in this case). Think I'd rather add a separate endpoint like |
Thanks! I'll have a look and give it a try myself! If I don't stop myself though, I might end up trying to add the whole animation engine (maybe in a fork, I'm not sure that code would be super useful to everyone else) |
Hey @furahivszuri, I was already in the code updating the web UI and had a place where I wanted a batch update endpoint anyway. It's added in 1.13.0-beta2. Documentation is here. Syntax is something roughly like:
There are a few levels of nesting to make it more generic -- hopefully not too much of a pain in the butt to use! |
Hello,
I control 15 Milight bulbs set up around a room. Some are RGBW, some RGB_CCT. I wrote a page that allows me to program them. Basically a simple JSON config lets you set all bulbs to the same color, each to a different color or even animations (with either all bulbs animating at the same time, or each bulb individually). I don't sync to music or anything crazy, so precise timings are not important, but quick changes are
I originally ran it with Milight controllers, and for the most part it worked
I recently moved to an esp8266 controller with ESPMH, and I've noticed that it's relatively easy to send too many http requests in a short time to the hub. The web server stops responding after a while.
I've tried many tings, like sending or not sending blockOnQueue, awaiting each request (which I am currently doing fro a browser), that ends up being too slow; sending a few requests staggered and awaiting them, etc...
The thing is for many of these animations, I'll really have 3 or 4 different colors, so if i could send a request like "PUT gateways/1/rgbw/1, gateways/1/rgbw/2, gateways/1/rgb_cct/1" with a body of {"hue":240,"saturation":60,"level":100,"status":"on"} , tht would save me a lot of requests
Even better if a single request could set all the lights at once (like set 1 and 2 to yellow, 3 and 4 to blue, 5 and 6 to red). I get there is only one radio, so they will actually execute sequentially, that's fine, a single request for all the lights is easier to await compared to one per light, the overhead adds up quickly
Failing that, any recommendations on how to tune the software and my requests for best performance?
Thanks
The text was updated successfully, but these errors were encountered: