Displaying the last N persistent notifications (including those viewed and dismissed)

Hi, I have a problem that I can’t solve.
I would like to create a dashboard where I can display the last N persistent notifications (including those viewed and dismissed).
I tried to use the notify.file but it creates a log that is then difficult to view. I created it in the form

{"title": "aaaaa", "message": "bbbbbbb", "date":"xxxxx"},
{"title": "aaaaa", "message": "bbbbbbb", "date":"xxxxx"},
{"title": "aaaaa", "message": "bbbbbbb", "date":"xxxxx"},

but it is not a real json and then being able to display it in a card is a nightmare.
How could I achieve my goal of displaying the last N persistent notifications (including those viewed and dismissed).

Have a look at this:

Just tweak the notification target template.

The overall trick is to realise you don’t need to keep 10 (or n) messages in your sensor value, but that HA has that info already, so you can just capture the latest notification’s text.