Persistent Notification Sensor "none"

I created an automation that creates a “persistent notification”, and then created a “template sensor” for the attribute > message as below, but the sensor displays “none” on the frontend, instead of the message, any ideas?

If I test the template in the dev tools, it displays the message as intended.

value_template: "{{ state_attr('persistent_notification.pri_msg', 'message') }}"

Works for me with your template.

1 Like

Mine still show none, I have no idea what the issue could be.

Do you know if states is limited to a certain number of characters?, I’m thinking my message may be too long.

Maximum is 255 characters, i think.

That’s what I thought, I reduced the message to test and it worked.

Thanks for all your assistance.

Any idea what other means I can use to display the full message on the frontpage?

I think this is something for @thomasloven’s useful-markdown-card.

You can fill it directly with the attribute from the notification without a sensor.

Played a bit, works!

      - type: vertical-stack
          - type: conditional
              - entity: persistent_notification.myha_tpad_os_updates
                state: 'notifying'
              type: custom:useful-markdown-card
              title: Notification
              content: >
                [[ persistent_notification.myha_tpad_os_updates.attributes.title ]]
                [[ persistent_notification.myha_tpad_os_updates.attributes.message ]]