How and where did you put the script? Did you use the script UI? If not I would advise to do so. It helps you a lot. Then you can learn from the yaml it produces.
I raw code almost everything…it’s my learning process. As far as where I put it, I did that code in the yaml editor within scripts settings. I think I figured it out (with the help of ChatGPT) but trying to finalize now.
The script editor knows for sure what goes where, chatgpt is just guessing. Neither is you coding, and only one of those helping hands is giving you correct yaml. So if you want to learn from anything, … you know my advice.
But inside scripts.yaml there should no longer be script: on top. That is already done in configuration.yaml.
The editor in developer tools is a subset of the automation/script editor. The developer tools just uses the action part for one single action, but it cant do building blocks, compound statements, conditions or triggers.
There’s nothing wrong with manual coding if you know what goes where. I do it a lot too. The automation editor can teach you the structure when in doubt. Just switch to raw mode afterward and see what it produced.