I created a template in my configuration.yaml file, but I am now getting errors about syntax. The template is designed to trigger an event at a random time between 11:15pm and 11:50pm. The error I get is “string does not match the pattern of legacy syntax” on the two platform lines. Can someone assist with correcting the error:
template:
- trigger:
- platform: time
at: '23:00:00'
- platform: event
event_type: event_template_reloaded
sensor:
- name: Random Start Time between 23h15 and 23h50
unique_id: 'midnight_actions-random_time'
state: "{{ (today_at('23:15:00') + timedelta(minutes = range(0,36) | random)).isoformat() }}"
device_class: timestamp