fix(T2320): add X9 Pro mop controls and state decoding#467
Open
bdamokos wants to merge 16 commits into
Open
Conversation
a1e180c to
e072078
Compare
a887f56 to
47239b6
Compare
DPS 168 is consumable telemetry on T2320, not room-clean metadata or commands. Add a focused regression assertion so future room work does not claim this DPS.
Based on damacus#419's DPS 165 room discovery and Tuya cloud fallback approach. Adds selected-room support using DPS 152 ModeCtrlRequest payloads. Later room-clean experiments tried DPS 168 with DPS 152, but this branch keeps DPS 168 reserved for consumable telemetry.
47239b6 to
234a4ea
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds model-specific support for the Eufy RoboVac X9 Pro / T2320 by updating DPS mappings and introducing base64/protobuf decoding, plus new Home Assistant config entities to control mop/clean parameters and room targeting.
Changes:
- Implement T2320 DPS remapping + base64/protobuf decoding for mode, station status, return/dock progress, errors/warnings, prompts, clean params, consumables, and room metadata.
- Add T2320-specific configuration entities (selects + switch) for clean type, mop level, fan speed, edge-mopping, and a room selector; add warning + consumable diagnostics.
- Update vacuum activity resolution to incorporate decoded mode/return-progress signals, and extend tests for the new behaviors/decoders.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| custom_components/robovac/init.py | Enables the new SELECT and SWITCH platforms for config entities. |
| custom_components/robovac/proto_decode.py | Adds protobuf encode/patch helpers; implements T2320 room-meta decode + room-clean mode payload build; enhances clean-param decode/merge. |
| custom_components/robovac/robovac.py | Extends DPS-code extraction to include model-provided extra codes (e.g., room meta). |
| custom_components/robovac/vacuum.py | Integrates new decoding/attributes (clean params, rooms); adds cloud room bootstrap; adjusts activity derivation; implements T2320 clean-param writes and room-clean payload handling. |
| custom_components/robovac/vacuums/T2320.py | Defines T2320 DPS codes/commands, activity mapping, and model-specific DPS decoders for station/progress/errors/prompts. |
| custom_components/robovac/sensor.py | Adds T2320 warning sensor and model-specific prompt decoding; makes consumables diagnostic and supports model-scoped consumable key sets; avoids duplicate clean-type sensor on config-entity models. |
| custom_components/robovac/select.py | New config selects for fan speed, clean type, mop level, and room selection (T2320-scoped). |
| custom_components/robovac/switch.py | New edge-mopping switch (T2320-scoped) that writes patched DPS 154. |
| tests/test_vacuum/test_config_entities.py | Tests that T2320 exposes config entities and other models do not; ensures no duplicate clean-type sensor on T2320. |
| tests/test_vacuum/test_dps_command_mapping.py | Updates T2320 DPS expectations (battery/error/fan/clean-param codes) and quiet-vs-pure display behavior. |
| tests/test_vacuum/test_proto_decode.py | Adds coverage for clean-param merging/patching, T2320 consumables decode, room-meta decode, and room-clean payload building. |
| tests/test_vacuum/test_robovac.py | Tests model-level extra DPS codes and T2320 consumables/room-clean code separation. |
| tests/test_vacuum/test_sensor.py | Adds/updates tests for diagnostic categories, warning sensor behavior, and “No error” semantics. |
| tests/test_vacuum/test_t2320_command_mappings.py | Updates/extends T2320 command mapping tests and adds decode tests for station/progress/errors/prompts. |
| tests/test_vacuum/test_vacuum_activity_lookup.py | Adds tests for case-insensitive activity mapping lookup helper. |
| tests/test_vacuum/test_vacuum_commands.py | Adds tests for T2320-specific pause/return payloads and clean-param patching behavior. |
| tests/test_vacuum/test_vacuum_entity.py | Adds activity-resolution tests for mode-only/return-progress cases and fixes a fan-speed formatting expectation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Conflicts: custom_components/robovac/vacuum.py
damacus
approved these changes
May 24, 2026
Contributor
Author
|
Merging #484 should resolve the CI failure seen previously on this PR branch (tested locally) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds focused support for the Eufy RoboVac X9 Pro / T2320 based on observed live DPS data.
This PR:
T2320 / X9 Pro DPS notes
prompt_NfallbackExposed T2320 controls
Observed payloads
AA==AggNAggMAggGBBoCCAE=AggOStation status is decoded from DPS 173, including observed numeric station codes for washing and drying.
Edge-mopping writes use the app-observed DPS154 payload shape. App-side on/off changes and HA-side on/off writes were both verified against a live X9 Pro.
Testing
34 passedflake8 custom_components testsmypy --python-version 3.14 custom_components/robovac595 passed, plus the existing unrelatedtests/test_config_flow.py::test_user_form_successteardown error from Tuya discovery opening blocked UDP sockets