Add service calendar.reload to Google Calendar Integration

Currently with the Scheduler Helper there’s a service that allows you to restart the scheduler without the need to restart HA: schedule.reload

Google calendars update in HA every 15 minutes, so if I’m working on something using google calendars (like my smart dumb boiler project) and wish to test it, then I have to wait 15 minutes between changes to see if it’s working.

It can turn a 5 minute job into hours of testing to get working right.
(not an exaggeration. It’s literally taken me an afternoon to do some changes in the past)
The only way I found to force it to update faster is to reset HA.

Aligning the calendar to have a reload service would be ideal.

You can try :

service: homeassistant.reload_config_entry
data: {}
target:
  entity_id: calendar.Maison

Replace the entity_id by any calendar. I think this reload the entire integration. The byproduct of restarting the integration is that it triggers a reloads of all the calendars.

The only downside is that the entities become unavailable for a short moment.

Yup, that did it.
They dipped out only for a couple of seconds, but much better than waiting 15minutes for it to update naturally (or forcing a full HA restart)

1 Like

Reverted back to the google_calendar.yaml method, but the service returns errors when manually triggered when using GCalendars this way with Home Assistant

The homeassistant.update_entity service call should work now for loading the current data from the calendar API entity after the next release. This was fixed in Update calendar handle state updates at start/end of active/upcoming event by allenporter · Pull Request #98037 · home-assistant/core · GitHub to allow separating the loading of data from the source from the evaluation of the calendar state on/off.

2 Likes