ESPHome devices that remove encryption key become in a weird state
The problem
I had an ESP32 S3 Box with the voice assistant firmware. I had it adopted in the ESPHome dashboard, which added an encryption key, and it was configured in Home Assistant. The ESPHome dashboard is also integrated in Home Assistant.
I leveraged the new HTTP OTA update which removed the encryption key. Afterwards, my ESPHome config entry was in a weird state:
- The config entry set up successfully
- It logged the error
The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (Home Assistant 2024.7.1).
- I was unable to remove encryption via options
- I was unable to set up the device again without removing the config entry (which would remove customizations)
I ended up emptying the encryption key in config/core.config_entries and the device appeared again.
If I had not been aware that the device got offline, I would not have noticed because the config entry set up successfully.
Since we wouldn't want to simply accept degraded encryption, I think a re-auth would make sense here.
What version of Home Assistant Core has the issue?
core-2024.7.1
What was the last working version of Home Assistant Core?
Don't know
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ESPHome
Link to integration documentation on our website
https://www.home-assistant.io/integrations/esphome
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hey there @ottowinter, @jesserockz, @kbx81, @bdraco, mind taking a look at this issue as it has been labeled with an integration (esphome) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of esphome can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign esphomeRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
esphome documentation esphome source (message by IssueLinks)
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
@balloob I have the same exact issue but believe to be related to the fact that I am running a mesh network. It looks like the ESP board switches from the router to the mesh point and vice-versa. Not sure why though.
Are you running a mesh network by any chance?
I have a similar issue (I guess). I used the "take control" feature in ESPHome Builder for a Home Assistant Voice PE because I tried to figure out a way to expose a timer set by the device to Home Assistant and vice versa.
The device was working at first and without customising anything jet it stopped working after I restarted the home assistant host. Now whenever the wake word is detected or the center button is pushed this will be logged in ESPHome Builder 10 times:
INFO Successfully connected to home-assistant-voice-<ID> @ <IP> in <time>s
WARNING home-assistant-voice-<ID> @ <IP>: Connection error occurred: home-assistant-voice-<ID> @ <IP>: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.12.4)
@snowmangh I am using a mesh network. However, disabling it and unplugging all APs didn't change anything.
Edit: Deleting the integration entry and re-adding it in the ESPHome integration and resetting the device did not fix the issue. I love the easter egg by the way ☺️
We should probably change dropped immediately after encrypted hello to a named exception to use it to detect when encryption has been removed and trigger reauth
Is there a workaround for this?