Hello all…
Actually I just need a very simple if syntax in a script (as seen here in documentation), but somehow it doesn’t work in general (not only because of a wrong condition). And somehow my impression is that an if-else is declared differently everywhere in YAML. Anyway, I’ve lost track and would be very happy if someone could take a look at it:
script_sequence_on:
sequence:
# =============== RELAY 1
- if
condition: state
entity_id: zone.home
state: states('input_number.input_for_relay_1 > 0
- then
- type: turn_on
entity_id: switch.relay_1
domain: switch
- delay:
minutes: "{{ states('input_number.input_for_relay_1') | int }}"
- type: turn_off
entity_id: switch.relay_1
domain: switch
- delay: '00:00:03'
# =============== RELAY 2
# same if-condition her for relay 2
- type: turn_on
entity_id: switch.relay_2
domain: switch
- delay:
minutes: "{{ states('input_number.input_for_relay_2') | int }}"
- type: turn_off
entity_id: switch.relay_2
domain: switch
- delay: '00:00:03'
mode: single
Thank you
Hannah