Notifications: Include Trigger in Message?

Let’s say I want to monitor 6 switches and I want to get notifications whenever one of those changes its status (from on to off OR from off to on). Also, I just want to use only one notification automation. The Notifications should look like this: “Switch 1 turned off.” or “Switch 5 turned on.”

How can this be achieved? I need to code the msg in a way that it only includes the switch that triggered the automation. Is this possible, or do I need 6 automations for this purpose?

message: "{{ trigger.to_state.name }}" turned "{{ trigger.to_state.state }}."
1 Like