Integrations

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.

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.

Missing something here?

An action, an entity or a repair this integration should have? Say so. Stuck, or found a bug? There is help.