'1535060106362':
alias: East Garage Door
sequence:
- service: homeassistant.turn_on
entity_id: switch.ohd_nbay_east
- delay:
milliseconds: 200
- service: homeassistant.turn_off
entity_id: switch.ohd_nbay_east
When I ran the “Update Scripts”, I was given the following error message:
Invalid config for [script]: [delay] is an invalid option for [script]. Check: script->script->1535060106362->sequence->1->delay. (See /config/configuration.yaml, line 70). Please check the docs at Scripts - Home Assistant
So I went over to the scripts documentation page, and it clearly lists that I should be able to do exactly what I showed above.
I tried an alternate method that does seem to work:
'1535060106362':
alias: East Garage Door
sequence:
- service: homeassistant.turn_on
entity_id: switch.ohd_nbay_east
- delay: 00:00:00.2
- service: homeassistant.turn_off
entity_id: switch.ohd_nbay_east
It didn’t throw any errors when I used this script instead. Has the alternate version of delay been depreciated??
I’m running hassio v0.76.2 on a Pi 3 B+ 64bit with the hassio image.
Try indenting "milliseconds under the delay key. Like so:
- delay:
milliseconds: 200
You will probably find that delays under a second or so have widely varying actual timings depending on the system load as the call to the delay routine can take up to a second. If you really need a reasonably accurate sub second delay there are horrible workarounds like this this for example: