Manual Coordinator Refresh Action #1954
Unanswered
Jawar19
asked this question in
Integration enhancements
Replies: 2 comments 2 replies
-
|
🏷️ I've automatically added the |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
There is already a common (not integration specific) method available, by using the homeassistant.update_entity action. Further here you will find a how-to for defining custom polling intervals |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Integration name
rejseplanen
Link to integration documentation on our website
https://www.home-assistant.io/integrations/rejseplanen/
Describe the enhancement
Add a service/action
rejseplanen.refreshthat allows users to manually trigger a data refresh from the Rejseplanen API outside of the standard polling interval. This action would force the coordinator to immediately fetch new departure data and update all associated sensor entities.The action should:
config_entry_idordevice_idparameter to refresh specific stops or the entire integrationlast_update_success_timeon the coordinatorThis would be implemented as a service registered during integration setup, calling the coordinator's
async_request_refresh()method with appropriate rate limiting checks.Use cases
Public transport departure times have varying relevance throughout the day. A 5-minute polling interval is appropriate for general monitoring but becomes insufficient during active commute scenarios.
Specific scenarios where manual refresh is valuable:
Pre-departure preparation: User has an automation that triggers 10 minutes before leaving for work. The automation can refresh departure data immediately to show the most current real-time information, delays, or cancellations before the user walks out the door.
Peak hour monitoring: During morning rush (7:00-9:00) and evening commute (16:00-18:00), buses and trains are more prone to delays and schedule changes. An automation can increase refresh frequency to every 2 minutes during these windows while maintaining the standard 5-minute interval during off-peak hours.
Event-driven updates: When a user's location tracker shows they're approaching a station or bus stop, trigger a refresh to display the most current departure information on a dashboard or send an actionable notification.
Weekend/holiday scheduling: During weekends when services run less frequently, users may want updates only when they're actually planning to travel, triggered by calendar events or manual dashboard buttons.
Example automation:
This approach respects API rate limits (staying well within 50,000 calls/month) while providing real-time data exactly when users need it most, improving the practical utility of the integration without placing unnecessary load on the API during periods when departure information isn't actively being used.
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions