Automation: HA unable to detect data_template in automation.yaml

Hi all,

I am trying to include some delay into my automation.yaml file, with correct indentation, as per pictures below:
code

However, after I added dash (-) for both my delay and service template in the file.

HA automatically commented my data_template section, which is originally running without any issues.

So, how should I include delay in this case? As delay must added with dash (-) according to a lot of online tutorials.

I just want to add simple delay in my automation file.

Thanks.

- delay:
    milliseconds: 500

Note the indentation and spelling. As per the third and fourth examples here: https://www.home-assistant.io/docs/scripts/#delay

Also in future:

3 Likes

Hi Tom,

It solves my problem.

Thanks for the help.

1 Like