Skip to content

ijai: extend Pro2Vacuum (ijai.vacuum.v3) with map info and more controls - #2103

Draft
duvanjamid wants to merge 1 commit into
rytilahti:masterfrom
duvanjamid:ijai-v3-map-support
Draft

duvanjamid wants to merge 1 commit into
rytilahti:masterfrom
duvanjamid:ijai-v3-map-support

Conversation

@duvanjamid

Copy link
Copy Markdown

Extends Pro2Vacuum (Mi Robot Vacuum-Mop 2 Pro, ijai.vacuum.v3) using the public MIoT spec of the model. Follow-up of the (closed) #1388, where the model was reported as unsupported; basic support already exists on master.

Added

  • Map info (read-only): map_status() (current map id, number of maps, new-map flag) and get_maps() (stored maps: name, id, cur). They are not part of the _MAPPINGS, so status() does not request them on every poll.
  • Cleaning: start_sweep(), start_sweep_mop(), start_mop(), start_rooms(room_ids).
  • Settings: set_sweep_mode, set_water_level, set_mop_route, set_repeat, set_tank_shake, set_tank_shake_level, set_volume, set_dnd.
  • Misc: locate(), reset_consumable(), manual_control().
  • status() now also reports repeat state, door state, mop route, time zone, tank vibration (+ level), volume and do-not-disturb window.

Testing

  • New unit tests with the dummy MIoT device (test_pro2vacuum.py).
  • Checked on a real ijai.vacuum.v3 (firmware as reported by Mi Home 11.9.x), read-only: status(), map_status() and get_maps() return sane values.
  • The full test suite shows the same 5 failures (chunmi/cooker_multi) with and without this change on my machine (Python 3.14).

Not verified on hardware (why this is a draft)

  • start_rooms: room ids are sent as a comma separated string ("10,12") in piid 10 of siid 2 aiid 7; the spec only says "string".
  • set_dnd: the time zone (piid 6) is taken from the device (time_zone, siid 7 piid 20).
  • manual_control, reset_consumable, the setters and the start commands were only tested against the dummy device, because they move the robot or change its configuration.

Not included

Zone/point cleaning, virtual walls, schedules and cleaning preferences: the string formats are not documented in the spec. Map decoding is also out of scope (the map is uploaded to the Xiaomi cloud, encrypted; see vacuum-map-parser-ijai).

Happy to adjust anything or split this into smaller PRs.

Add read-only map info (map_status, get_maps) and more of the controls
exposed by the MIoT spec of ijai.vacuum.v3: cleaning modes, room cleaning,
water level, mop route, repeat, tank vibration, volume, locate, DND,
consumable reset and manual control. Extend status() with the matching
readable properties.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.68996% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.47%. Comparing base (9a00e08) to head (7a1a7c2).

Files with missing lines Patch % Lines
miio/integrations/ijai/vacuum/test_pro2vacuum.py 97.70% 1 Missing and 1 partial ⚠️
miio/integrations/ijai/vacuum/pro2vacuum.py 99.29% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2103      +/-   ##
==========================================
+ Coverage   84.31%   84.47%   +0.15%     
==========================================
  Files         201      201              
  Lines       20656    20883     +227     
  Branches     1121     1125       +4     
==========================================
+ Hits        17417    17641     +224     
- Misses       3047     3048       +1     
- Partials      192      194       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

This branch has not been deployed

No deployments
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.

1 participant