I'm trying to build a couple of automations that need to be able to trigger on user defined pre and post offsets to a calendar event.
Unfortunately everytime I try to use trigger_variables with the calendar trigger type I get format errors for the offset definition like:
offset {{ pre_offset }} should be format 'HH:MM', 'HH:MM:SS' or 'HH:MM:SS.F' for dictionary value @ data['offset']. Got None
I've tried the following form of the blueprint setup. NOTE I've validated that the formating string I'm creating works correctly in the dev tools template editor
blueprint:
name: Testing
domain: automation
input:
test_calendar:
name: Test Calendar
selector:
domain: calendar
pre_offset:
name: Pre-event offset
default: 0
selector:
number:
min: 0
max: 30
unit_of_measurement: hours
post_offset:
name: Post-event offset
default: 0
selector:
number:
min: 0
max: 30
unit_of_measurement: hours
mode: restart
trigger_variables:
input_pre_offset: !input pre_offset
input_post_offset: !input post_offset
pre_offset: "-{{ '{:02d}'.format(input_pre_trip_offset) }}:00:00"
post_offset: "{{ '{:02d}'.format(input_post_trip_offset) }}:00:00"
triggers:
- trigger: calendar
entity_id: !input test_calendar
event: start
offset: "{{ pre_offset }}"
id: pre_event
- trigger: calendar
entity_id: !input test_calendar
event: end
offset: "{{ post_offset }}"
id: post_event
If I have to use a template trigger, then how would I go about this? I'm not certain how I would create the appropriate template trigger to trigger on a calendar event with offsets without using the calendar trigger type itself.