Skip to content

Add MIoT support for Xiaomi Robot Vacuum S40C EU#2060

Open
borsuk85 wants to merge 2 commits intorytilahti:masterfrom
borsuk85:master
Open

Add MIoT support for Xiaomi Robot Vacuum S40C EU#2060
borsuk85 wants to merge 2 commits intorytilahti:masterfrom
borsuk85:master

Conversation

@borsuk85
Copy link

Summary

Add a dedicated MIoT integration for xiaomi.vacuum.e101gb (Xiaomi Robot Vacuum S40C EU).

This model does not work correctly through the legacy RoborockVacuum path, but it is locally controllable through MIoT. This change adds a dedicated MiotDevice-based implementation instead of relying on GenericMiot.

What is included

  • new XiaomiVacuumE101GB integration
  • stable status() implementation using small get_properties batches
  • actions:
    • start
    • stop
    • pause
    • resume
    • home
    • find
    • start_room_sweep
    • start_zone_sweep
  • room helpers:
    • room_information
    • room_ids
    • zone_ids
    • get_room_configs
    • get_zone_configs
  • consumable reset actions:
    • main brush
    • side brush
    • filter

Implementation detail

The device does not always echo the request did in property responses and may return the device id instead. Because of that, the integration maps status responses by (siid, piid) instead of relying on did.

The generic MIoT status query is also too wide for this device and may time out, so status() intentionally reads a smaller, stable subset of properties in batches.

Verified on real hardware

Tested locally against:

  • model: xiaomi.vacuum.e101gb
  • firmware: 4.5.6_0127

Verified:

  • status reads correctly
  • home() works
  • room metadata is readable
  • start_room_sweep("3") starts cleaning
  • home() returns the vacuum to the dock afterwards

Tests

Added unit tests for:

  • status parsing
  • preset setters
  • action payloads
  • room/zone payloads
  • consumable resets
  • response mapping when the device returns device id instead of request did

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.55%. Comparing base (c5cc0f2) to head (36b123e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2060      +/-   ##
==========================================
+ Coverage   82.26%   82.55%   +0.29%     
==========================================
  Files         197      200       +3     
  Lines       19145    19466     +321     
  Branches     1052     1064      +12     
==========================================
+ Hits        15750    16071     +321     
  Misses       3218     3218              
  Partials      177      177              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Document Xiaomi Robot Vacuum S40C EU support

Fix Xiaomi S40C CI issues

Increase Xiaomi S40C test coverage
Breaks long lines in test assertions and dictionary comprehensions.
This improves code clarity and adherence to style conventions.
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