I have a schedule in Google Calendars and I have got it to sync with HA and operate various entitys, however what I want it to do is only operate when ALL events are done with in my calendar,
My diary works like 2 hours event then 15mins break.
I would like to set this up so that my heating comes on automatically 30 mins before my last appointment finishes if this is possible…
I think the challenge will be that HA only holds the next event, and 30 mins before each event finishes the event would still show up as the next event. If you were automating 30 mins AFTER the end, then if it’s the last for the day, any next event would not be on the same day, which you could test for.
If you’re using Node Red, the default node there has the same behaviour. However, there is a node-red-contrib-google node that can find specific events that would be useful. It looks like it just passes the JSON input to the Google Calendar API. Therefore, you could trigger a Node Red flow 30 minutes before EVERY event, and in the flow use this node to check if there are any other events for the day. Something along the lines of:
Where you’d have to set and as appropriate. If no events are returned, this must be the last one for the day, so turn the heater on. Note that I don’t really know what happens when an event is in progress - it might get returned too, in which case you would need maxResults of 2, and if only 1 result was returned, it’s the last for the day. I have not tried this node, so good luck!