Ghost light entity

I had an entity named light.chicken_heat in my light.yaml file. I changed it and made it a switch.chicken_coop in my switch.yaml file instead. The new entity shows up and I can use it in my groups… but the old chicken_heat still shows up in the state table and group.all_lights too! I have no idea how to get rid of the extra/old light entry.

I have exactly the same case, did you manage to fix your issue?

It’s still in the entity_registry. Gotta remove it from there.

Take a look at this post

It’s not in the entity_registery, there isn’t even a wheel to change the name or the entity_id.

It has to be, check all the hidden files inside .storage.

sudo grep -r "light.verlichting_bureau" ./
./.storage/core.entity_registry:                "entity_id": "light.verlichting_bureau_2",
./.storage/core.restore_state:                "entity_id": "light.verlichting_bureau",
./.storage/core.restore_state:                "entity_id": "light.verlichting_bureau_2",
./.storage/lovelace:                                "light.verlichting_bureau_2",
./.storage/lovelace:                                            "entity": "light.verlichting_bureau_2",
./lights.yaml:    - light.verlichting_bureau_2

The entity i’m talking about is light.verlichting_bureau and it’s not in the registry only in the restore_state.

Alright, delete the restore_state object. If it still appears, you may need to purge your history.

I have done all that still it isn’t being cleaned up. Will wait on the new release perhaps it’s fixed.

does the item have a cog inside the states menu? Also, I hope you are editing these files when Home Assistant is off. Editing them when on will do nothing. You need to shutdown, edit, start for it to take effect.

Already did al that, still not going away.

What platform is the light/switch using?

MQTT?

Z-wave?

I’m using MQTT as platform, first manually configured then using discovery (tasmota)

You need to clear the retained messages for this sensor from the mqtt broker.