Calendar Event Trigger

Hi everyone,
I’m running into an issue with the calendar automation trigger in Home Assistant. My goal is to fire a reminder script a few hours before a calendar event that contains the word “trash.”
Here’s the automation I’m testing:

alias: Trigger Trash Reminder from Calendar
description: >
  Starts the trash reminder script the evening before trash day.
trigger:
  - platform: calendar
    entity_id: calendar.personal_calendar_time_flies
    event: start
    offset: "-06:00:00"
condition:
  - condition: template
    value_template: >
      {{ 'trash' in state_attr('calendar.personal_calendar_time_flies', 'message') | lower }}
action:
  - service: script.trash_reminder_script
    data:
      reminder_delay: "00:30:00"

Here is what I have tested so far:

  • If I set the offset to 0, the automation fires off.
  • If I set a negative offset (e.g. -06:00:00 or even -00:01:00), the automation never fires. Nothing shows up in the logs at the expected offset time.
  • The calendar entity itself is updating correctly — I can see the event title and start_time in Developer Tools.

Is this a known issue with negative offsets on calendar triggers? Do I need to configure something differently to make the offset fire reliably? Or is there a workaround others are using to get reminders before an event?

No, many people have negatively offset calendar triggers that work fine, including me.

Are these automations producing debug traces? If they produce a trace, then the trigger fired (or you manually ran the automation). If there are any, please download the json and share it here.

Your condition is not quite right. The state object of a calendar entity can only represent 1 event at a time. So, if you have overlapping events, a state-based condition may not actually represent the event you are interested in. The more reliable way is to use the trigger variable:

condition:
  - condition: template
    value_template: >
      {{ 'trash' in trigger.calendar_event.summary | lower }}

Thanks for the reply. I ended up going another direction with it and it is working now.