How to delete an entity that is neither in a config file, nor in an integration?

I am cleaning up the devices configured in Home Assistant.

One of them (light.led01) appears in the entities but I cannot remove it:

image

This says that this entity has no unique ID and therefore cannot be managed through the UI. The “Linked” tab is empty.

It is not defined in configuration.yaml (which I keep as a single, flat file).It is not in .storage/core.enity_registry either

How can I remove it?

Do you remember what kind of integration was used to create this entity?

Unfortunately not. I initially thought that it was a leftover from my old configuration (multiple YAML files) but it is not there anymore.

Is it listed in the entities page in the configuration menu?

if it then I think you can delete it from there.

Yes, it is listed, but how to remove it? (the checkmark square on the left is grayed out and when clicking I get the popup from my question)

In the entities list does the entity have a red icon with an exclamation point in a circle or does it have a pencil with a line thru it (or neither…)?

Here it is:

There is an exclamation mark in a red circle, when hovering it says ‘unavailable’ and when clicking, the popup of my question.

I am really stumped by this: I searched for any led01 entry in the whole configuration (all files in the HA configuration directory and subdirectories) and it is nowhere to be found…

Well…I’ve never seen that before.

And if it’s nowhere to be found in the registry then it sounds like it’s time for a bug report.

Bug report it is, then (https://github.com/home-assistant/core/issues/44232)

EDIT: the issue is closed closed, the solution is below.

I found it. It was being added by MQTT through the HA discovery protocol (it was retained).
I forcefully removed the entry from the MQTT broker and it is gone from HA as well.

1 Like

Good catch.

It was the reason why I originally asked if you recalled which integration you had used. If it was MQTT then I would have directed you to this post:

It was a miraculous catch (I do not even know how this came to my mind, I think I was looking at the contents of my broker for some other data of an unrelated program and had an epiphany).

My HA setup went over two or three years though major transformations as I was making up my mind on how to deal with the various devices, integrations and my own code (either part of HA or external) - so it must have been a time where light.led01 announced itself via MQTT discovery that it was there.
I am not done yet but I have to balance these changes with the risk of my wife filing for divorce after being stuck in the dark for the umpth time because an exception was not caught somewhere in my code.

Your pointer to the answer is exactly on spot, thanks for following-up.