" The ESPHome device electric-fence enabled transport encryption or changed the encryption key. Please enter the updated key. You can find it in the ESPHome Dashboard or in your ESPHome device YAML configuration."
I built this device a few years ago and updated the firmware about 6 months ago. There never has been an API or any keys, just a simple ESPHome device. It still works and still compiles, so what is causing this “error”?
Since I know you’ll ask, here is the esp8266.yaml package file:
substitutions:
project_name: ${device_name}
project_version: "1.0"
esphome:
name: ${project_name}
friendly_name: ${friendly_name}
project:
name: steve.${device_name}
version: ${project_version}
esp8266:
board: esp01_1m
framework:
version: recommended
# Enable API for integration with Home Assistant
api:
# This tells ESPHome to mark the device as offline after 30 seconds of no response
reboot_timeout: 30s # Default is 15 minutes.
# Enable logging
# Logger level "debug" is needed to get 1-Wire addresses, like the ds18b20.
logger:
level: DEBUG
I get that error occasionally as well for devices that don’t use encryption (mostly it seems to occur after the router gets power-cycled). I’ve always just ended up removing it from the ESPHome integration and re-adding. I assume it’s an issue of the IP address changing and the integration not handling that well.
I also occasionally have the same issue but for devices that DO have encryption enabled, but it won’t accept the correct key. Same removal/re-adding always fixes it.
Not a big deal, but also annoying when things don’t ‘just work’.
This issue typically occurs when a different device ends up with the same IP address due to changes in DHCP reservations.
If your devices are running ESPHome 2025.4.x or later and you’ve updated Home Assistant to 2025.5.x (available starting Wednesday, May 7th), the integration should now detect when it’s connected to the wrong device, rather than prompting for an encryption key.