Integrations

Calendar

Spook adds actions to find, change and delete calendar events from automations, by a search or by their title.

The calendar integration brings calendars into Home Assistant: a local calendar, CalDAV, Google Calendar, and more.

An automation can put an event in a calendar with calendar.create_event, and that is where it ends. Calendars that can delete an event do so only when asked from the calendar panel. Spook adds the actions to change an event, and to take it out again.

Spook finds events the way an automation can: by their title, in a stretch of time. No need to know an event's hidden identifier first. And when you want that identifier after all, Spook finds it for you.

Actions

Spook adds three actions for calendars. You find them wherever you add an action, marked with a 👻.

They work as a family: find an event first, then change or delete exactly that one.

Find events

Finds events in calendars, by text in their title, description or place, and hands them back with their uid: the identifier update event and delete event take to know which event you mean.

Home Assistant's own calendar.get_events lists what is in a stretch of time, and leaves the uid out. That is fine for reading your agenda aloud, but not for changing one event in it. Is the bin collection moved to tomorrow? Find the bin day event, and move that one. Two events with the same title are no longer a guess.

The search finds its text anywhere in the title, the description or the place, without minding capitals: bins finds "Put the BINS out". The text is one piece: bin day finds "Bin day (green)", not "Bin collection day". Leave the search out, and every event in the stretch of time is found, uid and all.

How to use it

  1. Open the automation or script that should find the events, and select Add action.
  2. Search for find events, and select Calendar: Find events 👻.
  3. Under Targets, choose the calendars to look in.
  4. Fill in Search with the text to look for, like bins.
  5. Leave Duration empty to look a week ahead, or set how far to look.
  6. Under Response variable, give the events a name, like found. The steps after this one can use it.
  7. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

Delete event

Deletes events from a calendar, found by their title in a stretch of time.

An automation can put an event in a calendar, and Home Assistant leaves it at that. The reminder to take the bins out stays there after the bins went out, and the "guests arriving" event stays after the visit got cancelled. This action lets the automation clean up after itself.

When nothing matches, nothing happens. That is on purpose: "delete it if it is there" is what an automation tidying up needs.

How to use it

  1. Open the automation or script that should delete the event, and select Add action.
  2. Search for delete event, and select Calendar: Delete event 👻.
  3. Under Targets, choose the calendar.
  4. Fill in Summary with the title of the event, exactly as it is in the calendar.
  5. Set Duration to how far ahead to look, like 24 hours. Spook looks from now, unless you set Start date and time.
  6. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

The Actions tool with Delete event 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Update event

Changes events in a calendar, found by their title in a stretch of time: a new title, a new place, or new times.

Plans move. The dentist runs late, or the barbecue gets pushed back an hour because of rain. An automation that knows can now change the event, so you do not have to open the calendar app.

How to use it

  1. Open the automation or script that should change the event, and select Add action.
  2. Search for update event, and select Calendar: Update event 👻.
  3. Under Targets, choose the calendar.
  4. Fill in Summary with the title of the event, exactly as it is in the calendar, and set Duration to how far ahead to look.
  5. Fill in what should change: a New summary, a Description, a Location, a New start or New end, or a Shift to move it later (or earlier, with a negative time).
  6. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

The Actions tool with Update event 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Missing something here?

An action, an entity or a repair this integration should have? Say so. Stuck, or found a bug? There is help.