@stefanheule I was able to get this working but made a few tweaks that (I think) simplified things. Sharing here to add to the knowledge pool. I referenced this post where they were picking up the persistent notifications via automations.yaml.
I’m using the all events node and filtering out to only call_service events. From there I am using a function as you suggested to filter, but it’s a bit more brief. An then lastly using a call service node to call notify and send me a notification. I’m referencing the message object to populate the notify data to pass on the title and message.
function code:
if (msg.payload.event.domain == 'persistent_notification' &&
msg.payload.event.service == 'create')
// this is a persistent notification
{
return msg.payload;
} else {
// ignore
return null;
}
and the data within notify service node:
{
"title": "Persistant: {{event.service_data.title}}",
"message": "{{event.service_data.message}}"
}
