10-03-2023 11:21 AM
Trying to write my first script and everything looks good, but I have a **bleep** syntax error that i cant resolve.
what am I missing?
10-03-2023 02:08 PM
hi! If I'm not mistaken, then you just need to remove the duplicated "action" function
10-03-2023 06:30 PM
I had the same issue earlier. You can have multiple functions... that's not your problem. The problem is your indentations don't take into account for multiple functions. You have to tab indent your action block of code (actions, type, devices, on) one more indentation and you should be okay.
You can reference the examples here to see the subtle differences with tab indentations: https://developers.home.google.com/automations/example-scripts
I was working on something similar to the following when I hit your exact issue:
10-04-2023 11:57 AM
For multiple starters - actions, I'd rather to use "name" for each :
And yes, take very care of the indentation !
10-16-2023 05:23 PM
Hi,
I hope you figured it out by now and the struggle paid out.
I see two mistakes in your YAML code:
Code for computers is always a compromise between readability for humans and non-ambiguous statements for machines.
It might help you next time to use a converter like https://jsonformatter.org/yaml-to-json to check if your YAML is interpreted in the way you expect it.
Cheers!
11-23-2023 07:29 PM
Did you work this out? I'm having a similar issue