Skip to content

feat: add xiaomi.vacuum.ov21gl (Xiaomi Robot Vacuum 5 Pro) support#749

Open
luchusnet wants to merge 80 commits into
PiotrMachowski:devfrom
luchusnet:feature/ov21gl-support
Open

feat: add xiaomi.vacuum.ov21gl (Xiaomi Robot Vacuum 5 Pro) support#749
luchusnet wants to merge 80 commits into
PiotrMachowski:devfrom
luchusnet:feature/ov21gl-support

Conversation

@luchusnet

Copy link
Copy Markdown

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_info when all room_id=0 (firmware quirk)

The OV21GL firmware sets room_id=0 for every entry in map_room_info. The upstream parser uses room_id as the dict key, causing every room to overwrite the previous one — resulting in only a single room being rendered.

Fix: When all room_id values are identical, replace each with the entry's grid_id, which is unique and matches the id field used in room_attrs.

Normalize fb_regions / fb_walls to library format

The 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_xiaomi library 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_obj within the map payload, using a format not handled by the upstream library.

Fix: Parse ai_obj entries post-parse and inject them as Obstacle objects.

Fix should_update_map when LAN is unreachable during cleaning

When the vacuum is actively cleaning, the MiIO LAN connection often raises DeviceException. The original code returned False in this case, stopping map updates entirely during cleaning sessions.

Fix: Return True when 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

PiotrMachowski and others added 30 commits August 16, 2023 03:41
…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
---
* Add config flow
* Migrate to async
* Add map data caching
(based on code by @maksp86)
(Based on code by @maksp86 and @j1kwen)
PiotrMachowski and others added 29 commits November 18, 2025 03:34
…_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>
@luchusnet

Copy link
Copy Markdown
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.

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.

4 participants