#Every example from documentation gives an error

1 messages · Page 1 of 1 (latest)

livid briar
#

Hi, I installed Home Assistant 2 hours ago and I'm willing to try to send notifications to my phone when I ring the bell. No matter which example I pick from the docs, I get the error "Message malformed: Unable to determine action @ data['actions'][0]"

Here is my automation, which is literally the first example in the docs (https://companion.home-assistant.io/docs/notifications/notifications-basic)

  - alias: 'Send Notification'
    trigger:
      ...
    action:
      - action: notify.mobile_app_cellulaire_de_theo
        data:
          message: "Notification text"```

Thanks a lot
rigid turtle
#

Where have you put this, in the ui?

livid briar
rigid turtle
#

Well... Yeah, that's wrong

livid briar
#

Am I at the wrong place ? 🤣

#

Oh ok haha

rigid turtle
#

If you delete everything except the last 3 lines (the second action onwards)

#

Then delete the "-" and all the spaces before those lines

#

And then 2 spaces to indent the final line

fading thicket
#

The action box expects just one single action

action: notify.mobile_app_cellulaire_de_theo
data:
  message: "Notification text"
livid briar
fading thicket
#

The YAML in the docs is what you'd use if you wrote it directly into configuration.yaml, which you're not doing (and shouldn't do)

livid briar
#

Oh ok ! Is there another page in the docs where I can understand how everything works more properly ? 😅

fading thicket
#

Well, not really

#

(it's a very yes but no situation)

rigid turtle
#

The general automations pages explain it better

#

But still not great

fading thicket
#

The problem is that the docs don't really explain how the automation editor itself works, which is where you went "wrong" (but not really wrong)

#

What you can do is just avoid the YAML view in the automation editor and build things purely in the UI - and then look at the YAML it creates to learn what the editor does

rigid turtle
#

Or vice versa, copy some yaml into the yaml view (for the whole automation, not just actions like you were doing - accessible from the top right menu) and then look at the ui version it corresponds to

fading thicket
#

Just remember to remove the initial automation: line

#

(plus the - on the first line, and the other "stray" spaces)

hexed geodeBOT
#

YAML is the mark up language used by Home Assistant, consistent indenting (two spaces per level) is key. Here is a primer, and this explains multi-line templates. For validating YAML see YAML Lint.

fading thicket
#

YAML is something you absolutely need to learn ☝️

#

Otherwise you're gonna get pissed off very fast