home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.97k stars 29.62k forks source link

Slow Hue and Limitlessled performance #12108

Closed Gerben321 closed 6 years ago

Gerben321 commented 6 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.62

Python release (python3 --version): Latest running Docker

Component/platform: Hue and Limitlessled

Description of problem: When you quickly change the colors of lights, turn them on, turn off, change some more colors, change brightness etc, the lights on both Hue and Limitlessled are super slow. I use a remote that's connected to Hass which fires commands somewhat fast (few per second). I control 3 components: Hue (slow), Limitlessled (slow), and Xiaomi (fast!). First two platforms are super slow to respond after a few quick commands. It simply puts everything in some kind of queue and it can take a few seconds before it does what you actually want in the present. I've had cases where it kept changing 15 seconds before it was finished (I stopped giving commands to let it calm down. CPU usage isn't really higher.

The interesting part is that the Xiaomi bridge that I also control the same way is lightning quick! It directly acts to my commands, even if I do it really quickly for minutes. Maybe the implementation of this component is just way better, don't know.

I would expect the lights to change quickly. Other apps for Hue and limitless app do this. There are even ambilight apps where there's some kind of disco mode that changes lights super fast. Why isn't that possible with HASS?

You can try it in HASS by opening the color picker for Hue or Limitlessled, and quickly change the colors on it. Keep changing for a bit, and then stop. You will notice the lights keep going with old/queued commands.

What can be done about this?

Expected: Direct changes

amelchio commented 6 years ago

The Philips Hue FAQ states: Do not repeatedly send the ‘ON’ command as this will slow the responsiveness of the bridge. Yet, the integration in HA does just that. So I guess that could be a reason.

For Limitlessled, I don't know.

Gerben321 commented 6 years ago

I don't think that's the issue. I created my own custom component which talks directly to the Hue API, and I only send the changes. Same behaviour. Maybe some Python limitation, or a wrong use of a network stack? I barely use Python, so I'm not sure about it.

caerffili commented 6 years ago

I'm experiencing the same thing using the new deCONZ lights introduced in 0.61.

Both level and color control are affected. Restarting hass fixes it for a little while but it soon returns.

balloob commented 6 years ago

We have fully refactored Philips Hue. Please report any issues as new ones after release 0.66.

amelchio commented 6 years ago

For the record, I have identified some slowness with LimitlessLED and expect to speed it up at some point.

If someone does make new issues, please file one separate issue for each platform. Keeping track of two problems in one thread is much hard than marking an issue as a duplicate.

Gerben321 commented 6 years ago

Looking forward to 0.66 then. I hope it also has brightness and kelvin increase and decrease like the Hue API has. Very useful.