Delete individual device from integration

Rather than deleting all the devices in an integration it would be nice to be able to delete individual devices.

Hi Tom,

What type of device do you want to delete?

MQTT Sonoff device.
Also a malformed MQTT nodeMCU device

you don’t technically need to remove the integration to remove the one device. Just post an empty message to the topic that you want to remove and set the retain flag as true.
I use mqtt.fx for this which works flawlessly…

This is still a problem.

We need the ability to delete individual devices.

I just stuffed up configuring an ESP2866 and to clear it from discovery had to wipe all my mqtt devices instead of just that one device.

2 Likes

Another example.

I just got a new phone. I’m still jumping through hoops to try and remove the old one.

5 Likes

How about the entities in mqtt? or z-wave. The only way I’ve found to delete old unused entities in the configuration integrations is to delete the entire add-on, then dig through the .storage files and delete the entities individually. It’s like once they’re auto-populated, you’re stuck with them. I think this is a necessity.

2 Likes

I moved from Philips Hue to Deconz and now have all devices in there twice so would love to get this option in there.

I have the same situation in Deconz now. I have removed 7 old devices. I have removed them from Phoscon. I have removed the entities. I have restarted HA twice and still they are listed in the Integration overview of devices. The cruft is building up and there is no way you can delete them without deleting the whole integration. And that may sound easy but it is not because I end up renaming battery sensors and device names for an hour when I have more than 50 devices. We need a delete button for each item.
Now I have to hack a JSON file again

+1 on this.

Zwave also leaves zombie devices behind after removing nodes (both the normal way and the “remove failed node”).

4 Likes

3 Likes

Yup this is an essential feature as far as I’m concerned.

1 Like

This feature is highly missed.
especially for z-wave nodes.

2 Likes

I need this feature too. :slight_smile: My MiJia human body movement sensor! works a bit weird after resetting. It’s just sending only link and battery, grrrr.

(and @marenr)

For MQTT devices, it is sometimes necessary to remove it BOTH from the MQTT server and the homeassistant config.
For some devices, removing it from just one of those will mean it still shows in homeassistant.

And, replying to myself: Maybe this problem has gotten worse lately?
Tried to clear out zombie devices and deleted them from everywhere: Config, MQTT, known_devices, .storage/core.device_registry (as well as the individual device files)
And nothing worked.

Eventually deleted the integration and re-added

I’m surprised this is such an issue and it hasn’t been integrated yet. I too would like to remove individual entities from integrations. I currently show my hue bulbs from homekit and now I have my hue bulbs showing from smartthings. It seems unreasonable that I can’t simply “delete” the entity from the integration. Also, I am using the unifi integration for presence detection and every single device on my network is showing as a presence sensor. Obviously I don’t need to know if my TV is home or away.

Agreed on this!! In playing with various things, particularly MQTT things, I wind up with extra devices in the integration that are really hard to get rid of. While disabling them stops them from showing up in the front end, they build up over time. There are very nice entity and device management pages now, and while the entity management page has a delete button the device management page does not.
Given how the discovery works, deleting seems like it would have to be a per-integration function, but it doesn’t seem insurmountable.

For anyone’s interest, after much messing around, I’ve discovered that you can delete MQTT devices if you:

  1. Send empty (i.e. no payload) MQTT packets to all the the individual topics associated with the devices you want to delete, with the Retain flag set, it will clear out the entities, leaving empty devices (if you don’t set Retain to on, they come back)
  2. edit core.device_registry and core.entity_registry (in config/.storage folder) to remove the entries for the devices/entities in question (don’t hit save yet!)
  3. restart Home Assistant and when the connection lost notification pops up in your browser, then hit save in the editor (I imagine you could shut down Home Assistant rather than trying to time it for when the server is rebooting, but this is easier)
    Notes: don’t screw up the brackets in the core files or HA won’t reload. If you save your edits to the core files and then restart HA they will come back.

Hopefully this methodology is useful, but more to the point it underscores just how hard it is to delete an MQTT device. I’d also assume that many HA users don’t really care to learn MQTT, or how not to mess up the brackets in a text file, so this sort of arcane solution will deter new users.

As mentioned it would have to be a per-integration thing, but I’d suggest that the low hanging fruit here is in generic integrations that are likely to auto-create lots of devices: MQTT, Z-Wave, Deconz, presence detection and UPnP/IGD.

Final note: what if someone steals your TV? Then it would be good to know if it’s away…

5 Likes

Did some errors on including a z-wave remote, now it appears 3X in the devices list but 1 time in z-wave nodes (correct).
So of course I need the “delete” feature.

Generally speaking, I have already some “ghosts” devices I want to delete, even do not know how they appeared, like FIBARO FGS221 with incremental (2) (3)…

@chris669

I have the same issues. You can get rid off these devices/entities goin’ to the registry files, but this is also more than suboptimal.

I am also eagerly waiting for a proper/better device and entity management. I am still struggeling on where to do what after a long time of HA usage.