Message malformed: extra keys not allowed @ data[‘0’]['service']

if:
  - condition: state
    entity_id: binary_sensor.sensoreportaingresso_door
    state: "on"
  - condition: state
    entity_id: sensor.huawei_p20_wifi_ip_address
    state: 192.168.178.6
then: 
service: notify.alexa_media_echo_pop
data:
  message: >-
    {{ ["Bentornato Domenico", "Domenico bentornato", "ciao Domè", "bentornato a
    casa"] | random }}
enabled: true

Hi @Dommyreg

Please format your code using the code formatting option. We need to be able to see the proper spacing.

ok thanks, done.

Have you tried calling the service using Developer tools → Services?

yes it works

Do you need quotes around this, maybe?

Can you try removing each of the conditions within the ``if``` to see which one is causing the problem.

Whatever is below “then:” is a list (needs “-”) and needs to be indented

if:
  - condition: state
    entity_id: binary_sensor.sensoreportaingresso_door
    state: "on"
  - condition: state
    entity_id: sensor.huawei_p20_wifi_ip_address
    state: 192.168.178.6
then: 
  - service: notify.alexa_media_echo_pop
    data:
      message: >-
        {{ ["Bentornato Domenico", "Domenico bentornato", "ciao Domè", "bentornato a
        casa"] | random }}
2 Likes

Yes now it saved and just try. Thank you!

If you can use the UI to make your automations then you’ll avoid problems like this.

Yes already tried with UI but not works. I think the conditions are wrong

Because I want that when I’m at home and I open the door and I’m connected to the access point with 192.168.178.100 that is his static ip then alexa says a message