I have a different use case compared to most of you above, and this is how I worked around this issue and it is working perfectly now.
To track the state of a clothes dryer for instance… I have a plug that monitors power and an input_boolean to monitor the reminder state.
When dryer goes from on to off, set reminder state to true for the dryer and send an initial notification. After that, every 30 minutes as long as the dryer reminder is on, keep sending notifications (unless it is after bedtime, then halt until we wake up and resume again).
This also helps resolve the issue of persistent notifications not actually being… well, persistent. I have another automation that restores persistent notifications after a restart by looking to see if any of the *_reminder booleans are turned on, and recreates the notifications if they are.
Where I was using the persistent notification state was in a trigger to dismiss and turn off the notification reminders. Basically…
alias: Helper - Dryer Reminder Acknowledged
description: "Stop reminding once notification is dismissed."
trigger:
- platform: state
entity_id:
- persistent_notification.dryer_reminder
from: notifying
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.dryer_notification
mode: single
I am now using a trigger combined with a condition…
alias: Helper - Dryer Reminder Acknowledged
description: "Stop reminding once notification is dismissed."
trigger:
- platform: event
event_type: call_service
event_data:
domain: persistent_notification
service: dismiss
condition:
- condition: template
value_template: "{{ 'dryer_reminder' in trigger.event.data.service_data.notification_id }}"
action:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.dryer_notification
mode: single
I am working to make notification names and helpers have the same naming scheme so I can template and have one reminder acknowledged for every single reminder I use. So this has a lot of room for improvement.
As a note, I use automation helpers to dismiss the notifications when tags are scanned, buttons are pressed, other actions are performed etc but they ALL hinge around persistent notifications existing or not.