Unfortunately due to operator error that will not be possible (I’ve since deleted the ESPHome config files for the devices as they were not needed).
I’ve tried stopping the home assisistant server and deleting relevant sections of the core.device_registry and core.entity_registry but as soon as I start HA again the entries reappear.
If tried sending blank retained config mqtt messages to the broker.
My config is a mess. I have test sensors that dont exist and a sensor that does exist but wont connect. I get these warning in the HA log:
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.dining_room_humidity. Platform mqtt does not generate unique IDs 2019-01-19 20:20:03 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
And these errors in the mqtt log:
1547888619: New client connected from 10.1.1.100 as 0930d2e1-6e3d-4cdc-bf41-redacted (c1, k60, u'mqtt_user').
1547888628: Socket error on client dining_dht2-bcdredacted, disconnecting.
This whole mess could have been easily avoided if we had an easy way to delete devices from integrations rather than the integration as a whole.
I’m now seriously considering having to delete the whole integration, my .storage files and reinstalling the mqtt broker.
Delete the MQTT integration and Broker and restart.
Edit the dud entities from the /.storage file.
Restart HA
Verify /.storage file has them no more again.
Add MQTT broker and integration and restart HA again.
I’m 99.9% certain I’ve expunged the offending entries from the mqtt broker. Inspection of the topic homeassistant/sensor/# reveals no retained duplicates/test sensor configs.
I’m procrastinating about pulling the pin on the whole integration in the (vain) hope that someone comes up with a better idea as this means I have to crawl into the back of my comms cupboard to pull the power on a number of remote ESP devices to get them to resend their config messages. Not an easy task - I have some illuminated rocket launch cover switches for this but haven’t wired them up yet. Guess I should just drink a cup of concrete and HTFU.
I’ve made a snapshot, copied it off and am going in…
Delete the MQTT integration and Broker and restart. DONE
Edit the dud entities from the /.storage file. DONE
Restart HA DONE
Verify /.storage file has them no more again. (gone, YAY!) DONE
Add MQTT broker and integration and restart HA again. Reinstall failed twice. Third time lucky
Power cycled the easy to get to ESP devices and… I have no ESP mqtt integrations or sonoff devices (not auto discovered)
Restart again.
And we’re back and fully operational without the test duplicates!
My remote battery powered ESPs that are asleep are missing though. Head torch on and going for a walk in the garden to wake them up. I may be some time…
Thank you for this. I had to do one more thing: before adding the broker back to HA I had to remove the retained messages on the broker. To do that I took the easy route and deleted mosquitto.db
I don’t get it. Deleting the MQTT integration and broker, restarting, editing the entities from .storage, restarting, verifying that the .storage file hasn’t re-added the entities and then re-adding the MQTT broker and integration then restarting HA again is your preferred solution??
I was just saying that in order to save time for the next person with my question, that you update the solution. I don’t get why you’re opposed to that, but whatever.