#Trigger when no calendar event is found

1 messages · Page 1 of 1 (latest)

knotty flicker
#

New here and trying things out! I've successfully automated waking up my kids for school (turn on lights, start music on their rooms), but instead of having to worry about disabling that automation, I'd like to create a Google Calendar with all school holidays. That way, every weekday at 6:30am if no events are found in the school holidays calendar the automation runs, otherwise if there's an event for that day (any), the automation won't run. I've read a bunch of use cases of triggers based on calendar events, but couldn't figure out a way of handling whenever no events are found for that day. Thanks in advance!

plush ginkgo
#

It really depends on how you set up the calendar events.

At the most basic you would just use calendar events that are active during the time you will be checking. Then your automation would check if the state of the calendar entity is "off".

condition: state
entity_id: calendar.school_holidays
state: "off"

As long as your calendar doesn't have overlapping events and was specific to school holidays that will work fine. If your calendar is more complicated it will require you to use the action calendar.get_events to query for events, then use templating to look for an event name, keyword, etc.

knotty flicker
#

Perfect! That should do it, I'll give it a try. I'm planning on creating a specific calendar only to add school holidays, so there's no need to dig further into the specifics of the event. As long as there's none (ie: state: "off", which is the bit I was missing), it should work.