I am trying to pass the entity_id and the duration of the delay as variables from an automation to a script:
The automation…
trigger:
platform: state
entity_id: light.level_9
from: 'off'
to: 'on'
action:
- service: script.light_timer
data:
entity: 'light.level_9'
delay_mins: '15'
The script…
alias: "Light timer"
sequence:
- delay:
data_template:
minutes: "{{ delay_mins }}"
- service: light.turn_off
data_template:
entity_id: "{{ entity }}"
YAMLlint tells me the syntax is ok.
However Check Config includes:
2018-03-01 22:03:30 ERROR (MainThread) [homeassistant.config] Invalid config for [script]: [delay] is an invalid option for [script]. Check: script->script->light_timer->sequence->0->delay. (See /home/homeassistant/.homeassistant/configuration.yaml, line 75). Please check the docs at https://home-assistant.io/components/script/
Check Config says OK if I comment out the three lines in the script:
alias: "Light timer"
sequence:
# - delay:
# data_template:
# minutes: "{{ delay_mins }}"
- service: light.turn_off
data_template:
entity_id: "{{ entity }}"
Any help much appreciated.