Hi everyone. Im new to Home Assistant and im trying to write a YAML file to control my exterior lights. I want them turning on at sunset and running until 1:00 am and then I want my ring doorbell motion sensor to trun them on if any motion is detected.
Im part of the way there but im stuck with a Message malformed: extra keys not allowed @ data[‘action’][1][‘at’].
I was hoping that someone would be able to give me some pointers in my YAML below. Thankls
Your automation is incorrect. It has multiple trigger and action sections. There can only be one of each in an automation.
On a separate note, you categorized your topic as Blueprints Exchange. That’s reserved for sharing blueprints with the community and not for general questions about fixing automations. You may wish to consider changing the category to Configuration.
Thank you for the information and for your reply. Its seems that the YAML route is not as flexible as I had hoped. Ill start investigating the use of Python to accomplish my automation in one script.
You should at least try to read up in the documentation of HA…
YAML is very flexible, or better YAML for automations is. But if you don’t understand the concept behind it, I’m tempted to assume you wont get far with python either.
Thanks Taras and Patrick, I come from a C++, C#, VB and Python background so I’m trying to wrap my head around the workflows and the constraints of the YAML file’s in HASS. Ill dig into the documentation and will come back with any questions.
One mandatory trigger section that can contain multiple triggers (of all kinds such as State Trigger, Numeric State Trigger, Time Trigger, etc).
One optional condition section that can contain multiple conditions (of all kinds such as State Condition, Numeric State Condition, Time Condition, etc).
One mandatory action section that can contain service calls and execution-control statements like choose, repeat, condition, wait_template, delay, wait_for_trigger, etc.
Sometimes the best way to pick up a new language (or whatever YAML is) is to see working examples.
A good way in HA to get examples is to use the GUI to build an automation. Even if it doesn’t do everything you want, you can see the YAML that the GUI created and tweak from there.