#I'm banging my head over the wall, can't find my mistake in this automation.
1 messages · Page 1 of 1 (latest)
I keep getting the error message: Message malformed: required key not provided @ data['actions']
at the top, maybe around ln 20 you have action:, should it be actions: ?
I did try it, not working
What version of HA are you running?
2024.11
I mean the error is saying it's looking for actions, and the code you posted doesn't have actions, so that makes sense
if you tried it with actions, presumably you got a different error message then?
Same error message with actions:
Message malformed: required key not provided @ data['actions']
Can you post the automation using dpaste.org instead?
I'm assuming you've never opened this in the UI, yeah?
No, there are too many options and actions involved, I did not built it in UI
Interesting... the only other thing that stands out is triggers: is missing.
your final choose block has yaml errors
the default sections are indented by two spaces too much
I think that's throwing off the whole thing
lines 300 and 327
You are correct! I needed a wizard to see clearly! Thanks! I can now save it and I will test that damn long automation!
sorry about the actions thing, I think I forgot it auto-migrates action to actions for backward compatibility
That's why I asked about opening in the UI. I do that sometimes on larger, older automations as it will translate and format.
Oh wow. so the yaml parser we have generates a nice error message with the exact line number and that the indentation is bad.
And we just throw it away 😅
lol yup
But... the new indentation guides in the yaml editor can at least lead you close to where the problem is.
improved for the future: https://github.com/home-assistant/frontend/pull/22753
ok that's kind of hilarious... error messages based on last text that correctly parsed as yaml
does the same issue come up with the "check configuration" button? because i've had some very... less than helpful error messages from that
Technically no, but that’s pretty unmanageable. You’d be much better off migrating parts of it to scripts and calling those.
Ok, Thanks, I'll do it. But I had some device_ids and user_ids I wanted to retrieve before sorting and cleaning up the code. At the moment HA cannot handle such a large automation like this.
I didn’t look too closely, but I will say that my largest script is around 700 lines, but it’s also got a bunch of smaller scripts that it calls as well.
But, HA choking on that automation is an indicator it needs to be broken up for sure. If you can avoid using device_ids, I would. They are subject to change if you remove/readd a device and will cause issues for you.
To make it short, that automation aims at using NFC tags on 7 different large freezers. I want the automation to pop a notification asking which of 5 products is targeted, how many boxes, and is it an ADD or REMOVE request. Basically this automation intends to manage my inventory by easy tag scans.
It was working flawlessly with one single user, but if I want 2 users the automation needs to know which notification service to use.
Ok. I can take a closer look tonight and make some suggestions on how to knock it down a little if you want? You seem pretty capable though. But either way, I would try to reduce that down as much as you can.