Forward persistent notifications to companion app

I want to forward persistent notifications to the iOS companion app. I created the following automation:

alias: forward persistent notification to companion app
description: ""
trigger:
  - platform: state
    entity_id: sensor.persistent_notifications
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: |
              {{ trigger.from_state and trigger.to_state and 
                 trigger.to_state.state | int > trigger.from_state.state | int }}
        sequence:
          - service: notify.mobile_app
            metadata: {}
            data:
              message: new message in Home Assistant
              data:
                push:
                  badge: "{{ trigger.to_state.state | int }}"
        alias: new message
      - conditions:
          - condition: template
            value_template: |
              {{ trigger.from_state and trigger.to_state and 
                 trigger.to_state.state | int < trigger.from_state.state | int }}
        sequence:
          - service: notify.mobile_app
            metadata: {}
            data:
              message: delete_alert
              data:
                push:
                  badge: "{{ trigger.to_state.state | int }}"
        alias: message removed
mode: single

Is there a way to get the title and message of the persistent notification so I can forward it to the iOS companion app?

Where are you getting sensor.persistent_notifications?

You have everything you need here if you use the right platform: Persistent Notification - Home Assistant.

sensor.persistent_notifications is provided by Spook.

Now I tried it with Persistent Notification as trigger. But this only works if I created a persistent notification by myself. When, for example, HASS reports Login attempt failed I don’t get a notification.

alias: forward persistent notification to companion app
description: ""
trigger:
  - platform: event
    event_type: call_service
    event_data:
      domain: persistent_notification
      service: create
condition: []
action:
  - service: notify.mobile_app
    data:
      title: "{{ trigger.event.data.service_data.title }}"
      message: "{{ trigger.event.data.service_data.message }}"
mode: single