Hi, I am trying to make some light wake-up automation, but I am having an issue with the transition time for which I want to use an input. Hard-coding a value works fine, but when I try to use the following the automation does not work. I have seen the same being used elsewhere so not sure why it does not work for me. Any ideas?
transition: "{{ (states.input_number.wakeup_transition.state|int) }}"
I have also tried the following without success:
transition: "{{ states('input_number.wakeup_transition')|int }}"
Full code from automation.yaml:
- alias: "Wake-Up"
trigger:
platform: template
value_template: "{{ states('sensor.time') == ((states.input_datetime.wakeup_time.attributes.timestamp - (states.input_number.wakeup_transition.state|int)) | int | timestamp_custom('%H:%M', False)) }}"
condition:
- condition: state
entity_id: input_boolean.wakeup_enabled
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: input_boolean.wakeup_weekend
state: 'on'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: light.turn_on
entity_id: light.bedroom_light
data:
transition: 30
brightness: 255