Event scheduling

It would be bloody nice if someone finished the calendar trigger in automations to be able to select an event from within the trigger. Currently you can select the calendar to use but that is it. only able to select start or end (for which event?), offset or before or after, NOT WHICH ONE?

YES… please

The calendar automation examples show how to match entity names Calendar - Home Assistant – though would be nice to use the UI directly which i’ve been thinking about.

Do you mean this recipe?
Example: Calendar Event Light Schedule
I wish that was more visible, because it was very very hard for me to figure out how to do it.

I think the title of this feature request is not accurate, and makes it very hard to find. I was looking for “trigger calendar event name” or something like this, and this is not even in the top 10 results.

This is what I do not understand…
In my Dashboard I have a card with entities and these entities are the various Google Calendars that I have. The result is that it displays all my events (all-day and time specific) day by day.
This means for me that HA “sees” all these events but while I can use the all-day events in an automation, I have not found a way to do that with time-specific events.

These automation recipes Calendar - Home Assistant work for both all day or specific timed events. Using entity state approaches may be inconsistent as mentioned in the automation section.

It’s described both on the calendar integration page (the one we’re discussing here) as well as the calendar trigger page Calendar - Home Assistant under The title or summary of the calendar event. For what it’s worth “summary” is the name of the field in the home assistant UI.

Yes, I saw them. I just think they are too hidden Thanks for taking the time to make sure you point me to the right example though

Thanks so much. This does indeed add several additional usages of the Calendar Integration.
I don’t think that my objective can be achieved as what I was looking for is creating an Automation based on a keyword in the title of an event.
Let’s say that I have an event at 8 pm with title ‘Bowling’ and I would like a persistent message 30 minutes before the start of the event.
Anyway, this is a very useful Integration that I use extensively, by having some 20 sub-calendars in my Google Calendar that with all-day events trigger HA Automations. Example, I have 4 sub-calendars with different wake-up times. On a specific day that I want to wake up at 6:30 am, I create an all-day event with the 6:30 am sub-calendar. I have created Automations for each of the 4 wake-up sub-calendars that trigger a wake-up script.

Do you mean something like this?

It looks at my calendar, and one hour before each event, it checks if the word ‘cleaner’ is in the event title.

alias: Cleaner Mode - On
description: "Turn on cleaner mode one hour before cleaners are expected."
mode: single
triggers:
  - event: start
    offset: "-1:0:0"
    entity_id: calendar.YOUR_CALENDAR_NAME
    trigger: calendar
conditions:
  - condition: template
    value_template: "{{ 'cleaner' in trigger.calendar_event.summary.lower() }}"
actions:
  - action: input_boolean.turn_on
    target:
      entity_id: input_boolean.mode_cleaner

To adjust it for your bowling example:

alias: Bowling notification
description: "Reminder about bowling"
mode: single
triggers:
  - event: start
    offset: "-0:30:0"
    entity_id: calendar.YOUR_CALENDAR_NAME
    trigger: calendar
conditions:
  - condition: template
    value_template: "{{ 'bowling' in trigger.calendar_event.summary.lower() }}"
actions:
  - YOUR NOTIFICATION ACTION GOES HERE
1 Like

Amazing… I’ll try this out.

Thanks

So far I have never worked with Templates. Am I supposed to create a Template to make this automation work ?

Templates are very helpful, but they took me a while to get my head around.

What you are referring to is a template sensor, which is used to hold or calculate the state of something overtime. In this case, the template will evaluate when the trigger occurs, no need to create a template sensor.

Check out this page for a list of other options you could use in this automation.

For example, you can use:

  • trigger.calendar_event.all_day to check if the event that triggered the automation is an all day event.
  • trigger.calendar_event.location to check the location of the event. I use this in combination with the trigger.calendar_event.summary (used above) to check if a ‘Haircut’ event is for myself or for my wife.

Something to note when trying to troubleshoot automations based on calendar events is that Home Assistant only reloads the calendar events every 15 minutes or so. Adding an event to your calendar in three minutes to test the automation usually doesn’t work because HA doesn’t see that new event.

2 Likes