How to list alerts/notifications.logs in a card in LoveLace UI

I have my alarm system set up and it sent notifications to a number of phones when an automation triggers. E.g 1 automation is triggered if a door sensor opens and after some time sounds a siren.

No sometimes you forget or accidentaly swipe away a notification on the phone and I would like to have a more persistent oveview of which sensors triggered and what automation was then triggered. I was thinking of having a list of these in my LoveLAce UI, but do not know what the best way is to that that through either alerts or log messages or any other method i havent read or heard about.

Any tips what the best way is to set this up?

1 Like

I use an input_text sensor that I update with the alert messages and I’m displaying it in a Logbook card.

home assistant has persistent notifications that appear as a notification in the sidebar and do not go away when you swipe them on your phone. They only go away if you dismiss them in the UI. All you have to do is add the service call to your automations. I did this by creating a notification script and calling that instead of notifications from automations. The notification script fires the persistent_notification and whatever you’re notifying with a service call.

notify:
  fields:
    persistent_notification:
      description: On/Off for Persistent Notifications
      example: on
    title:
      description: Title of the persistent notification.
      example: "Title"
    message:
      description: Message to be sent/annouced.
      example: "Hello"
    notify:
      description: Devices to notify.
      example: notify.mobile_app_abc
  variables:
    persistent_notification: >
      {{ persistent_notification | default(true) }}
    out_notify: >
      {{ notify | default('notify.homeowners') }}
    out_title: >
      {{ title | default('') }}
    out_message: >
      {{ message | default('No Message Provided') }}
  sequence:
  - choose:
    - conditions: "{{ persistent_notification }}"
      sequence:
      - service: persistent_notification.create
        data:
          # Remove the title for now, the notifications are too fat.
          # title: "{{ out_title }}"
          message: "{{ out_message }}"
  - condition: template
    value_template: "{{ out_notify.startswith('notify.') }}"
  - service: "{{ out_notify }}"
    data:
      message: "{{ out_message }}"

then calling it

- service: script.notify
  data:
    notify: notify.mobile_app_xyz
    message: You got mail

This is great!

Do you have an easy way to see all notification history? I can find them individually in the logbook, but I’m wondering if there’s a way to create a filtered view that can show you all past notifications easily.

The persistent helps in bringing it into the app, which is a great add. I just also want to find a way to go back in time if needed. Any pointers would be appreciated.

Same thing here :slight_smile:

Would be super cool to have a long time log of the persistents… also nice because the persistent logs are deleted after some restart