Hi, I can’t get delay to work using the if/elif code, how do I make it do the program?
I have the data
input_boolean:
delay_led_ver1
delay_led_ver2
delay_led_ver3
input_datetime: # 00:03
delay_led_ver1_off:
has_date: false
has_time: true
delay_led_ver2_off: # 00:05
has_date: false
has_time: true
delay_led_ver3_off: # 03:00
has_date: false
has_time: true
and automations
...
action:
- delay:
value_template: >
{% if is_state('input_boolean.delay_led_ver1', 'on') %} delay_led_ver1_off
{% elif is_state('input_boolean.delay_led_ver2', 'on') %} delay_led_ver2_off
{% elif is_state('input_boolean.delay_led_ver1', 'on') %} delay_led_ver3_off
{% else %}
{% endif %}
- service: switch.turn_off
data:
entity_id: switch.relay_led_faza1
- service: switch.turn_off
data:
entity_id: switch.relay_led_faza2