Save a text copy of your ESPHome device’s YAML source code – you’ll need it later
a) open a terminal/command-line session into your HA instance
b) cd to the esphome
directory
c) cd to the .storage
directory
d) remove the esphome.abcdefg123456 file corresponding to your device
e) use the grep utility to find the name of your device within the Home Assistant core.* files
f) edit the core.* files to remove the entire section corresponding to that device from these files (should be one instance in each of two or three files). save the files, exit the text editor.
g) synchronize the file system. command is ‘sync; sync;’ (not strictly necessary, just habit)
Then, in the Home Assistant web GUI:
- use the ESPHome page, and delete your device
- use the Configuration / Integrations page, remove the device from the ESPHome Integration
- restart your instance of Home Assistant
- re-create your ESPHome device
Reference
https://community.home-assistant.io/t/api-encryption-where-to-update-in-home-assistant/344576/7