Error on sending notification

Hey,

I have several plant sensors around my house and use the integration by Olen (GitHub - Olen/homeassistant-plant: Alternative Plant component of home assistant).
I tried to write an automation to trigger on state change of any of my plants and send a notification to my mobile with the name and state of the triggering plant:

alias: Pflanzen Gießerinnerung
description: ""
trigger:
  - platform: state
    entity_id:
      - plant.pflanze_matthias
      - plant.pflanze_flur
      - plant.pflanze_treppenhaus
      - plant.pflanze_wohnzimmer
condition: []
action:
  - service: notify.mobile_app_sm_g965f
    data:
      data: >-
        Entity:{{ trigger.from_state.name }} Zustand {{ trigger.from_state.state
        }}
mode: single

The problem is that this never sends out a notification, in traces section I only see error:

Triggered by the state of plant.pflanze_treppenhaus at 14. Dezember 2022, 10:40:47
Benachrichtigung: Send a notification via mobile_app_sm_g965f
Stopped because an error was encountered at 14. Dezember 2022, 10:40:47 (runtime: 0.01 seconds) expected dict for dictionary value @ data['data']

Does anyone knows why? I don’t see it…

Regards,
Anduril

I do mine differently, using the device and they work fine:-

action:
  - device_id: a47f7db07a4a9c7633ac807ab9d13457
    domain: mobile_app
    type: notify
    message: "Open Window Detected: Bedroom"
    title: " Tado Alert"

Try:
trigger.to_state (not from)

I think the problem is within the data section. You did not send any message. Try this one:

action:
  - service: notify.mobile_app_sm_g965f
    data:
      message: >-
        Entity:{{ trigger.from_state.name }} Zustand {{ trigger.from_state.state }}

I think you are right. I think I miss-clicked in the ui somewhere. I also had a look at other working notifications and it should be data_template:. I will have to wait for one of my plants beeing thirsty to verify.

@Heinz you are right, the difference between to and from state is essential for my usecase, but it’s not for the function of the script in general. I was aware of that before but wanted it working before finetuning the content of the message.
@Rofo this will work, but means I have to create a rule for every single plant sensor in use.