Need help with ESPHome integration (renaming node)

I just renamed my esphome node, deleted its integration from HA, compiled and uploaded renamed node and integrated it from scratch.

I now face few issues:

  1. I don’t have entity names I expected to see. For example, in esphome I have:
binary_sensor:
  - platform: gpio
    name: bathroom extractor fan state

but in integration its name is bathroom_extractor_fan_state_2.
Some entities are just weird:

  - platform: wifi_signal
    name: bathroom_extractor_fan_node WiFi signal level

became sensor.wifi_signal_level, only God knows why…

So basically currently there are 2 sets of entities in HA’s registry. I don’t want to change my yaml files so I’m hoping to manually remove all of them and then integrate my node again.

  1. The integration shows a lot of icons, but if I click on the whole thing (not icons), there are fewer displayed - obviously a bug? If I click on individual icons, it shows me its state/history/etc.

Apparently something went wrong here.
The question is - what is the right way to rename nodes on the esphome side?

Ok, here is the rough solution:

  1. Remove esphome node integration
  2. Stop Hass.io
  3. Open /config/.storage/core.entity_registry text file and delete all unnecessary entities
    3a. (optional) Delete these entities from /config/home-assistant_v2.db (via sqlite)
  4. Start Hass.io
  5. Integrate esphome node.
1 Like

You can delete entries in the entity registry using the GUI by going to Configuration -> Entity Registry

Click on the entity you wish to remove, a window pops up, click delete.

Restart HA and re-integrate the new (re)discovered device

It’s not that easy, check that out

the good thing is there is no need to delete/rename home assistant_v2.db as the registry is a plain editable file.

1 Like

I just tried this which seemed to work:

To delete an ESPhome device, go through every file in /config/.storage that begins with core. and delete every reference to the old device. Then go to /config/esphome and delete every file that mentions the old device.

Then reflash the device with USB as if it were new.