Skip to content

Conversation

@thjont
Copy link
Contributor

@thjont thjont commented Jan 24, 2026

Summary

  • T2267 (RoboVac L60): Fix pause, stop, return home, and locate commands using correct protobuf-encoded values
  • T2320 (X9 Pro): Add protobuf command support matching T2267 patterns, comprehensive status mappings for station states
  • Add activity_mapping for proper Home Assistant vacuum state reporting
  • Add status_patterns and error_patterns for handling dynamic protobuf values with embedded timestamps
  • Expand error code handling with 770+ error definitions
  • Add CLAUDE.md for AI-assisted development guidance

Changes

T2267 (RoboVac L60)

  • Fix START_PAUSE command: now uses code 152 with protobuf values (AggN for pause, AggO for resume)
  • Fix STOP command: uses code 152 with protobuf value AggM (STOP_TASK method 12)
  • Fix RETURN_HOME command: uses code 152 with protobuf value AggG (START_GOHOME method 6)
  • Add CLEAN_SPOT to homeassistant_features
  • Convert STATUS values from list to dict with human-readable names
  • Add comprehensive activity_mapping for VacuumActivity states
  • Add status_patterns for matching positioning codes with dynamic timestamps
  • Add error_patterns to filter false error states

T2320 (X9 Pro)

  • Add protobuf-encoded commands matching T2267 patterns
  • Add extensive STATUS values for station states (washing mop, drying mop, emptying dust, etc.)
  • Add activity_mapping including station-specific states
  • Add status_patterns and error_patterns for dynamic value handling

Core Changes

  • base.py: Add STOP command to RobovacCommand enum
  • robovac.py: Add pattern matching support for STATUS and ERROR codes
  • vacuum.py: Integrate activity mapping and improve state handling
  • errors.py: New file with 770+ error code definitions from protobuf reference
  • sensor.py: Support model-specific battery DPS codes

Acknowledgments

  • Protobuf configuration referenced from jeppesens/eufy-clean
  • Development assisted by Claude Code (Anthropic)

🤖 Generated with Claude Code

thjont added 19 commits January 24, 2026 22:00
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
Copy link

gitguardian bot commented Jan 24, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic Password be5c309 proto-reference/ble_pb2.pyi View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. 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


🦉 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
Copy link

codecov bot commented Jan 24, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.50%. Comparing base (4b73ec4) to head (e54c179).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
custom_components/robovac/vacuum.py 52.94% 8 Missing ⚠️
custom_components/robovac/robovac.py 95.83% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thjont
Copy link
Contributor Author

thjont commented Jan 24, 2026

I think the GitGuardian Security Check is finding a bluetooth key form the decompiled eufy app, it can be ignored.

@damacus
Copy link
Owner

damacus commented Jan 25, 2026

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

@thjont
Copy link
Contributor Author

thjont commented Jan 25, 2026

I got the Pro plan, which I think is restricted to Sonet.

Copy link
Owner

@damacus damacus left a 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants