Core: Philips Hue Component does not support scan-interval.

Created on 12 Mar 2018  Â·  20Comments  Â·  Source: home-assistant/core

Home Assistant release (hass --version):
0.65.3

Python release (python3 --version):
3.6.4

Component/platform:
Hue

Description of problem:
I recently discovered that the Philips Hue component has been updated when I noticed my automation’s were taking a long time to trigger. Looking into it, I am now noticing that I cannot change the scan_interval (polling frequency) for Hue lights…

I think this was a huge under sight not to make sure this was included in the update. When it comes to lighting with multiple sources of control (ie. wall switches, motion detectors, alexa, phones, etc…) having the ability to modify your polling rate is critical to the successful operation of lighting focused automation’s etc…

I really hope the right people see this, and are able to help out the folks that rely on Home Assistant and the Philips Hue ecosystem.

The component fails to load adding “scan_interval” (tried various amount of ways to add “scan_interval” to the config). It is evident the component does not support it and it was a break with the new hue component update.

Expected:
Ability to shorten or lengthen polling rate/scan-interval for Philips hue devices.

Most helpful comment

Hi, just my two cents, I wanted to customize the scan interval as well and found another alternative running hue-mqtt-bridge. This brings another app in the automation space but works flawlessly.

All 20 comments

Suffering the same here since 0.60. There were also issues with not being able to use entity name space but looks like that one was resolved, but still no resolution for scan interval :(

Subscribing. Hopefully this will get sorted quickly.

Confirmed on my side with version 0.65.3.
The pulling interval is set to 30 seconds.
@jamesw4 @sircoolkeen Do you know in which this bug appears ? If so I'm pretty sure I can fix it !

This touches on the issue.

Quick and ugly fix:
Edit the following file: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/light/hue.py#L49
and add ligne 49:

SCAN_INTERVAL = timedelta(seconds=10)

To reduce the scan interval to 10 seconds

I just don't know how to change this value from the config parameter :/
@balloob could you give me a tip to do it in the right way ?
Thanks !

Sorry my last comment should of included a link - https://github.com/home-assistant/home-assistant/pull/11389

There is currently no support for setting the scan interval of a platform via discovery fired from a component, as discussed in #11389.

The hue component and platforms are undergoing a major refactor by the hands of @balloob.

https://github.com/home-assistant/home-assistant/pull/13043

Now the default scan interval is 5 seconds. Updating should also be more efficient.

I'd see how the new hue component performs before delving deeper into this issue.

Supporting the scan interval config option will not be coming back for Hue. It's now set to 5 seconds and that should be good enough.

How about we do discuss this further, and instead of just closing my issue we look into other options. It seems so many other components support time interval customization and with something as popular as Philips Hue, this is where we want to limit?
I appreciate you taking the initiative here @balloob, but it is absolutely not too much to ask for a proper resolve here, instead of you telling us 5 seconds is good enough. Especially with such a popular platform that Philips Hue is.
-Keenan

Hi, just my two cents, I wanted to customize the scan interval as well and found another alternative running hue-mqtt-bridge. This brings another app in the automation space but works flawlessly.

@balloob Thanks for this major update (asyncio) !
As you said, the scan interval is not coming back with this update but will you accept a Pull Request about that ?
By the way is there any way to monitor philips hue switches ?
Thanks for you answer !

Will not take a pull request for this.

it is absolutely not too much to ask for a proper resolve here

@sircoolkeen it is. If you want to change the scan interval, run it as a custom component. If you want faster updates, go ask Philips for an API that allows us to subscribe to updates. Home Assistant will stick to 5 seconds and not make it configurable.

@balloob thanks for your answer !
So I guess the ideal think to do, should be to find a way to subscribe to the Bridge events, as @balloob said ...

@balloob I maybe found a way to subscribe ! Did you try this ? https://developers.meethue.com/comment/2891#comment-2891
Thanks for your answer !
[EDIT] I got my answer... this is not implemented ...

@balloob I guess it may be my ignorance with the issue, in which case I sincerely apologize. I’m just confused as to where the difficulty lies in making this user configurable? With something as moldable and customizable as Home Assistant, everyone’s installation has different needs. If someone wants to poll updates every second they should be able to, and easily what is the harm? Default 5 seconds, but allow users to choose anything. What is the harm in that at all?
This is the last I will comment on this, I just hope you see where I am coming from on this.
People (especially the folks using Home Assistant) appreciate the customization/convenience Home Assistant inherently brings. Polling frequency can have a massive impact on time-sensitive automations and can completely change wether an automation in the field is noticed, or simply appreciated.
In situations where polling times are critical I think an option should be available to modify the rate.
Thank’s for your understanding..

@balloob, I was reading up on this. Trying to create a custom component for the hue light component and in doing so I noticed, while tcpdumping, that the bridge is polled every 30 seconds, not 5 like the hue.py file suggests. Can you tell if this is by design (the 30 seconds) or maybe not? If so, where should I look if I wanted to overrule this?

I noticed as well last night, as I lay in bed waiting for home assistant to see my bedroom lights off, and turn off my livingroom lights. The polling rate is definitely longer than the 5 seconds listed in the component.

@vandalon oh man, you're totally right. Looks like SCAN_INTERVAL is ignored for config entry based setups of platforms. fixing that now.

awesome, thanks :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piitaya picture piitaya  Â·  3Comments

sogeniusio picture sogeniusio  Â·  3Comments

YellowMonster76 picture YellowMonster76  Â·  3Comments

missedtheapex picture missedtheapex  Â·  3Comments

kirichkov picture kirichkov  Â·  3Comments