callumw
(CallumW)
October 15, 2022, 5:17pm
1
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.
jld
November 5, 2022, 5:28pm
2
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.
callumw
(CallumW)
November 7, 2022, 1:09pm
5
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
callumw
(CallumW)
December 20, 2022, 3:27pm
6
Reverted back to the google_calendar.yaml method, but the service returns errors when manually triggered when using GCalendars this way with Home Assistant
opened 05:44AM - 19 Dec 22 UTC
closed 12:09AM - 20 Dec 22 UTC
integration: google
### The problem
Previously I had a script that ran the following to reset the c… alendar prompting an immediate sync with Google.
```
alias: Reload Calendars
sequence:
- service: homeassistant.reload_config_entry
data: {}
target:
entity_id: calendar.schedule
mode: single
icon: mdi:calendar-today
```
It was working fine for months, but now the calendar integration is fixed again I decided to reinstate my google_calendar.yaml so I can move all my schedule entries back into a single calendar with HA showing each type of event split into each’s own entity/calendar.
Since reinstating the file, I now get an error pop-up when running the command either from the script or directly in Developer Tools | Services.
![image](https://user-images.githubusercontent.com/48920056/208355127-bd6f22ef-85db-4975-b124-3e33b65aa4f3.png)
If I go to Settings | Devices and manually reload the Google Calendar integration there it works fine.
### What version of Home Assistant Core has the issue?
2022.12.7
### What was the last working version of Home Assistant Core?
_No response_
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
Google Calendar
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/google/
### Diagnostics information
[home-assistant_google_2022-12-19T05-40-17.903Z.log](https://github.com/home-assistant/core/files/10256244/home-assistant_google_2022-12-19T05-40-17.903Z.log)
### Example YAML snippet
```yaml
alias: Reload Calendars
sequence:
- service: homeassistant.reload_config_entry
data: {}
target:
entity_id: calendar.schedule
mode: single
icon: mdi:calendar-today
```
```
### Anything in the logs that might be useful for us?
```txt
2022-12-19 05:31:49.979 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546983628272] Error handling message: Unknown error (unknown_error) from 192.168.0.10 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 646, in handle_execute_script
await script_obj.async_run(msg.get("variables"), context=context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1524, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 409, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 453, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1745, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1782, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 748, in admin_handler
await result
File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 262, in async_handle_reload_config_entry
raise ValueError("There were no matching config entries to reload")
ValueError: There were no matching config entries to reload
```
```
### Additional information
The error seems specific to the use of the google_calendar.yaml file
I tried with a few other calendars (same account), but got the same error each time
allenporter
(Allen Porter)
September 3, 2023, 12:12am
7
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