I consolidated devices on a single ESP and now I have both duplicates and unavailable

I took 3 strings of 1-wire devices and consolidated them on a single NodeMCU device. I flashed a new device and according to the logs all the devices are reporting properly. Although the device was discovered and added successfully, the individual sensors show as unavailable in HA and I have lots of duplicate and some older names of devices. I am sure I should have done things differently. Not sure where to turn to fix this.

delete all of your 3(?) esphome integrations in ha and then add the new one again.

I have just done this and what orange-assistant say’s, delete integration restart HA and HA should find your new integration automatically.

I have done that but the old information still remains. I have removed ESPhome from HA but I guess that doesn’t remove the old data because when I restart HA and then reinstall ESPhome, everything is still there and with the old names. Next I removed the ESPhome add-in along with references to ESPhome in the config folder and in .storage, I restarted HA, reinstalled ESPhome, created a new device with my saved yaml and all the old names were there again.

Don’t remove ESPHome, that won’t help, remove integrations! Go to Configuration → devices and services and there find all your old devices in “ESPHome” list: Click on one, then click three dots and hit “remove”. it’s a good idea to do this each time you change names or sensors in ESPHome module.

@Protoncek Thanks, I did eventually get it. I have created dozens of test devices both from within HA / ESPhome and using a standalone ESP installation and then adding them through discovery. I also created stub devices for existing devices so I could read the logs for devices I had previously added using discovery. In some cases I no longer had sensor addresses and it was easier to read logs. I think there was just too much junk. I did need to remove files manually but once everything was clean, I was able to create a new device within HA and everything went smoothly.
Your advice on removing when changing names is a good one. I probably created a lot more work for myself by not understanding what would happen when I created a new device without removing the old. Lesson learned.

1 Like