So, it’s the nuclear option. Wipe out (almost) everything and start from scratch.
I share your concern about ‘what if this happens again?’
As far as I know, option 19 instructs the device to support Home Assistant automatic discovery. So if your config file already contains a Sonoff device configured as
light.kitchen, auto-discovery is likely to find the same Sonoff again and re-register it in
light.kitchen is not in the config file and yet the auto-discovery process produces
light.kitchen_2 then there must be an existing
core.entity_registry. If not that then possibly there’s some vestige of the entity held in this file:
Long story short, there are only a few places that Home Assistant uses to store its configuration (unless Hass.io does things I’m unaware of) and they’ll be in
configuration.yaml or within the
One more thing you can do is look at what the Sonoff is sending to the MQTT discovery topic. I believe for
light.kitchen its discovery topic would be:
The syntax is:
Examining what the device sends to its discovery topic might provide some clues why it is being re-registered as a duplicate.