It looks like there is no event fired on this notification.
Don’t know if this is a bug or intended.
This should work:
automation:
- alias: persistent_notification_dismiss_http_login
trigger:
- platform: event
event_type: state_changed
event_data:
entity_id: persistent_notification.http_login
old_state: null
condition:
- condition: template
value_template: >
{{ 'hostname_or_ip' in trigger.event.data.new_state.attributes.message }}
action:
- service: persistent_notification.dismiss
data:
notification_id: http_login
In the condition you can filter for only certain clients.