I have a date time helper (input_datetime.return_from_holiday) I want to create an automation that creates an event in the Holiday calendar 1 day before we arrive home (which another automation will run when the event starts which will then automate a few things around the house in prep for arriving home) But this isn’t working. I’ve checked these forums and tried various suggestions but none work. What am I missing?
alias: CREATE Return Home Event
description: ""
triggers:
- trigger: state
entity_id:
- input_datetime.return_from_holiday
conditions: []
actions:
- data:
start_date_time: "{{ (states('input_datetime.return_from_holiday') - timesdelta(days=1)).strftime('%Y-%m-%d %H:%M:%S') }}"
end_date_time: "{{ (states('input_datetime.return_from_holiday')).strftime('%Y-%m-%d %H:%M:%S') }}"
action: calendar.create_event
target:
entity_id: calendar.holiday
mode: single