It would be nice to be able to use templates against scan_interval or a service call to change it.
For example, I want to poll something every 120 seconds in the morning (07:00-10:00) but outside of that 600 seconds.
Considering all of the people using HASS it would probably reduce the load of all the IoT and API providers we all use… or maybe increase it, who knows But at least we’d have more control.
I think I read somewhere that scan_interval is slowly being phased out in favour of the homeassistant.update_entity service. Assuming that your entity supports this, you can implement an automation that is triggered through a time_pattern at specific intervals depending on the time of the day, or by adding other conditions like state of the sun.
Eventually this service calls the entity’s update or async_update method, so I would expect that all entities support this.
Sorry, I can’t find the source anymore; may have been a comment in a PR; it may have been specific to certain types of entities, like the ones calling an external API.