---
title: "Calendar"
description: "Spook adds actions to find, change and delete calendar events from automations, by a search or by their title."
canonical_url: "https://spook.boo/calendar"
---
# 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](#update-event) and [delete event](#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](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.find_events) opens it in your Home Assistant, ready to run once.

**Technical details**

| Action properties |
| --- |
| Action | Calendar: Find events 👻 |
| Action name | `calendar.find_events` |
| Action targets | Yes, `calendar` entities |
| Action response | Yes, the events found in every calendar in the target |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.find_events) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.find_events) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `search` | string | No | `bins` |
| `start_date_time` | datetime | No | Now |
| `end_date_time` | datetime | No | A week after the start |
| `duration` | time period | No | `{"days": 7}` |

Events are looked for from `start_date_time`, which is now when you leave it out, until `end_date_time` or for `duration`, the same way `calendar.get_events` reads them. Without either, Spook looks a week ahead. A year is the most it looks at once: a calendar works out every occurrence of a repeating event in the window, and a daily one is already 366 events in a year.

The response holds the events found in each calendar, under its entity ID, soonest first. Each event has the fields `calendar.get_events` gives, made the same way, so a template written for one reads the other. Fields an event does not have, like a place, are left out, the same as there.

| **Attribute** | **Type** | **Description** |
| --- | --- | --- |
| `summary` | string | The title. |
| `start` | string | When it starts: a date and time, or a date alone for an event that lasts whole days. |
| `end` | string | When it ends, the same way. The end itself is not part of the event. |
| `description` | string | The description, when it has one. |
| `location` | string | The place, when it has one. |
| `uid` | string or `null` | The identifier of the event, to change or delete it with. `null` for a calendar that gives none. |
| `recurrence_id` | string or `null` | For one occurrence of a repeating event, which one it is. `null` for an event that does not repeat. |
| `rrule` | string or `null` | How the event repeats, like `FREQ=WEEKLY`. `null` when the calendar does not say. |
| `all_day` | boolean | Whether the event lasts whole days. |

