Support Ecovacs device verification - #1706
Conversation
|
I tested it and I get: |
|
Thanks for testing. This traceback shows the new The complete flow also requires the companion Home Assistant changes that request and submit the verification code. Could you confirm whether you tested only this library PR, or a custom integration containing both sets of changes? |
|
I tested only this PR. Can you pls show me what else I should do to make this integration working again ? |
|
The complete Home Assistant flow requires both the library and companion Home Assistant changes. A community member has packaged both as a temporary custom integration, with installation and removal instructions here: Please note that it was built for Home Assistant Core 2026.7.2 and tested with a global email-based Ecovacs account. Make a backup first; China-region and phone-number accounts haven’t been validated yet. |
|
Thanks. I would not like to go with a temporary custom component. If I want to patch the component "ecovacs" to integrate with your PR, what shall I do? Any link or guidance? |
|
This PR only covers the In short, on Home Assistant OS the temporary custom component is the available way to override the bundled integration without building a custom Home Assistant Core image. Otherwise, you’ll need to wait for the companion Home Assistant Core PR. |
|
I successfully tested this PR with the following setup:
To complete the flow, I applied the changes from this PR, generated a stable 8-character device ID, temporarily modified Home Assistant so that it always reused the same device ID, and completed the email verification using a standalone Python script. After verification, authentication works correctly across subsequent Home Assistant restarts, and all vacuum entities and commands are available again. Changing only the reported During testing, however, I found a second issue. It is probably separate from the authentication change, but it became visible once the integration was able to connect again. After every Home Assistant startup or Ecovacs integration reload, the DEEBOT is initially detected correctly as Approximately 20 seconds later, the device responds to
The library then emits: The vacuum is physically sitting in the docking station, fully charged, and the official ECOVACS app reports no error. I temporarily changed After restarting Home Assistant, the vacuum remains correctly in the Timeouts for I cannot confirm that error code |
|
I can confirm it works for my Ecovacs Deebot X9 Pro Omni vaccum with the following Homeassistant setup:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1706 +/- ##
==========================================
+ Coverage 95.08% 96.14% +1.06%
==========================================
Files 161 161
Lines 6301 6385 +84
Branches 354 364 +10
==========================================
+ Hits 5991 6139 +148
+ Misses 248 180 -68
- Partials 62 66 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Ecovacs authentication flow to handle the new “device verification required” behavior by adding a verification-code workflow (including RSA encryption of the account identifier and signed private API calls) and surfacing explicit errors for common verification failures.
Changes:
- Add new authentication exceptions for device verification required and invalid verification codes.
- Implement signed private API calls (
getConfig,sendEmailVerifyCode,verifyDevice) and complete the existing token login flow after successful verification. - Add tests covering device-verification-required login, requesting a verification code, completing verification + credential caching, and invalid public key handling.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
deebot_client/authentication.py |
Implements the device verification flow (public key fetch, RSA encrypt, signed calls) and integrates it into authentication. |
deebot_client/exceptions.py |
Adds explicit exception types for verification-required and invalid verification code scenarios. |
tests/test_authentication.py |
Adds unit tests validating the new verification workflow and error handling. |
pyproject.toml |
Adds cryptography dependency required for RSA operations. |
uv.lock |
Locks new transitive dependencies (cryptography, cffi, pycparser). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
From the PR it looks like that also a core PR is needed. Can you please open that one too (without the dependency bump), so I can review both in one go and understand more which changes are needed |
|
Tested the Result: the device verification step itself works, but the fix does not resolve the integration setup, because Ecovacs' server does not appear to persist the verified state beyond the single login session in which ReproductionWith debug logging on
Log excerpt (redacted): Same Why this mattersThe current implementation (both this branch and the Wondering whether:
Happy to test further or provide more debug logs if useful. Region: EU ( |
Summary
getConfig,sendEmailVerifyCode, andverifyDevicerequests used by current Ecovacs clients.Why
Ecovacs now returns error
1013for client device IDs that have not completed device verification. Updating only the reported app version does not resolve the error; the client ID must complete the email verification flow and then remain stable across future logins.The flow was validated against a live affected account: Ecovacs accepted the emailed code, and a separate fresh process subsequently completed password authentication with the same client ID and retrieved the account's device list.
This implementation has been validated for an email-based global account. China and phone-number account flows have not been validated.
Thanks to @christensenjames, @golf4r, @gatof81, and the other contributors who documented the current API behavior and device-ID requirement in the related Home Assistant investigation.
Fixes #1702.
Related to home-assistant/core#176484.