feat: add xiaomi.vacuum.ov21gl (Xiaomi Robot Vacuum 5 Pro) support#749
Open
luchusnet wants to merge 80 commits into
Open
feat: add xiaomi.vacuum.ov21gl (Xiaomi Robot Vacuum 5 Pro) support#749luchusnet wants to merge 80 commits into
luchusnet wants to merge 80 commits into
Conversation
…cted_libraries # Conflicts: # custom_components/xiaomi_cloud_map_extractor/vacuum_platforms/xiaomi_cloud_connector.py
…cted_libraries # Conflicts: # custom_components/xiaomi_cloud_map_extractor/camera.py # custom_components/xiaomi_cloud_map_extractor/common/image_handler.py # custom_components/xiaomi_cloud_map_extractor/manifest.json # custom_components/xiaomi_cloud_map_extractor/vacuum_platforms/backoff.py # custom_components/xiaomi_cloud_map_extractor/vacuum_platforms/xiaomi_cloud_connector.py
(based on code by @maksp86)
(based on code by @zpavlovic1986 and @m33ts4k0z)
…_libraries Add Xiaomi vacuum support and update manifest dependencies
…_libraries [Xiaomi vaccums] Added mapping for map property and d106gl exception
…/vacuum_xiaomi.py Co-authored-by: Piotr Machowski <6118709+PiotrMachowski@users.noreply.github.com>
…_libraries [Xiaomi] Handle plain text map name
- Fix map_room_info when all room_id=0 (firmware quirk on OV21GL): parser collapsed all rooms into one; use grid_id as unique identifier - Normalize fb_regions/fb_walls from firmware format to library format so no-go zones and virtual walls render correctly - Extract AI-detected obstacles (ai_obj) not handled by the library - Fix should_update_map to return True when LAN is unreachable during cleaning, so cloud map keeps being fetched during active sessions Tested on: xiaomi.vacuum.ov21gl (Xiaomi Robot Vacuum 5 Pro) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
@PiotrMachowski Friendly bump 🙂 I know #749 is large (~5K lines, since it bundles the full OV21GL device profile + map parsing additions). If a smaller piece would be easier to review first, I'm happy to split it — for example I could submit just the device registration and basic parsing as a smaller PR, with the more advanced features in follow-ups. Has been running on my OV21GL for a week without issues. Let me know what you'd prefer. |
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 support for
xiaomi.vacuum.ov21gl(Xiaomi Robot Vacuum 5 Pro), which uses the Xiaomi MiOT map format but has firmware-specific quirks that prevent it from working with the current implementation.Changes
Fix
map_room_infowhen allroom_id=0(firmware quirk)The OV21GL firmware sets
room_id=0for every entry inmap_room_info. The upstream parser usesroom_idas the dict key, causing every room to overwrite the previous one — resulting in only a single room being rendered.Fix: When all
room_idvalues are identical, replace each with the entry'sgrid_id, which is unique and matches theidfield used inroom_attrs.Normalize
fb_regions/fb_wallsto library formatThe OV21GL firmware uses a different format for no-go zones and virtual walls:
fb_regions:[{"fb_point": [x0,y0,x1,y1,x2,y2,x3,y3]}]fb_walls:[{"wall_points": [x0,y0,x1,y1]}]The
vacuum_map_parser_xiaomilibrary expects:fb_regions:[{"type": "no_go"|"wall", "points": [{"x":...,"y":...}, ...]}]Fix: Normalize firmware format before passing to the parser so no-go zones and virtual walls render correctly.
Extract AI-detected obstacles
The OV21GL firmware includes AI-detected obstacles in
ai_objwithin the map payload, using a format not handled by the upstream library.Fix: Parse
ai_objentries post-parse and inject them asObstacleobjects.Fix
should_update_mapwhen LAN is unreachable during cleaningWhen the vacuum is actively cleaning, the MiIO LAN connection often raises
DeviceException. The original code returnedFalsein this case, stopping map updates entirely during cleaning sessions.Fix: Return
Truewhen LAN is unreachable (but not due to an invalid token), so the cloud map continues to be fetched during active cleaning.Tested on
xiaomi.vacuum.ov21gl— Xiaomi Robot Vacuum 5 Pro