Hi all,
I would highly appreciate your support. I am trying to setup a script that follows a sequence depending on state of 1 switch I need a delay of 17 seconds. However sequence 3 and 4 do not wait for 2. Suggestions how to improve below?
I get the following notifications:
rf switch 2 toggled dishwasher
1 easyplus is off - wait
3 dishwasher off
4 dishwasher program started:
easyplus on
kitchen equipment off
2 easyplus is on - ready
This is my configuration.
script 1 to start first
#turn on easyplus script if off
easyplus_turn_on:
sequence:
- service: notify.merwone
data_template:
message: "1 easyplus is {{states.switch.easyplus.state}} - wait"
- service: switch.turn_on
entity_id: switch.easyplus
- delay:
seconds: 17
- service: notify.merwone
data_template:
message: "2 easyplus is {{states.switch.easyplus.state}} - ready"
##dummy script if easyplus already on
noop:
sequence:
- delay:
seconds: 0
- service: notify.merwone
data:
message: "noop: just checking - easyplus already on"
##check easyplus state if off turn on script triggered
easyplus_state:
sequence:
- service_template: >-
{% if is_state('switch.easyplus', 'off') %}
script.easyplus_turn_on
{% else %}
script.noop
{% endif %}
script 2
#dishwasher turn on
dishwasher_turn_on:
sequence:
- service: script.turn_off
entity_id: script.easyplus_state
- service: script.easyplus_state
- service: switch.turn_on
entity_id: switch.stp_kitchen_equipment
- service: notify.merwone
data_template:
message: '
3 dishwasher {{states.switch.stp_kitchen_equipment.state}}'