Mi first automation

The automation you created lacks a trigger. Without a trigger, it’s a useless automation.

What was suggested was to create a script, not an automation without a trigger.

Hard to say because you posted unformatted YAML. Proper indentation is important for YAML and that’s why it must be posted with formatting. It’s explained in Guideline 11 of the forum’s FAQ.