I only need the part to see if the persistent notification ist deleted. But I need to know which persistent notification is deleted. Did you know how to archieve this? All of my persistent notifications have an id.
Actually, that’s not the reason. It should work, but doesn’t because a bug was introduced a year ago when they started introducing code to track the context of events, etc. See PR #16415. The bug is on this line:
When the notification is dismissed, to_s is None, and so to_s.context causes an exception.
Here is the corresponding state_changed event (where to_s in the code corresponds to new_state in the event):
I ended up coming up with a slightly different take on this one. Basically the tack as @pnbruckner’s solution, I justed tested for an unknown state in the condition to differentiate the notification being created or dismissed. Seems to work well enough.
But this automation gets trigered every 10-20 minutes 0o I really dont understand why:o The good thing is: Its working when the correct persistent notification gets dissmissed. But its a little bit odd to get all these messages the whole day:D