Configurable scan interval for integrations #306
Replies: 3 comments 7 replies
|
So far we only allow it via this automation. Mostly because the automations give the user way more power. Poll whenever you like, without doing code changes. Otherwise we would have a slippery slope of people wanting to update with special cases |
|
A small question on the side: Are scan intervals centrally defined (by policy), or are they integration specific? Different cloud counterparts have different policies when its comes to polling frequencies, so I doubt there can be one global setting. Moreso, the allowable polling frequency might be dependent on state or time (e.g. less frequent polling at night, more frequent polling when charging, etc.). Even different users might have different agreements with cloud provider that affects the scan intervals. I think the integrations that have use-cases like this should be able to offer the ability to customize the scan intervals. That doesn't mean that all integrations needs this, thou. The means to turn off automatic polling and use automation still stands. This is great freedom for the user. |
|
Another consideration is that if users chose to disable polling to an integration, I assume it will disable polling for all coordinators that the integration use. If the integration uses multiple coordinators, the user will need to take care of updating all of them manually. I think this guide https://www.home-assistant.io/common-tasks/general/#defining-a-custom-polling-interval seems to imply that all its entities gets updated on |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe your core improvement
It would be great if integrations were allowed offer custom scan intervals. For some integrations it may fit to offer modes in form of a select selector / select entity (like
highandlow) and for others it may be more appropriate to offer a duration selector / number entity.Current limitations
Currently integrations are not allowed to offer user configurable scan intervals. The canonical way to modify the scan interval is to globally (for an integration) disable polling and create an automation to do it manually - which is imho not very user friendly and may lead to unobvious issues - eg. when the integration uses multiple coordinators
https://www.home-assistant.io/common-tasks/general/#defining-a-custom-polling-interval
or
https://community.home-assistant.io/t/how-to-set-a-custom-scan-interval/680579
Technical benefits
Users would have a nice way to configure their update intervals to their likings from a config flow, options flow or a configuration entity.
A configuration entity would be very easy to automate to eg. have slower intervals after sunset and faster after sunrise without a user needing to know integration internals.
Offering sane options for integrations would prevent users to go the manual route and configure too low intervals that may run into rate limitations of APIs while still being able to provide integration-specific dynamic intervals (eg. for solar equipment slower at night).
Additional context
No response
All reactions