HASwitchPlate Device (light) binary_sensor appearing but i've removed all references to it

binary_sensor.haswitchplate

friendly_name: HASwitchPlate
device_class: connectivity

I’ve combed every line of code, i’ve got no idea why its appearing… (Its always on btw)

I did build a HASwitchPlate but i’ve disconnected it and removed all references to the code for it. (Need to get back around to reconfiguring it and 3d printing a mount plate for it)

Any ideas what it could be?

Does it also show up in DevTools/states?

Maybe take a look in the entity_registry.yaml (older versions) or .storage/core.entity_registry in your config folder.

Sure does… twice

|Entity|State|Attributes|
|[binary_sensor.haswitchplate])|off|friendly_name: HASwitchPlate device_class: connectivity|
|[light.haswitchplate]()|on|brightness: 255 min_mireds: 153 max_mireds: 500 friendly_name: HASwitchPlate supported_features: 1 hidden: true|

I feel my biggest concern is how this device is appearing (or didn’t disappear after being removed) - its more a curiosity thing.

I know I can hide it from the front end - but it will always bug me in the back of my mind. (DAM OCD)

I’ll check those folders when i’m home - its certainly not in entity_registry.yaml and I didn’t see in the folder stucture .storage/core.entity_registry

Do you have discovery: enabled on your configuration.yaml?

probably still in the mqtt database.

Thanks guys!

I tested without discovery and the same issue.

@aidbish - do you know how to remove the entry or clear the MQTT database?

Apparently you can publish a null payload to the topic with retain set, but i have tried this and it didn’t work. The easiest way for me was to stop my mqtt service and delete the mosquitto.db file and then restart service and HA

Thanks @aidbish good tip…

I’ve been searching for the mosquitto.db file although it doesn’t seem to appear for me… I ssh in to hass.io but can’t see it anywhere - any tips to find it?

core-ssh:/# cd share
core-ssh:/share# ls
core-ssh:/share#

ahh, sorry mate, i don’t use hassio, so not familiar with file layout