diff --git a/source/_docs/automation/templating.markdown b/source/_docs/automation/templating.markdown index f23a098dcea..cc17001e7af 100644 --- a/source/_docs/automation/templating.markdown +++ b/source/_docs/automation/templating.markdown @@ -37,6 +37,8 @@ The following describes trigger data associated with all platforms. | `trigger.calendar_event.all_day` | Indicates the event spans the entire day. | | `trigger.calendar_event.description` | A detailed description of the calendar event, if available. | | `trigger.calendar_event.location` | Location information for the calendar event, if available. | +| `trigger.offset` | Timedelta object with offset to the event, if any | + ### Device | Template variable | Data | diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 083bd948fe1..5e3ac66ebb9 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -858,6 +858,8 @@ Calendar trigger fires when a [Calendar](/integrations/calendar/) event starts o much more flexible automations that using the Calendar entity state which only supports a single event start at a time. +An optional time offset can be given to have it fire a set time before or after the calendar event (e.g., 5 minutes before event start). + ```yaml automation: trigger: @@ -866,6 +868,8 @@ automation: event: start # The calendar entity_id entity_id: calendar.light_schedule + # Optional time offset + offset: "-00:05:00" ``` See the [Calendar](/integrations/calendar/) integration for more details on event triggers and the diff --git a/source/_integrations/calendar.markdown b/source/_integrations/calendar.markdown index 07313232c45..872d09e9c02 100644 --- a/source/_integrations/calendar.markdown +++ b/source/_integrations/calendar.markdown @@ -32,6 +32,8 @@ automation: event: start # The calendar entity_id entity_id: calendar.personal + # Optional time offset to fire a set time before or after event start/end + offset: -00:15:00 ``` ### Example Automation diff --git a/source/images/integrations/calendar/trigger.png b/source/images/integrations/calendar/trigger.png index c2c3c167635..56aa64e4df5 100644 Binary files a/source/images/integrations/calendar/trigger.png and b/source/images/integrations/calendar/trigger.png differ