A repeating event is found occurrence by occurrence. Every occurrence has the same uid, and its own `recurrence_id`. [Update event](#update-event) and [delete event](#delete-event) find an event by its uid inside their window, so a uid alone changes or deletes every occurrence in that window. To change or delete one occurrence, give them its uid and its `recurrence_id`, with a window that holds it, like its `start` as `start_date_time`.

Changing what you find takes a calendar that can. Of the calendars Home Assistant ships, Local Calendar can change and delete events, Google Calendar can delete them but not change them, and CalDAV can do neither. Other integrations differ: a calendar that cannot is refused by update event or delete event, with an error that says so.

**Example actions in YAML**

The bin collection moved a day because of a holiday. Find the next bin day event in a Local Calendar, and move it a day with [update event](#update-event):

```yaml
actions:
  - action: calendar.find_events
    target:
      entity_id: calendar.family
    data:
      search: bin day
    response_variable: found
  - variables:
      bin_day: "{{ found['calendar.family'].events | first | default(none) }}"
  - condition: template
    value_template: "{{ bin_day is not none and bin_day.uid is not none }}"
  - action: calendar.update_event
    target:
      entity_id: calendar.family
    data:
      uid: "{{ bin_day.uid }}"
      recurrence_id: "{{ bin_day.recurrence_id }}"
      start_date_time: "{{ bin_day.start }}"
      duration:
        minutes: 1
      shift:
        days: 1
```

The window of `calendar.update_event` starts where the bin day does. A bin day that repeats every week has the same uid every week: its `recurrence_id` says which week. For a bin day that does not repeat, it is empty, and the uid alone does it.

Delete every event with "Holiday cover" in its title, in the work calendar, for the next year, one at a time with [delete event](#delete-event). The search also finds the text in a description or a place, so the events are narrowed to the ones with it in their title first. This works with a Local Calendar and with Google Calendar:

```yaml
actions:
  - action: calendar.find_events
    target:
      entity_id: calendar.work
    data:
      search: holiday cover
      duration:
        days: 365
    response_variable: found
  - repeat:
      for_each: >-
        {{ found['calendar.work'].events
           | selectattr('uid', 'string')
           | selectattr('summary', 'search', 'holiday cover', true)
           | list }}
      sequence:
        - action: calendar.delete_event
          target:
            entity_id: calendar.work
          data:
            uid: "{{ repeat.item.uid }}"
            recurrence_id: "{{ repeat.item.recurrence_id }}"
            start_date_time: "{{ repeat.item.start }}"
            duration:
              minutes: 1
```

**Known limitations**

- A year is the most it looks at once. Look further in more than one go.
- The search is plain text, not a pattern: no wildcards, and the words of a search are found together, in that order.
- A calendar that gives its events no uid, like some feeds, hands them back with `uid` set to `null`. Those events can be read, not changed by uid.
- A calendar that is unavailable is passed over, and is not in the response.

### 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](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.delete_event) opens it in your Home Assistant, ready to run once.

![The Actions tool with Delete event 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-calendar-delete-event.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Calendar: Delete event 👻 |
| Action name | `calendar.delete_event` |
| Action targets | Yes, `calendar` entities that can delete events |
| Action response | Optional, the events deleted |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.delete_event) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.delete_event) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `summary` | string | No, but this or `uid` | Dentist |
| `uid` | string | No, but this or `summary` |  |
| `recurrence_id` | string | No |  |
| `start_date_time` | datetime | No | Now |
| `end_date_time` | datetime | No, but this or `duration` | 2026-10-04 20:00:00 |
| `duration` | time period | No, but this or `end_date_time` | `{"hours": 24}` |
| `whole_series` | boolean | No | `false` |

Calendars delete an event by its uid, and `calendar.get_events` leaves that out of what it returns. That is why Spook finds events by their title instead, or by a `uid` when you do have one. [Find events](#find-events) gets you that uid. Some calendars give their events none: find events hands those back with `uid` set to `null`, and they cannot be deleted by uid.

Events are looked for from `start_date_time`, which is now when you leave it out, until `end_date_time` or for `duration`, the same way `calendar.get_events` reads them. Every event in that stretch with exactly that `summary`, or that `uid`, or both, is deleted.

An event that repeats is found occurrence by occurrence, and only the occurrences found are deleted. Every occurrence has the same uid, so give its `recurrence_id` as well to delete one occurrence. Set `whole_series` to delete the whole series instead.

The response lists every event deleted, for each calendar, with its `uid`, `recurrence_id`, `summary`, `start` and `end`.

**Example actions in YAML**

Take out the reminder an automation put in earlier today:

```yaml
action: calendar.delete_event
target:
  entity_id: calendar.family
data:
  summary: Take the bins out
  duration:
    hours: 24
```

**Known limitations**

- A `summary` or a `uid` is required. A stretch of time alone would delete everything in it. That is how a calendar gets emptied by accident.
- The title has to match exactly, including capitals.
- Only calendars that can delete events can be targeted. A read-only calendar, like a holiday feed, refuses the action.
- An event the calendar gives no uid cannot be told apart from any other, so it is left alone.

### 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](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.update_event) opens it in your Home Assistant, ready to run once.

![The Actions tool with Update event 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-calendar-update-event.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Calendar: Update event 👻 |
| Action name | `calendar.update_event` |
| Action targets | Yes, `calendar` entities that can change events |
| Action response | Optional, the events changed |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.update_event) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=calendar.update_event) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `summary` | string | No, but this or `uid` | Dentist |
| `uid` | string | No, but this or `summary` |  |
| `recurrence_id` | string | No |  |
| `start_date_time` | datetime | No | Now |
| `end_date_time` | datetime | No, but this or `duration` | 2026-10-04 20:00:00 |
| `duration` | time period | No, but this or `end_date_time` | `{"hours": 24}` |
| `new_summary` | string | No | Orthodontist |
| `description` | string | No |  |
| `location` | string | No |  |
| `new_start` | datetime | No | 2026-10-04 15:00:00 |
| `new_end` | datetime | No | 2026-10-04 16:30:00 |
| `shift` | time period | No | `{"hours": -1}` |

Events are found exactly the way [delete event](#delete-event) finds them, a `recurrence_id` included. Every event found gets the changes you ask for, and keeps everything else it had: Home Assistant hands the calendar a whole event to update, so Spook carries over what you did not change.

To move an event, give it a `new_start`, and it keeps its length, or a `new_start` and a `new_end`, or a `new_end` alone to make it longer or shorter. Or move it by a `shift`, later, or earlier when negative. A time written without a time zone is read as Home Assistant's own.

The response lists every event changed, for each calendar, with its `uid` and its new `summary`, `start` and `end`.

**Example actions in YAML**

The dentist runs late again, so move today's appointment an hour on:

```yaml
action: calendar.update_event
target:
  entity_id: calendar.family
data:
  summary: Dentist
  duration:
    hours: 24
  shift:
    hours: 1
```

**Known limitations**

- Something to change is required: a new summary, description, location, or new times.
- A `shift` together with a new start or end is refused. Say how to move an event one way.
- An event that lasts whole days moves by whole days only. Shifting it by an hour is refused, so you know it did not move.
- An event of a repeating series is changed on its own, never the whole series. Changing a series means changing its first event, and the times of whichever occurrence was found would move the series start along with them.
- Only calendars that can change events can be targeted. A read-only calendar, like a holiday feed, refuses the action.
- An event the calendar gives no uid cannot be told apart from any other, so it is left alone.


## Sitemap

See the full [sitemap](https://spook.boo/sitemap.md) for all pages.
