Hi all,
Consider the following script, for some reason the script engine says data_template
is an invalid key.
I’ve also tried several other combinations like using data
instead of data_template
with no luck.
Any help would be greatly appreciated.
toggle_irrigation:
fields:
main_switch:
description: 'The switch used to to turn on/off'
example: 'switch.sonoff_s20_02'
alternate_switch:
description: 'The switch we make sure is turned off'
example: 'switch.sonoff_s20_05'
mode:
description: 'Is it turning on or off the irrigation'
example: 'turn_on'
sequence:
- wait_for_trigger:
- platform: state
data_template:
entity_id: "{{ main_switch }}"
to: 'off'
timeout:
minutes: 5
continue_on_timeout: true
- wait_for_trigger:
- platform: state
data_template:
entity_id: "{{ alternate_switch }}"
to: 'off'
timeout:
seconds: 30
continue_on_timeout: false
- service: switch.turn_on
data:
entity_id: "{{ main_switch }}"
- wait_for_trigger:
- platform: state
data_template:
entity_id: '{{ main_switch }}'
to: 'on'
timeout:
seconds: 30
continue_on_timeout: true
- delay: 00:00:10
- service: switch.turn_off
data:
entity_id: '{{ main_switch }}'
- wait_for_trigger:
- platform: state
data_template:
entity_id: '{{ main_switch }}'
to: 'off'
timeout:
seconds: 30
continue_on_timeout: true
- service: >-
input_boolean.{{ mode }}
entity_id: input_boolean.irrigation_state