Skip to content

Add MIoT support for Xiaomi Robot Vacuum S40C EU - #2060

Open
borsuk85 wants to merge 5 commits into
rytilahti:masterfrom
borsuk85:master
Open

borsuk85 wants to merge 5 commits into
rytilahti:masterfrom
borsuk85:master

Conversation

@borsuk85

Copy link
Copy Markdown

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

codecov Bot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.55%. Comparing base (c5cc0f2) to head (c6a0fad).
⚠️ Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2060      +/-   ##
==========================================
+ Coverage   82.26%   84.55%   +2.29%     
==========================================
  Files         197      204       +7     
  Lines       19145    20977    +1832     
  Branches     1052     1133      +81     
==========================================
+ Hits        15750    17738    +1988     
+ Misses       3218     3047     -171     
- Partials      177      192      +15     

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

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.
@martinrevert

Copy link
Copy Markdown

@borsuk85 Hi Michal, did Teemu gave you some signal that he will merge this at some moment? Thanks.

@borsuk85

borsuk85 commented Sep 9, 2026

Copy link
Copy Markdown
Author

Hi, no, I haven’t received any signal from Teemu yet. The PR is ready from my side and was tested on real hardware, but I’m waiting for maintainer review/merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants