-
Notifications
You must be signed in to change notification settings - Fork 107
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
Lights turn on/off one by one, color change works fine #331
Comments
For scenes i refactor how requests where handled but looking at your output i don't believe is a big difference. Now it send instant first two light requests for every device and then for remaining lights will wait for request to complete then go to next one. I can try to send requests without to wait for them to complete but with a delay of ~100ms because for sure devices with big number of lights can be overloaded. |
I made new commit, can you check how fast are the lights turned off now and if all are turned off? In the past i have complaints about lights that remain on or off and i don't know exactly what is the minimum possible delay without negative effects. You can play with that sleep value from above commit until you have the best result. |
I tried your commit but it's still too slow, I reduced it to 0.05 but it was still too slow, I got rid of the sleep all together and it's better but it's still not instantaneous :-( I wonder why can't you have the same responsivity that the DeCONZ web gui provides? |
Actually, if I toggle all the lights with the global toggle, they are quite fast, if I toggle just a single room they are slow 🤔 |
I apply this just for group 0. I can apply also for particular groups |
I made new commit that will send requests with 100ms delay also for scenes and particular groups. |
With the latest commit the UI updates instantly but the bulbs still turn on/off one by one. |
May you look at how the Home Assistant DeCONZ component handles this and copy from it? From Hass I can turn on/off all my lights at once instantly, so there must be a way. |
https://photos.app.goo.gl/vEtRjpYfzGAYJa189 The one on the left is DIYHue, the one on the right is Home Assistant (with a Lovelace card containing the individual bulbs, not a DeCONZ group). DIYHue is slightly slower, and in one case one of the bulbs has a long delay. |
What type of bulbs are you using in the group? are they all the same type? |
@maxakuru the ones in the video are Ikea Tradfri GU10, I also have 6 Hue bulbs that behave in a similar way. |
ps. actually I just tested a group of 3 Hue E27 bulbs and they seem to work very well with the latest changes. Those 3 Hue bulbs are connected to a Hue bridge, my IKEA lights are connected on DeCONZ. I also have 2 Hue GU10 connected to DeCONZ, I'll try them as soon my wife wakes up since they are in our bedroom 😂 |
For group 0 that apply to all lights i can call also group 0 in deconz, for particular groups i don't have a perfect solution. |
This might be a good situation to try a ThreadPoolExecutor to handle all the light requests. It would also be useful to profile these calls so we can find the bottleneck. I could add a profiler on another branch when I get home in a couple hours. |
The big problem is the limitation on destination device. We cannot change more than one attribute per http request. If we wait for current http request to complete there will be a noticiable delay between lights change. If we send them all at once the destination device will be overloaded (this was in first place until one guy with 9 bulbs complain that not all lights are updated). Now i place an 100ms delay between requests, but i believe deconz also add an internal delay between requests. |
In this scenario is the destination device the bulb? I’m waiting on my RaspBee module, so I’m not totally familiar with deconz yet. If the destination is the bulb, wouldn’t sending a single request to each bulb concurrently be fine? Right now I see that a thread is spawned to make each request, we could also try using async requests with Let me know if I’m missing something! |
did not play with that. The issue for me is still Deconz because it receive the http requests and the light updates happen with extra delay.
|
i made new commit in develop branch as i cannot test and is risk to create issues. This new commit must forward group 0 requests to deconz and hue bridge. If all lights on/off actions is happening again with delay on some lights the issue is with deconz or ikea bulbs firmware. |
@mariusmotea I tried your commit but I think something is wrong, the API returns an EMPTY_RESPONSE error. |
i will try to debug this |
@FezVrasta i found the issue and i believe is the only one. |
Thanks now it works, yes the "turn all on/off" now works very well, now I'd like to have the same for any kind of interaction, I'm especially interested in this because I really want to get rid of my Hue bridge that right now I use for my Ambilight + Hue TV but the performance of this project aren't good enough to provide a good experience at the moment :-( (I even tried the Entertainment API through the app and is laggy at best...) |
Good! I will try to replicate the same for rooms but i'm not sure the tv send request to rooms because If it send requests to rooms it must apply the same color to all lights in the room. I have a Philips TV home and i can confirm this in a few days. Here is a demo with 1m strip (no silicon tube) with 60 leds splited in 3 virtual lights https://www.youtube.com/watch?v=5omFrvqBLII If you look better you will see there is a small delay, but this is because the CPU was in 100% by Hue Sync process. On windows i made a test and is working much faster. |
Actually the Entertainment performance problem is noticeable even on the Hue Bridge controlled lights. I suppose you don't interact with the Entertainment API of the bridge right? (I mean, BridgeEmulator exposes the Entertainment API but internally it doesn't use it to talk with the Hue Bridge?). If not, it may make sense to default to the Hue Bridge entertainment API for all the commands to improve the overall speed? |
About the Ambilight. I used the room as a way to test a change of a lot of lights al together. I know the Ambilight is going to control them individually |
@mariusmotea I think develop has a bug, the state of the lights don't seem to be synced with what BridgeEmulator exposes (light is on but on the UI it tells is off) |
Can you provide details so i can replicate this? How you changed the lights status? |
I changed the status with Home Assistant |
Ok, clear enough to investigate |
@FezVrasta Thanks for this report. For some reasons i did not discover this bug by myself. Is fixed now. |
Hi, I think it would also be useful to add a back button to both (link device and import from bridge) |
Thank you all for the excellent work 👏 |
Issue fixed |
Merge Yeelight Music Mode (mariusmotea#329)
Hi I'd really like to understand why the lights turn on or off one by one rather than all together.
It used to happen even when I changed colors, but with the recent versions the color changes are synced correctly across all the lights. So you must have fixed it somehow I guess?
As you can see in the gif below, the lights should turn on all together but actually they turn on one after the other (it happens in the web UI but even on the physical bulbs)
Below you find the log of what happened once I tried to turn all of them off together:
The text was updated successfully, but these errors were encountered: