How to show persistent notifications in a LoveLace card?

Hi,

Is there a way to show persistent notifications in LoveLace card?

// F

It would be nice to know if it is impossible so I do not need to waste more time. :wink:
Anyone?

// F

Hi, this can be done with a markdown card.

@Nick4 thanks for this; I am looking to do the same thing.

Would you mind elaborating a little? Since the update a few months ago (June?) wherein notifications are no longer tracked as entities, I don’t know how to access them. I can see how a markdown card would help with setting up the UI for listing them, but I’m not sure how to pull in the data for persisitent notifications.

Thanks again!

Hi, sorry I was a little to eager to help. :blush:
What I meant I’m using a conditional markdown card for notifying when i.e. a calendar appointment is due.

It depends if you send the notification yourself (eg. an automation), or if it comes from the system itself, like the login attempt warning. For the latter I wouldn’t know of any way to get the content. If you find a way, please let me know.

If you’re after the first one, there could be some way to send the content to the file integration and safe it there. Afterwards you could use the file sensor to get the message. But I haven’t tested such a thing, it’s just a guess. :slight_smile:

Thanks for responding. In the immediate term, I’ve installed lovelace-home-feed-card from HACS, which presents notifications in a lovelace card. I’ll eventually get around to looking at how that integration is doing it, but that’s my workaround for now.

Update:

Well, I got around to looking at it :slight_smile:

That HACS integration is getting the notifications as such:

var response = await this._hass.callWS({type: 'persistent_notification/get'});

Did you get anywhere here? I was attempting to connect a MariaDB and build my own tables and CRUD them based on events and then use that for persistant notifications but even getting a connection to the db with pyscript is proving to be a pain in the ass. This seems like it should be an easier way to persist data the way you want.

I haven’t looked any more into it, due to life getting in the way. lovelace-home-feed-card does show my notifications, but about half the time, the text isn’t visible due to (I think) its color matching the background. Not sure why yet…