#I'm banging my head over the wall, can't find my mistake in this automation.

1 messages · Page 1 of 1 (latest)

lunar plaza
#

I keep getting the error message: Message malformed: required key not provided @ data['actions']

hallow wind
#

at the top, maybe around ln 20 you have action:, should it be actions: ?

lunar plaza
#

I did try it, not working

frigid shoal
#

What version of HA are you running?

lunar plaza
#

2024.11

hallow wind
#

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?

lunar plaza
#

Same error message with actions:
Message malformed: required key not provided @ data['actions']

frigid shoal
#

Can you post the automation using dpaste.org instead?

frigid shoal
#

I'm assuming you've never opened this in the UI, yeah?

lunar plaza
#

No, there are too many options and actions involved, I did not built it in UI

frigid shoal
#

Interesting... the only other thing that stands out is triggers: is missing.

hallow wind
#

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

lunar plaza
hallow wind
#

sorry about the actions thing, I think I forgot it auto-migrates action to actions for backward compatibility

frigid shoal
#

That's why I asked about opening in the UI. I do that sometimes on larger, older automations as it will translate and format.

hallow wind
#

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 😅

frigid shoal
#

lol yup

#

But... the new indentation guides in the yaml editor can at least lead you close to where the problem is.

hallow wind
shy dome
#

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

lunar plaza
#

Is there a maximum length to au automation?

frigid shoal
#

Technically no, but that’s pretty unmanageable. You’d be much better off migrating parts of it to scripts and calling those.

lunar plaza
#

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.

frigid shoal
#

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.

lunar plaza
#

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.

frigid shoal
#

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.

lunar plaza
#

That would be much appreciated but I haven't given up on that automation. I'll be working again on it tommorow afternoon. 🙂

#

@frigid shoal Here you can see the UI for the end user in a dashboard