I have an input in an automation...
input:
alarm_time:
name: Alarm Time
description: Set the alarm time (when you want the light at full brightness).
selector:
entity:
filter:
- domain: input_datetime
I then have some variables and my trigger...
variables:
start_before: !input start_before
alarm_time: !input alarm_time
trigger:
- platform: template
#value_template: "{{ now().timestamp() | timestamp_custom('%H:%M') == (state_attr('input_datetime.sunrise_alarm', 'timestamp') - 1 ) | timestamp_custom('%H:%M', false) }}"
value_template: "{{ now().timestamp() | timestamp_custom('%H:%M') == state_attr(alarm_time, 'timestamp') | timestamp_custom('%H:%M', false) }}"
The commented out trigger works, but I'd like to understand why the current one does not (the difference being input_datetime.sunrise_alarm being replaced with the alarm_time variable)
I messed around in the template editor and also get errors. Could someone explain why it's not working and possibly how I would go about achieving what I want?
Thanks!