---
title: "Persistent notification"
description: "Spook adds an action that lists the persistent notifications of Home Assistant, so an automation or a template can read them, to show them on a dashboard or send them to your phone."
canonical_url: "https://spook.boo/persistent-notification"
---
# Persistent notification

> Spook adds an action that lists the persistent notifications of Home Assistant, so an automation or a template can read them, to show them on a dashboard or send them to your phone.

The persistent notification integration is behind the notifications in the sidebar of Home Assistant. A failed login, an integration that could not be set up, your own automation saying the filter needs changing: they all end up there, until somebody dismisses them.

Since Home Assistant 2023.6, a notification is no longer an entity with a state. Only the sidebar shows them. An automation or a template cannot see what is in there: not to show the titles on a dashboard, not to send the ones still open to your phone.

Spook adds an action for that: list the notifications.

## Actions

Spook adds one action to the persistent notification integration. You find it wherever you add an action, marked with a 👻.

### List notifications

Lists the persistent notifications, the oldest first: their ID, title and message, and when they were created. The same ones the sidebar shows.

A notification created again with the same ID replaces the one before it. It gets the new message and the new time, so it moves to the back of the list. A dismissed notification is gone, and not listed anymore.

Everybody can list the notifications, as everybody sees them in the sidebar.

Only want the number of notifications? Spook already has a sensor for that, `sensor.persistent_notifications`, under [devices and entities](https://spook.boo/devices-entities).

**How to use it**

1. Open the automation or script that needs the notifications, and select **Add action**.
2. Search for **list notifications**, and select **Persistent notification: List notifications 👻**.
3. Under **Response variable**, give the list a name, like `result`. The steps after this one can use it.
4. Select **Save**.

**Technical details**

| Action properties |
| --- |
| Action | Persistent notification: List notifications 👻 |
| Action name | `persistent_notification.list` |
| Action targets | No targets |
| Action response | Yes, the notifications |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=persistent_notification.list) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=persistent_notification.list) |

This action takes no data.

The response:

| **Attribute** | **Type** | **Description** |
| --- | --- | --- |
| `notifications` | list | The notifications, the oldest first. |
| `notifications[].notification_id` | string | The ID of the notification. Home Assistant's dismiss action takes it. |
| `notifications[].title` | string or `null` | Its title, `null` when it has none. |
| `notifications[].message` | string | Its message, in Markdown. |
| `notifications[].created_at` | string | When it was created, in UTC, like `2026-12-01T09:30:00+00:00`. |

**Example actions in YAML**

A sensor for your dashboard, with the number of notifications as its state and their titles as an attribute. Home Assistant's own persistent notification trigger keeps it up to date, every time a notification comes or goes. The start and the reload of template entities fill it in for the notifications that are already there:

```yaml
template:
  - triggers:
      - trigger: homeassistant
        event: start
      - trigger: event
        event_type: event_template_reloaded
      - trigger: persistent_notification
    actions:
      - action: persistent_notification.list
        response_variable: result
    sensor:
      - name: Open notifications
        icon: mdi:bell
        state: "{{ result.notifications | count }}"
        attributes:
          titles: >-
            {{ result.notifications
            | map(attribute='title')
            | reject('none')
            | list }}
```

Every morning, send every notification that is still open to your phone:

```yaml
triggers:
  - trigger: time
    at: "08:00:00"
actions:
  - action: persistent_notification.list
    response_variable: result
  - repeat:
      for_each: "{{ result.notifications }}"
      sequence:
        - action: notify.mobile_app_phone
          data:
            title: "{{ repeat.item.title or 'Home Assistant' }}"
            message: "{{ repeat.item.message }}"
```

**Known limitations**

- The list is the notifications at the moment of the call. To act on a new notification right when it comes in, use Home Assistant's own persistent notification trigger instead.
- Home Assistant keeps the notifications in memory, not on disk. After a restart, only the ones created since are listed.
- The message is the Markdown the sidebar shows it from. A phone shows that as it is, asterisks and all.


## Sitemap

See the full [sitemap](https://spook.boo/sitemap.md) for all pages.
