I’ve been playing with MQTT Autodiscovery and in the process I’ve got a bunch of mal-configured devices. Here’s a screenshot!
One of the devices is correct, the others are duff. How can I remove them?
I know that if I find out the correct MQTT autodiscovery topic and publish an empty message on it the devices go away - but some of them still come back when HASS restarts! Why is this?
I had this is esphomelib, then I discovered you could use it to clean up the entries it had made, as long as you hadn’t changed the name of the device or name of the item in the config.
Whenever this happens to my with Tasmota, I turn discovery off on the devices SetOption19 Off then I remove the MQTT integration, disable the broker and restart home assistant. Then add integration again and enable the broker and discovery.
I don’t really understand how a device gets multiple entity_id’s the second usually with a _2 suffix… I updated firmware yesterday and it did it on one switch.
Agreed, I’ll give it a try tonight, as I’m planning on replacing my Bruh digital leds with either esphomelib, or the one from The hook ups channel, as mqtt_json is getting deprecated.
I found that my .storage/core.restore_state file contains a bunk of junk MQTT data. However it’s remarkably sticky - deleting it and then restarting doesn’t seem to work. I guess it saves iton exit or something.
Just had a same problem that I just tried autodiscovery and it spamed all my data with prekonfigured sensors. I had to disable the autodiscovery in config
mqtt:
discovery: false
And remove whole MQTT in the section Integrations. Then run tool MQTT Explorer and just remove whole topic containing those sensors (by default homeassistant).
No need to reinstall Mosquito and lost other retained maeesages.
One extra sensor is spam? With useful status information? You could just disable that sensor in the integration if it offends you so much. That’s what I did with the binary_sensor it just started creating.
Well the issue is that Zigbee temperature sensors I use have few other values than just temparature. It has also pressure, link quality, baterry voltage, battery percentage. And imagine all these get added also for sensors I had as I have not been using autodiscovery before. So once I enabled autodiscovery i immediatelly had like 50 aditional sensors in my charts (have 10+devices). Chars become unreadable, what a mess. But long story short, it’s great feature for beginners, but I personaly find it risky as it seem that those data are kept in MQTT only as persistant topic wihtout a way how to back it up. Once you hassio running Mosquito crashes and dies, you loose all that, but if you have configured the hard way in the config a backing it up time to time, you can restore anytime. Or am I missing some good way how to backup the autodiscovery sensors?
you can install MQTT-Explorer (http://mqtt-explorer.com/)
Login to your MQTT broker.
Then you choose the items that you want to remove and push the Del button on your keyboard or click on the waste-basket symbol (for the last method you have to move the cursor horizontally from the selected item to the right and then go up to the waste-basket symbol)
Just to note I’ve been having exactly the same issues with Tasmota 9.1.0:
Once discovered, really difficult to remove/re-add/re-discover device if you are playing around with reconfiguration (in my case, custom Rules)
New discoveries append _2 _3 to hassio names
I had manually cleared the discovery topics, but using MQTT Explorer I found a few lingering items so deleted them and restarted Hassio. No dice.
I then searched the core files for the id of the device (e.g. DB648E) and found an entry under deleted_devices. I removed this entry, restarting Hassio, ran SetOption19 1 and it worked!