[solved] Automation w/ 'trigger.calendar_event.summary' & 'trigger.calendar_event.start' as a condition

I’m trying to build an automation that checks a calendar and set an alarm on Android (through the mobile app).

This template condition works:

{{ 'Job 1' in trigger.calendar_event.summary }}

Additionally, there are 2 different start times which I’m trying to distinguish with:

{{ trigger.calendar_event.start == '2024-10-09 20:00:00' }}

That’s the way I see the start time in the Developer tools for this entry.

Also, instead of the current day/date, I would like to use the next upcoming day.
I have gone through many examples and the docs but cannot get it right… :blush:

Setting the alarm action on Android already works! :upside_down_face:

TIA!

Post the Calendar Trigger you’re using.

Hi Taras, thanks for picking this up!

trigger: calendar
entity_id: calendar.personal
event: start
offset: "0:24:0"

This checks if the time (specifically the hour) is seven or twenty.

{{ (trigger.calendar_event.start | as_datetime | as_local).hour in [7, 20] }}

If I understood the documentation, if you want the Calendar Trigger to trigger 24 hours before the scheduled times (i.e. 24 hours before 7 and 20) you should use a negative offset of 24 hours.

offset: "-24:00:00"
1 Like

Thank you, this works as expected.
I’m still in doubt whether the trigger is what I want.

Let me explain: my goal is to use the entries in the calendar as starting point so I don’t have to look after setting the alarm (because of non-consistent schedule), after looking at the calendar first (which always has my schedule) and not forgetting to set the alarm.
Aside from the alarm function on the tablet, TTS is used on a media player (it has happened that the alarm on the tablet didn’t go off)
OTH: I have noticed in this process that whatever has been set before (alarm on/off, deleted, I can add multiple triggers with different intervals and still the alarm would be set)

Maybe I’m looking at it the wrong way and not rely the TTS ‘alarm’ on the tablet… :thinking:

Taking some distance/timeout from this made me realize that I can simply use a trigger on the start time of the event as the alarm on the media player! :upside_down_face: :blush:

You’re right, I knew that but my example didn’t match the requirements anymore since I had been testing & changing this value.

Thanks a LOT Taras! :bowing_man:

1 Like