Hey there, I’m really new to Home Assistant and i cant really get my code to work. My code is suppost to turn off my light switch 5 minutes after turning on. I’d have to do it this way because the lights are controlled by multiple sensors.
Can I ask why you are trying to edit the YAML directly?
Use the UI to create scripts/automations etc. and you’ll avoid lots of these forms of issues - it looks like you have an issue with the whitespace. So I’m assuming it’s a rogue and/or missing space or tab on one of the lines?
there is nothing wrong with trying to learn the yaml coding for the automation. You just need to make sure you understand the syntax, including indentation/etc.
Also to make it easier to help you you need to post the properly formatted code in text form. that way way we don’t need to re-type everything by hand to correct the mistakes. Instead we can just copy-edit the existing code.
If you will do that I’ll show you where you went wrong.
It also looks like you are trying to create an automation, but try to execute it as a script. I also think there is an issue.
I would suggest to create the automation using the UI, and then look at the YAML editor for that. At least it will show you how the YAML code should look. But…editing and creating this automation is easier just via the UI and will also probably give you less issues.