Add custom Roborock component with MQTT reconnect fix (python-roborock 4.18.1) - #1
Conversation
…oborock==4.18.1) Co-authored-by: ncecowboy <25276164+ncecowboy@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a custom (HACS-installable) copy of Home Assistant’s Roborock integration, primarily to pick up python-roborock==4.18.1 which includes an MQTT reconnect/backoff fix to prevent re-auth/rate-limit loops when there are no active MQTT subscribers.
Changes:
- Added a full
custom_components/roborockintegration copy (config flow, coordinators, entities, services, translations). - Bumped dependency pin to
python-roborock==4.18.1and added a componentversionfor HACS. - Added HACS metadata (
hacs.json) and updatedREADME.mdwith problem/fix/install documentation.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| hacs.json | Adds HACS repository metadata for the custom integration. |
| README.md | Documents the MQTT reconnect problem, the upstream fix, and installation steps. |
| custom_components/roborock/init.py | Sets up the integration, device manager, runtime coordinators, and platform forwarding. |
| custom_components/roborock/binary_sensor.py | Adds Roborock binary sensor entities and descriptions. |
| custom_components/roborock/button.py | Adds Roborock button entities (consumables, routines, A01 devices). |
| custom_components/roborock/config_flow.py | Implements config/reauth flows and options flow. |
| custom_components/roborock/const.py | Defines integration constants, platforms, and polling intervals. |
| custom_components/roborock/coordinator.py | Adds update coordinators for multiple device families and trait refresh logic. |
| custom_components/roborock/diagnostics.py | Adds config entry diagnostics with redaction. |
| custom_components/roborock/entity.py | Adds common entity base classes and coordinated entity helpers. |
| custom_components/roborock/icons.json | Provides icon translations for entities and services. |
| custom_components/roborock/image.py | Adds map image entities backed by coordinator/home traits. |
| custom_components/roborock/manifest.json | Declares integration metadata and pins python-roborock==4.18.1. |
| custom_components/roborock/models.py | Defines integration data models (device info/state/map info). |
| custom_components/roborock/number.py | Adds numeric configuration entities (e.g., volume). |
| custom_components/roborock/quality_scale.yaml | Declares integration quality scale checklist/status. |
| custom_components/roborock/roborock_storage.py | Adds cache/map storage via HA Store and cleanup for legacy map storage. |
| custom_components/roborock/select.py | Adds select entities for multiple device types (V1/B01/A01) and map selection. |
| custom_components/roborock/sensor.py | Adds sensor entities for multiple device families and diagnostics. |
| custom_components/roborock/services.py | Registers entity services (maps, goto position, current position). |
| custom_components/roborock/services.yaml | Declares service UI metadata for the integration’s services. |
| custom_components/roborock/strings.json | Adds translations for config flow, entities, services, and exceptions. |
| custom_components/roborock/switch.py | Adds switch entities for V1 and A01 devices. |
| custom_components/roborock/time.py | Adds time entities (DND/off-peak timers). |
| custom_components/roborock/vacuum.py | Adds vacuum entities and vacuum-specific services (segments, maps, goto position). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,46 @@ | |||
| """Support for the Airzone diagnostics.""" | |||
There was a problem hiding this comment.
The docstring references “Airzone” instead of Roborock, which is misleading for diagnostics/debugging. Please update it to reflect the Roborock integration.
| self.properties_api.clean_summary, | ||
| self.properties_api.dnd, | ||
| self.properties_api.dust_collection_mode, | ||
| self.properties_api.wash_towel_mode, | ||
| self.properties_api.smart_wash_params, | ||
| self.properties_api.sound_volume, | ||
| self.properties_api.child_lock, | ||
| self.properties_api.dust_collection_mode, | ||
| self.properties_api.flow_led_status, | ||
| self.properties_api.valley_electricity_timer, |
There was a problem hiding this comment.
dust_collection_mode appears twice in the trait refresh list, which causes redundant refresh calls and extra load. Remove the duplicate entry so each trait is refreshed only once per update cycle.
| # This currenltly only supports the WetDryVac protocols | ||
| self.request_protocols: list[RoborockDyadDataProtocol] = [ |
There was a problem hiding this comment.
Typo in comment (“currenltly”). Please correct to “currently” to keep comments professional and searchable.
| fields: | ||
| x: | ||
| example: 27500 | ||
| required: true | ||
| selector: | ||
| text: | ||
| type: number | ||
| y: | ||
| example: 32000 | ||
| required: true | ||
| selector: | ||
| text: | ||
| type: number |
There was a problem hiding this comment.
The service YAML declares x/y with a text selector even though the service schema coerces them to int. This mismatch can lead to a confusing UI and invalid input handling. Use a number selector (optionally with min/max/step) to reflect the expected integer coordinates.
| comment: | | ||
| The docs describe controlling the vacuum, though does not describe more | ||
| interesting potential integrations with the homoe assistant ecosystem. | ||
| dynamic-devices: todo |
There was a problem hiding this comment.
Typo in comment (“homoe assistant”). Please correct to “Home Assistant” to avoid spelling mistakes in repository docs/metadata.
| "no_user_agreement": { | ||
| "message": "You have not valid user agreement. Open your Roborock app and accept the agreement." | ||
| }, |
There was a problem hiding this comment.
The no_user_agreement exception message is grammatically incorrect (“You have not valid…”), which will be shown to users. Please update it to a correct phrasing (e.g., “You do not have a valid user agreement …”).
|
@copilot apply changes based on the comments in this thread |
…er selector, grammar fix Co-authored-by: ncecowboy <25276164+ncecowboy@users.noreply.github.com>
Applied all 6 review comments in commit
|
python-roborock==4.18.1includes the fix (PR #779: "don't reconnect on no active subscribers")custom_components/roborock/manifest.jsonto usepython-roborock==4.18.1(with the MQTT fix) and addversionfield for HACShacs.jsonfor HACS compatibilitydiagnostics.pydocstring: "Airzone" → "Roborock"coordinator.py: remove duplicatedust_collection_modeentry in trait refresh listcoordinator.py: typo "currenltly" → "currently"services.yaml: change x/y selector fromtexttonumber(with min/max/step/mode)quality_scale.yaml: typo "homoe assistant" → "Home Assistant"strings.json: grammar "You have not valid" → "You do not have a valid"Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.