matterbridge-xiaomi-roborock
v0.12.4
Published
Matterbridge plugin for Xiaomi and Roborock robot vacuums (Mi Home or Roborock app): expose them over Matter as a native robot vacuum to Apple Home, Google Home, Alexa, SmartThings or Home Assistant.
Maintainers
Readme
[!NOTE] Beta testers wanted
The maintainer no longer owns any of the supported models, so changes are developed against automated tests and validated by users on beta releases. If you'd like to help, sign up as a beta tester: you'll be mentioned when a beta needs a device like yours. See CONTRIBUTING.md for other ways to help. Co-maintainers are welcome too.
Matterbridge Xiaomi Roborock Plugin is a dynamic platform plugin for Matterbridge that integrates with Roborock vacuum cleaners controlled via the Xiaomi Home app, enabling control via Apple Home and other Matter-compatible apps. If you use the Roborock app, refer to the Matterbridge Roborock Platform Plugin instead.
[!TIP] Already using Homebridge? You don't need Matterbridge: homebridge-xiaomi-roborock-vacuum shows the robot as Apple Home's native robot vacuum too, through Homebridge's Matter support. It also offers zone cleaning, extra switches and sensors, a settings page in the Homebridge UI, and experimental support for the robots paired with the Roborock app. Both plugins are built on node-miio.
⭐️ If you like this project and find it useful, please consider giving it a star on GitHub at Matterbridge Xiaomi Roborock Plugin.
Features
- Basic RVC operations (start/stop/pause/resume/go back to dock)
- Fan speed control
- Water level control (only in supported models)
- Room cleaning and discovery (only in supported models)
- The room the robot is cleaning (Roborock, with the optional Xiaomi Cloud access)
- Battery information
Room cleaning and discovery
The plugin uses 2 methods to discover the rooms defined in the Xiaomi Home app, depending on the features supported by the model (and shown in the Xiaomi Home app):
- For supported models where the app allows to add names in the rooms, it is capable of retrieving the names from the
app.
- In some cases, the names configured in the app are not returned by this API (instead, it shows a long numeric value). In this case, you can use the
roomNamesconfiguration option to manually define the names.
- In some cases, the names configured in the app are not returned by this API (instead, it shows a long numeric value). In this case, you can use the
- For other models, it needs a workaround:
- In the Xiaomi Home app, while in the vacuum view, open the options by clicking on the 3 dots in the top right corner.
- Then, in "Timer", define a cleaning timer for midnight (00:00) that repeats every day. Make sure to select all the rooms individually.
- Make sure to disable the timer (nobody wants to kick off a cleaning at midnight every day 🙈).
- Finally, set up the
roomNamesin this plugin's configuration. Make sure to follow the same order as you selected the rooms in the app.
‼️ If you need to rely on the 2nd approach, chances are that the vacuum does not support the command to run room cleaning (
app_segment_clean). If you find the command that works for these models (testing vianode-miioorpython-miio), please open an issue or a PR to add this support.
Current room (Xiaomi Cloud, optional)
The robot doesn't tell which room it's in over the local network: only its map knows, and the map is in the Xiaomi
Cloud. With the cloud option, the plugin downloads the map while the robot cleans (every 10 seconds), and reports
the room it's in as Matter's current area. It only works with Roborock vacuums, for now.
Log in to your Xiaomi account once, as the same user that runs Matterbridge:
npx node-miio cloud login --qr # scan the QR code with the Mi Home appThe session is saved in node-miio's config directory (your password is never stored). If Matterbridge runs as another user or in Docker, copy that file where Matterbridge can read it, and set its path in
cloud.sessionFile.Enable it in the plugin's config:
"cloud": { "enabled": true }Optionally, set
cloud.server(de,us,cn…) to skip looking for the robot in every server.
With the cloud option, the robots' token is optional too: a robot configured with only its ip gets its token from
your Xiaomi account when the plugin starts. The IP must be the one the Mi Home app shows.
Even simpler, configure the robot with its device ID (did) instead of its IP and token:
{ "name": "Robot", "did": "123456789" }The plugin reads the IP and token from your Xiaomi account, and finds the robot again if they change: when the
robot stops answering (a new IP from the router, or a new token after resetting its Wi-Fi), the plugin asks the Xiaomi
account where it is now, and reconnects. The did is in the logs (Xiaomi Cloud: found "Robot" (did 123456789) at …)
and in npx node-miio cloud devices. A fixed IP for the robot in your router is still the most reliable setup: the
Xiaomi account only knows the new IP once the robot reports it.
If the session expires, the plugin logs a warning: log in again and restart the plugin.
TODO
- [ ] Improve state control
- [ ] Additional controls like initiate dust collection are missing
- [ ] Add information about the Maintenance counters (sensors, filter, brush)
- [ ] Add better error handling (expose the errors to the user if possible)
Supported models
The plugin talks to the robot with node-miio, so it supports the vacuums node-miio supports, paired with the Xiaomi Home app: the Roborock and Xiaomi miIO models, and any MIoT vacuum (Xiaomi, Dreame, Mijia…), driven by its spec from miot-spec.org. To check what node-miio resolves for your model:
npx node-miio spec your.model.idThese models have been confirmed by users:
| Model | Code name | Basic info (battery, serial, firmware) | Full cleaning | Room cleaning | Tested by |
| ---------------- | --------------------- | :------------------------------------: | :-----------: | :-----------: | :---------: |
| Roborock S5 | roborock.vacuum.s5 | ✅ | ✅ | ✅ | @afharo |
| Roborock S6 MaxV | roborock.vacuum.a10 | ✅ | ✅ | ✅ | @alexh-name |
If your model works (or doesn't), please open an issue or a PR to update this list.
Known issues
| Issue | Comment | Workaround |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------- |
| The name of the device is not automatically placed in Apple Home. | AFAIK, this happens to all Matterbridge devices (all show as Matterbridge Accessory). | The device must be renamed in the Home App. |
Installation
This plugin leverages the Matterbridge ecosystem, so you can install it in the same way as any other Matterbridge plugin.
ℹ️ This is not a Homebridge plugin. You need to install Matterbridge instead. If you already run Homebridge, see homebridge-xiaomi-roborock-vacuum.
Prerequisites
You need to have Matterbridge installed. Refer to their installation guide for more details.
Additionally, you need the IP and token of the RVC. The easiest way is to let the plugin read the token from your Xiaomi account: enable the Xiaomi Cloud and configure only the robot's ip, or its did. You can also print the tokens of all your devices with node-miio:
npx node-miio cloud login --qr # scan the QR code with the Mi Home app
npx node-miio cloud devices # name, model, IP and token of each device⚠️ If the RVC's Wi-Fi connection is reconfigured, a new token is generated, and you will need to retrieve it again, and update this plugin's configuration (unless the plugin reads it from the Xiaomi Cloud).
The same happens if the RVC is paired/controlled via the Roborock app.
If you already use homebridge-xiaomi-roborock-vacuum, the same IP and token can be used.
Add the plugin to Matterbridge and your devices to Apple Home (or any other Matter-compatible app)
Once on the Matterbridge UI, install this plugin using the name matterbridge-xiaomi-roborock, and configure it. After restarting Matterbridge, a new device should appear in the list of Devices in the Matterbridge UI, scan the QR code with the Apple Home app (or any other Matter-compatible app), and you should be good to go!
Support
I maintain this in my spare time, with help from Claude. Sponsorships go towards the subscription, so I can take on more feature requests and devices. ❤️ GitHub Sponsors · Ko-fi
