-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
API Command to get all current colors #4308
Comments
To add to this ticket, the same in reverse would also be appreciated, since from what I can see I also do not have control over the individual LED's except for with the UDP Realtime API, however using that would require me to implement custom transitioning logic when trying to set a color palette. |
Hi, a few thoughts on your request
We normally have hundreds of LEDs connected - how would you define "current color" when effects other than "solid" are running? The "main color" from the color wheel can be checked and set via JSON or via http API: https://kno.wled.ge/interfaces/http-api/#xml-response
The "i" json tag can be used for this, however there are size limitations so normally you can't set all LEDs with one message. https://kno.wled.ge/interfaces/json-api/#per-segment-individual-led-control Processing the "i" request is relatively slow - a few request per second is probably the max possible without making WLED unstable.
If you make a custom build with |
Good question, in my case I would want a snapshot of the current now. I have two cases for which I would like to use this color fetching.
Must have overlooked that while scrolling through the documentation, thanks for pointing that out
hm. yeah, I have read that there is a build tag that can extend abilities and it does appear to be pretty much what I want. I was hoping i'd be able to avoid custom builds so that I can keep comfortably updating my devices over homeassisstant. Maybe I'll stick with the websocket live on and off trigger then. |
My current problem is that I would like to give a preview of what the lights are displaying at a given moment so that I can better prepare fading effects in the beginning of a UDP Stream.
Solution
A new API command that returns the same kind of object as the websocket live stream would, but just once. For example /state/currCol or something else. In order to not further gunk up the /json/state message which can already be quite sizeable it might also be a good idea to leave it out of the state object.
Alternatives I have considered
The only solution I can find to get all current colors is to enable the live stream in a Websocket (so to send {"lv":true}), wait for a single frame and then disable the stream again. This is not an elegant solution.
The text was updated successfully, but these errors were encountered: