It was not working for me either in HAOS version 2023.7.3, it might be due to newer version has different names eg: http-login instead of http_login in notification_id
Finally I made this code and it works for me:
alias: Failed Login Attempts Notification
description: Sends a notification when unauthorised login is attempted
trigger:
- platform: persistent_notification
update_type:
- added
- updated
notification_id: http-login
condition: []
action:
- service: notify.my_alert_group
data:
title: "{{ trigger.notification.title }}"
message: >-
{{ trigger.notification.message }}
data:
actions:
- action: "URI"
title: "Check IP"
uri: "https://whatismyipaddress.com/ip/{{trigger.notification.message.split('(')[1].split(')')[0]}}"
- service: persistent_notification.dismiss
data:
notification_id: http-login
- service: persistent_notification.create
data:
notification_id: custom-http-login
title: "{{ trigger.notification.title }}"
message: >-
{{ trigger.notification.message }} url:
https://whatismyipaddress.com/ip/{{
trigger.notification.message.split('(')[1].split(')')[0]}}
Please note my_alert_group
is a custom notification group I have created, you can simply replace it with a device that you want notification on.
It also dismisses the original notification, and creates a new one to add a url to check more information on the ip from which login was attempted.
Hope this helps!