Hello, I make my first script and get a error. Maybe you can help? Thanks.
Post it as correctly-formatted code — no-one wants to read a screenshot.
That appears to be a collection of automations, with a wrongly indented delay:
section near the start.
It’s a good idea to give your automations an id
so that you can use the debugging trace tool.
- The screenshot you posted contains automations, not scripts.
- The first automation is incorrect. The entire block in red (see below) contains indentation and syntax errors.
- The first and last service calls (
scene.turn_on
) aren’t hyphenated. Multiple actions require hyphens. - The
delay
action is hyphenated but improperly indented.
Where are these automations located?
Are they in the configuration.yaml
file? The line numbers in your screenshot have low numbers which suggest this is not in the configuration.yaml
file. Is that a screenshot of the automations.yaml
file or somewhere else? If they’re in a separate file then the first line should not contain the automation:
key word.
For future reference: