How to dismiss persistent notification?

This may seem like a dumb question, but no answer discovered so far, so maybe it’s actually a dumb shortcoming in HA. How can one dismiss a persistent notification from the UI? There doesn’t seem to be way. There is a “dismiss notification” service, but you would need to know the numeric ID of the notification, and there’s already an unanswered feature request to add “all notifications”.

This is a notification from the Homekit control integration telling me that it detected an unpaired Homekit device, prompting me to pair it. I don’t want to pair it, and the notification doesn’t want to go away until I successfully pair it.

I know that it’s likely to recur, and there are a bunch of posts on how to try to block it from recurring, but my problem is that I can’t dismiss it at all. It just sits there with a notification icon that can’t be dismissed, demanding an action I can’t do.

I don’t think it is a dumb question at all, as I could only find the answer to it with some experimenting :slight_smile: The id of this notification is config_entry_discovery

I created a simple automation to dismiss this notification and haven’t seen it ever since.

- id: '1572817165405'
  alias: Dismiss annoying notification
  description: ''
  - hours: '*'
    minutes: /5
    platform: time_pattern
    seconds: '*'
  - condition: state
    entity_id: persistent_notification.config_entry_discovery
    state: notifying
  - data:
      notification_id: config_entry_discovery
    service: persistent_notification.dismiss

Unfortunately the state change of this notification does not trigger an automation so I it just runs every five minutes.


I’m not sure why you can’t do that.

In the notification pane at the bottom left side of the window there is a “dismiss” button that should get rid of it.

It will still come back again later because HA keeps discovering your un-paired stuff tho.

And that’s the issue I’d like a solution for…I’d like the ability to dismiss a notification for pairing a discovered device that (semi-)permanently will ignore that specific un-paired but discovered device. That would allow us to ignore that one device but still be able to continue discovering other devices in the same integration.

Maybe I’ll put in a FR for it.

I recall there was a discussion in the Architecture repo (I think) about the need to acknowledge and decline to use a discovered device. I think the sticking point was deciding for how long should the “I decline” directive should persist … because there may come a time when you do want to use it. I get the feeling nothing ever got implemented and the it just keeps reporting re-discovered devices.

I suppose one possible (bandaid) workaround is to create an automation that is triggered by a persistent_notification for discovered devices … and then call persistent_notification.dismiss to delete it. So the moment the discovery process notifies you about discovering X, the automation dismisses the notification.

I’m not sure how easy it is to accurately identify the notifications concerning discovered devices. Hopefully there’s something consistent in the title that can be used for a string-match.

I’d be interested in this too. My HA keeps “discovering” my router, and wants me to configure it as a new integration. I tried that once. It filled up my home-assistant_v2.db file so quickly I had to remove it.

I’d love to tell the notification to go away permanently. If I ever changed my mind, I could just go into Configuration / Integrations anyway.

Not for me. But I’m not on the latest HA release - maybe this was added recently in response to earlier requests?

Can you elaborate on what you tried and what kind of entries were bloating the database?

So if you click on the “notifications” area at the bottom left here:


then yours doesn’t have the “dismiss” in the bottom left of the next side panel that opens like this?


What version are you on?

I’m on v101.3 and that ability to dismiss the notifications has been there for as long as Lovelace has been the default UI as far as I know.

In support of what finity said, here’s how it looks in version 0.89.

Create a persistent notification:


Here’s the resulting notification (with a Dismiss button):


I see what you mean. Yes there is a Dismiss when you open the specific notification with most notifications. Not on this one to set up a newly discovered Homekit device. It cannot be dismissed.

It does go away if I unplug the Homekit device so that it’s not available to discover, and then restart Home Assistant. Only to return when I plug the device back in.

Pardon my ignorance but I have next to nothing that is automatically discovered. I did experiment recently with LIFX and, when discovered, a popup message appeared in the center of the screen asking if I wished to configure it. Is that what you are seeing? Or does it appear exactly like a persistent notification but without the Dismiss button?

A screenshot would help.

Screen shots attached. The top is the notification I get. When I click on it, I get the prompt box in the middle of the screen asking me to enter the HomeKit code. It will not accept the code because the device is already paired elsewhere. It will not accept a blank or an invalid code. If the prompt is closed, the notification remains. There is no way to remove the notification except to enter a valid code and have it accepted.

Thanks for the screenshot.

The notification’s presence is indicated in the traditional way (orange bubble containing the number of unread notifications) but, beyond that, it doesn’t behave like a standard persistent notification (i.e. it’s popup dialog box with no ability to truly dismiss it). Interesting.

When I let HA discover my router (TP-Link Archer C1200) it started recording all kinds of real-time network statistics. Bytes in/out, packets in/out, and tons of other things. Interesting but nothing I really need on an ongoing basis, and the database was at 3G+ and still growing when I deleted both the integration, and the database. Since then it’s been stable at a few hundred KB.

Maybe it is a bug in the discovery of the integration or configurator for that integration.

I’ve had a few devices discovered for ESPHome and I was able to dismiss them without needing to configure them so it should be the usual functionality.

file bug report and see where it goes.

It would be a bug report for an old version of Home Assistant. There may be more interest in resolving it if it also occurs in the latest version.

I have a very similar problem with my Lutron Caseta bridge. It keeps getting detected as a Homekit device even though it’s already set up.

What I did to stop this was prevent the zeroconf: integration from loading. If you are using default_config zeroconf automatically loads. Disable default_config and manually put in all the other integrations except for zeroconf and I also don’t bother loading ssdp: as I don’t use any devices that it discovers.

This should stop your notifications. But you have to remember to re-enable zeroconf if you add a new device and want to discover it.

Try this to get rid of the time trigger.

  - platform: event
    event_type: state_changed
      entity_id: persistent_notification.config_entry_discovery

  - condition: template
    value_template: "{{ states('persistent_notification.config_entry_discovery') == 'notifying' }}"

    - service: persistent_notification.dismiss
        notification_id: config_entry_discovery