-
-
Notifications
You must be signed in to change notification settings - Fork 19
feat(T2267, T2320): Fix commands and add activity mappings #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Claude creating it's own CLAUDE.md
Claude explination for proto-reference
Claude Code translations of Chinese to english, first pass, I ran out of tokens.
Summary Added T22xx series error codes to /workspaces/robovac/custom_components/robovac/errors.py based on proto-reference/error_code_list_t2265.proto. These error codes apply to the T2267 (RoboVac L60) and other T22xx series vacuums. Error Codes Added (40 new codes) Wheel errors (1xxx): - 1010-1013: Left wheel errors (open circuit, short circuit, error, stuck) - 1020-1023: Right wheel errors - 1030-1033: Both wheels errors Fan and brush errors (2xxx): - 2010, 2013: Suction fan errors - 2110-2112: Roller brush errors - 2210-2213: Side brush errors - 2310-2311: Dustbin/filter errors Water system errors (3xxx): - 3010: Water pump open circuit - 3013: Water tank insufficient Sensor errors (4xxx): - 4010-4012: Laser sensor errors - 4111-4112: Bumper stuck errors - 4130: Laser cover stuck Power and communication errors (5xxx): - 5014-5015: Low battery errors - 5110: WiFi/Bluetooth error - 5112: Station communication error Station errors (6xxx): - 6113: Dust bag not installed - 6310-6311: Hair cutting errors Navigation errors (7xxx): - 7000-7003: Robot trapped/suspended errors - 7010: Entered no-go zone - 7020-7021: Positioning failed errors - 7031-7034: Docking/undocking errors - 7040, 7050-7052: Navigation and route planning errors Troubleshooting Context Added Added detailed troubleshooting steps and common causes for 15 key error codes including wheel stuck, brush stuck, sensor blocked, docking failed, and robot trapped errors.
Summary Added T2320 (X9 Pro with Auto-Clean Station) specific error codes to /workspaces/robovac/custom_components/robovac/errors.py based on proto-reference/error_code_list_t2320.proto. Error Codes Added (32 new codes) Basic errors (26-55): - 26: Low battery - scheduled start failed - 31: Foreign objects stuck in suction port - 32: Mop holder rotating motor stuck - 33: Mop bracket lift motor stuck - 39: Positioning failed - check map - 40: Mop cloth dislodged - 41: Air drying device heater abnormal - 50: Machine accidentally on carpet - 51: Camera blocked - 52: Unable to leave station - 55: Station exploration failed Station and maintenance errors (70-83): - 70: Please clean dust collector and filter - 71: Wall sensor abnormal - 72: Robot water tank insufficient - 73: Station dirty water tank full - 74: Station clean water tank insufficient - 75: Station water tank missing - 76: Camera abnormal - 77: 3D TOF sensor abnormal - 78: Ultrasonic sensor abnormal - 79: Station clean tray not installed - 80: Robot and station communication abnormal - 81: Dirty water tank leaking - 82: Please clean station wash tray - 83: Poor charging contact Hardware module errors (101-119): - 101: Battery abnormal - 102: Wheel module abnormal - 103: Side brush module abnormal - 104: Fan abnormal - 105: Roller brush motor abnormal - 106: Water pump abnormal - 107: Laser sensor abnormal - 111: Rotation motor abnormal - 112: Lift motor abnormal - 113: Water spraying device abnormal - 114: Water pumping device abnormal - 117: Ultrasonic sensor abnormal - 119: WiFi or Bluetooth abnormal Troubleshooting Context Added Added detailed troubleshooting steps for 12 key T2320 error codes including mop holder issues, station water tanks, wash tray, and charging contact problems.
Using claude code to add new codes for the 2267 vaccum.
Implemented pattern-based matching for STATUS codes with dynamic timestamps.
Changes Made
1. custom_components/robovac/vacuums/base.py
- Added status_patterns field to RobovacModelDetails protocol
- Format: List[tuple[prefix, suffix, status_name]]
2. custom_components/robovac/robovac.py
- Added _match_status_pattern() method to match STATUS values against patterns
- Updated getRoboVacHumanReadableValue() to try pattern matching when exact lookup fails
3. custom_components/robovac/vacuums/T2267.py
- Removed individual timestamp codes
- Added status_patterns list with the positioning pattern:
status_patterns = [
("DA", "FSAA==", "Positioning"),
]
1. Added error pattern matching to robovac.py - Added a new _match_error_pattern() method and integrated it into getRoboVacHumanReadableValue() for ERROR commands. 2. Added error_patterns to T2267.py - Added a pattern that matches positioning/relocating status messages (starting with "DA", ending with "FSAA==") and maps them to "no_error". The value DAi65cqGwqLyzgFSAA== is a protobuf message indicating the vacuum is relocating/positioning. Your device is sending this on the ERROR DPS code (177) instead of STATUS (153). With this fix, the pattern is recognized and mapped to "no_error", which prevents it from triggering the error state in Home Assistant.
The T2267 vacuum commands were broken because they used incorrect DPS
codes without proper protobuf-encoded values.
Changes:
- START_PAUSE: Changed from code 156 (no values) to code 152 with
protobuf values for pause (AggN) and resume (AggO)
- STOP: Added new command using code 152 with protobuf value (AggM)
for STOP_TASK
- RETURN_HOME: Changed from code 173 (no values) to code 152 with
protobuf value (AggG) for START_GOHOME
All commands now correctly use the MODE DPS code (152) with their
respective ModeCtrlRequest.Method protobuf encodings:
- PAUSE_TASK (13) = "AggN"
- RESUME_TASK (14) = "AggO"
- STOP_TASK (12) = "AggM"
- START_GOHOME (6) = "AggG"
Added Troubleshooting Context for T2320 Error Codes Added troubleshooting steps and common causes for 23 additional error codes: - Station errors: 26, 55, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83 - Robot errors: 31, 39, 41, 50, 51 - Hardware errors: 101, 102, 103, 104, 105, 106, 107, 111, 112, 113, 114, 117, 119
T2230
1. Home Assistant Features table - Changed BATTERY status from "❌ Missing" to "✓ Via
Sensor" with note about HA 2025.8+ compliance
2. Current Commands table - Updated BATTERY row to indicate it's exposed via sensor entity
3. Recommended Fixes section - Marked the BATTERY fix as ✅ COMPLETED with details:
- Explanation of the deprecation in HA 2025.8
- Changes made to sensor.py
- Link to Home Assistant developer documentation
4. Notes section - Added note about battery sensor pattern
T2267
1. Home Assistant Features table - Changed BATTERY status from "❌ Missing" to "✓ Via
Sensor" with HA 2025.8+ compliance note
2. Recommended Fixes section - Marked the BATTERY fix as ✅ COMPLETED with:
- Explanation of the deprecation in HA 2025.8
- Changes made to sensor.py
- Link to Home Assistant developer documentation
3. Added Notes section with:
- Battery sensor pattern note (DPS code 163)
- Note about T2267's protobuf encoding vs T2320's string values
Porting functionality from T2267, which appears to be the same.
Changes Made to T2320
RETURN_HOME
- Before: Code 153 with boolean {"return_home": True}
- After: Code 152 with protobuf {"return": "AggG"} (START_GOHOME)
STOP (new)
- Added: Code 152 with protobuf {"stop": "AggM"} (STOP_TASK)
LOCATE
- Before: Code 160 with boolean {"locate": True}
- After: Code 160 (no values, same as T2267)
All commands now use the same protobuf-encoded approach as T2267, sending commands via DPS
code 152.
I've seen that 177 reports errors, but they don't seem like errors.
Adding ("Dw", "BSAA==", "Washing Mop"). Which appears to work.
The mop is noisy, difficult to test with my partner hating the
constant water noises.
This was taken from https://github.com/jeppesens/eufy-clean/tree/main/custom_components/robovac_mqtt/proto/cloud removing it from this repo. Doesn't need to be tracked, I will keep it local.
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| - | - | Generic Password | be5c309 | proto-reference/ble_pb2.pyi | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #317 +/- ##
==========================================
+ Coverage 72.33% 72.50% +0.17%
==========================================
Files 56 56
Lines 1858 1906 +48
==========================================
+ Hits 1344 1382 +38
- Misses 514 524 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think the GitGuardian Security Check is finding a bluetooth key form the decompiled eufy app, it can be ignored. |
|
This looks good. Did you use opus of sonnet on this one? It looks Ike it's found some stuff that I didn't know about 👍 I'll review properly on Monday |
|
I got the Pro plan, which I think is restricted to Sonet. |
damacus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First thing is we could use a symlink from AGENTS.md to CLAUDE.md
And make it slightly more generic when it comes to LLMs.
moving to the more standard AGENTS.md and leaving a symbolic link in It's place., so claude doesn't get convused. Is is mentioned as a work around in anthropics/claude-code#6235 (comment)
Summary
activity_mappingfor proper Home Assistant vacuum state reportingstatus_patternsanderror_patternsfor handling dynamic protobuf values with embedded timestampsChanges
T2267 (RoboVac L60)
START_PAUSEcommand: now uses code 152 with protobuf values (AggNfor pause,AggOfor resume)STOPcommand: uses code 152 with protobuf valueAggM(STOP_TASK method 12)RETURN_HOMEcommand: uses code 152 with protobuf valueAggG(START_GOHOME method 6)CLEAN_SPOTto homeassistant_featuresactivity_mappingfor VacuumActivity statesstatus_patternsfor matching positioning codes with dynamic timestampserror_patternsto filter false error statesT2320 (X9 Pro)
activity_mappingincluding station-specific statesstatus_patternsanderror_patternsfor dynamic value handlingCore Changes
base.py: AddSTOPcommand toRobovacCommandenumrobovac.py: Add pattern matching support for STATUS and ERROR codesvacuum.py: Integrate activity mapping and improve state handlingerrors.py: New file with 770+ error code definitions from protobuf referencesensor.py: Support model-specific battery DPS codesAcknowledgments
🤖 Generated with Claude Code