If you run ESPHome separately from HA (separate Docker container, for example) and have existing ESPHome devices that are now warning about deprecated passwords following an HA update to 2023.2 or later, here’s how to fix:
Go here, and copy the randomly-generated base64 key (or generate your own).
In your ESPHome configuration for each device, find the lines:
api: password: "YOUR_PASSWORD"
Replace it with this, substituting in the key from above:
api: encryption: key: "YOUR_BASE64_KEY"
Install the new configuration to the device. Once it restarts, it will try and fail to communicate with HA (might take a while):
As soon as you see that message, go to the HA Integrations page (or refresh it if you’re already there), and you should see an alert prompting you to reconfigure the device:
Click the Reconfigure button, paste in your base64 key where prompted, hit Submit, and it should all magically start working again.
Repeat for all devices — up to you if you use the same or different keys.