Home Assistant sees old firmware?

I installed my esp32 with a bluetooth proxy, but previously, I had installed ESPrecense on this esp32 device. After installation, I added it (manually) on the integrations page in Home Assistant (Add integration, ESPHome, enter IP address).

Now, the “Device info” says it’s ‘bluetooth-proxy by esphome’, but when I click that device, I see ESPrecense sensors and entities. How is this possible, since this firmware should have been wiped?

To my surprise I now also have a “iBeacon tracker” on my integrations page.

I have no clue what’s going on here. I also used a wipe function to erase the firmware. I thought maybe Home Assistant uses information from a previous discovery, based on mac address and/or IP address?

You have to remove integration configuration for previous firmware. The best is remove both old and new and then add new. That should fix ghost entities.

Ghost entities sounds a lot like the problem I have. But how do I delete integration configuration?

I have not specified anything in yaml files, so everything was added using the GUI. How do I remove ghost configuration?

In HA open Settings / Devices and Services / Integration.
Find ESPHome integration and there is a list of all ESPHome integration.
Open one that does not exist any more.
Click on three vertical dots menu.
Click Delete.

I did that several times, but then when I added the ESPHome integration again, the entities were all back again.

But, I also found a button “Delete from MQTT”. After I pressed that, all those ghost entities were gone. It seems to be OK now, and the bluetooth proxy seems to be working as well.

Thanks!

That means ghost entries were from MQTT not ESPHome. But it is the same principle.