I am trying to make an automation that triggers 1hr before any google calendar events that happen. My current code is here:
alias: Early morning - calendar
description: ''
trigger:
- platform: template
value_template: >-
{{ as_timestamp(states.calendar.my_calendar.attributes.start_time) -
as_timestamp( now() ) < 3600 }}
condition:
- condition: time
after: '04:00:00'
before: input_datetime.normal_morning_wakeup_time
action:
- service: script.do_morning_things
data: {}
mode: single
This never triggers if there’s also an all-day event on that day- because the calendar is “on” and there’s not that transition from “off” to “on”. How can I make my template trigger work for this case?