Question regarding list of entities sorting which one was triggered

I have an automation that looks at all the Zigbee devices availability If one becomes unavailable for 30 minutes it triggers a persistent notification. Easily enough, but is there a to filter which device triggered the event so the notification can point to the exact device without having to have a separate automation for each device?

I want to be able to do a similar thing for alarm zones open, faults, batteries and tampers.

If your automation uses a State Trigger, monitoring multiple entities, you can identify which entity was responsible for triggering it using trigger.entity_id. If want the entity’s friendly name, use trigger.to_state.name.

Reference

Automation Trigger Variables

Hi @Braindrain, can you please share your YAML code for this? I’m trying to do something similar but I can’t get the automation to trigger when looking at all entities.

Thanks Taras for pointing me in the right direction. What I came up with is a bit of a compromise and still needs some work but it is based off of this thread:

So props to Masterkenobi and Markaggar for their ideas as well.

Hi Alf, I do not have a working event yet, but the link I showed there gave me some good ideas. No time to pursue this currently maybe next month. The trigger_id is the key.