Use a specific notification from my phone as an automation trigger

hi there,
i’ve configured the app to feed last notification which is working.

there’s a specific attribute i want to match against in my automation - Android.text

the idea being that i only want to trigger this automation when the notification is of a specific type.

any hint on how best to do this?

Thanks

You could use the Android app Tasker to detect the notification that is of interest to you via a Notification Event. Tasker is able to directly integrate with Home Assistant.

you need to use a template to match the attribute is_state_attr('sensor.name', 'attribute.name', 'expected_value')

why do that when the app does it natively https://companion.home-assistant.io/docs/core/sensors#last-notification this user is asking how to make use of this sensor.

thanks, i’ll have a look in to this - can i match against part of the attribute contents?

if the key string in the notification i’m looking for is full set, but it’s contained within a longer notification, what’s the best way to match?