Hello, when I have an array with light1 and light2 and when I have a state change in my automation, I want to send a message to my mobile phone which light changed the state. I dont know how to handle with the array at “target” and “data” area (see entity_id: switch. and message: “<LIGHT 1 OR LIGHT2> blub”)
trigger:
- platform: state
entity_id: [switch.light1, switch.light2]
from: "off"
to: "on"
action:
- service: [ .... ]
target:
entity_id: switch.<WHICH LIGHT GOES ON OR OFF>
- service: notify.mobile
data:
message: "<LIGHT 1 OR LIGHT2> blub"
{{ trigger.entity_id }} = the entity which triggered your automation {{ trigger.to_state.name }} = the frontend name of the entity that triggered your automation, entity’s state changed to on = to_state