EDIT: PLEASE IGNORE THIS
The question still stands but my examples have too many typos to expect anyone to look into this. I am still working on it though…
=============================
Is this possible?
I want to pass a script something which is then used to build the entities on which the script acts (to reduce code duplication).
This is the calling script:
script:
run_a_cycle:
sequence:
- service: script.run_a_zone
data_template:
cycle: '{{ cycle }}'
zone: 1
This is the script it calls passing it two data elements, the switch turns on, I am having problems with the duration and hence the wait_template:
run_a_zone:
sequence:
- service: switch.turn_on
data_template:
entity_id: switch.zone_{{ zone }}_valve
# Start timer for zone duration
- service: timer.start
data_template:
entity_id: timer.cycle{{ cycle }}_irrigation_duration
duration: "00:{{ states('input_number.cycle{{ cycle }}_zone{{ zone }}_run_time')|int }}:00"
- service: persistent_notification.create
data_template:
message: duration - 00:{{ states('input_number.cycle{{ cycle }}_zone{{ zone }}_run_time')|int }}:00
- wait_template: "{{ is_state('timer.cycle{{ cycle }}_irrigation_duration', 'idle') }}"
The persistant notifications gives me,
duration - 00:0:00
The input_number the duration is supposed to represent is never zero but can be a single digit number.