Skip to content

Add capability-based room cleaning for MIoT vacuums - #2913

Open
eduardobittencourt wants to merge 1 commit into
al-one:masterfrom
eduardobittencourt:feat/d102gl-room-cleaning
Open

Add capability-based room cleaning for MIoT vacuums#2913
eduardobittencourt wants to merge 1 commit into
al-one:masterfrom
eduardobittencourt:feat/d102gl-room-cleaning

Conversation

@eduardobittencourt

@eduardobittencourt eduardobittencourt commented Aug 5, 2026

Copy link
Copy Markdown

Summary

This PR adds Home Assistant room-cleaning support for MIoT vacuum entities whose device spec exposes a room map and room-sweep actions.

Implementation

  • Detects room-cleaning capability from the MIoT service spec (room_information, get_room_configs, and start_vacuum_room_sweep/start_room_sweep).
  • Adds the standard Home Assistant CLEAN_AREA feature to compatible vacuum entities.
  • Implements vacuum.get_segments room discovery and vacuum.clean_area segment routing.
  • Parses the common MIoT room-information JSON payload and generates the room-selection payload.
  • Keeps the implementation capability-based instead of adding a model-specific branch to vacuum platform setup.
  • Ensures generated vacuum entity IDs use the vacuum domain when a previous vacuum integration has been removed from the entity registry.
  • Adds unit coverage for room parsing and room-selection payload generation.

Validation

Validated with a Xiaomi X20 Pro D102GL using hass-xiaomi-miot in local/LAN mode on Home Assistant 2026.7.4:

  • The vacuum entity loaded with CLEAN_AREA.
  • vacuum/get_segments returned all 10 rooms from the robot map.
  • No real cleaning action was triggered during validation.
  • py_compile and git diff --check pass.
  • Full pytest could not be run in the local environment because pytest was unavailable.

@eduardobittencourt
eduardobittencourt force-pushed the feat/d102gl-room-cleaning branch from 0fa75f9 to b847ab9 Compare August 5, 2026 16:44
@eduardobittencourt eduardobittencourt changed the title Add room cleaning support for Xiaomi D102GL vacuums Add capability-based room cleaning for MIoT vacuums Aug 5, 2026
@eduardobittencourt
eduardobittencourt force-pushed the feat/d102gl-room-cleaning branch from b847ab9 to 1170c55 Compare August 5, 2026 16:49
@eduardobittencourt
eduardobittencourt marked this pull request as ready for review August 5, 2026 16:53
@eduardobittencourt
eduardobittencourt force-pushed the feat/d102gl-room-cleaning branch from 1170c55 to e740d4c Compare August 6, 2026 00:25
@eduardobittencourt
eduardobittencourt force-pushed the feat/d102gl-room-cleaning branch from e740d4c to d974880 Compare August 6, 2026 00:29
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