npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-xiaomi-roborock-matter

v1.0.11

Published

Homebridge plugin exposing Xiaomi Roborock vacuums as Matter RoboticVacuumCleaner devices

Readme

Expose Xiaomi Roborock vacuum cleaners as Matter Robotic Vacuum Cleaner devices through Homebridge, using local miio LAN control.

This plugin is designed to keep runtime control local. Xiaomi Cloud is not used after setup; Homebridge talks to the vacuum over your LAN and exposes it through Homebridge's built-in Matter support.

Features

  • Matter Robotic Vacuum Cleaner accessory registration through Homebridge 2.x
  • Local Roborock control over miio
  • Start, pause, resume, and return-to-dock commands
  • Quiet, Vacuum, Deep Clean, and Max clean modes
  • Automatic LAN room discovery and Matter room selection
  • Battery and operational-state updates
  • miio model metadata when the vacuum reports it
  • Homebridge UI configuration schema

Requirements

  • Homebridge 2.0 or newer with Matter enabled
  • Node.js 22 or newer
  • Static LAN IP address for each Roborock
  • 32-character miio token for each Roborock

Local Network Control

This plugin communicates directly with the vacuum on your local network using the Xiaomi miio protocol. Starting, pausing, docking, status polling, fan-mode changes, and room discovery do not use the Xiaomi or Roborock cloud.

Homebridge and the vacuum must be able to reach each other on the same LAN. Assign the vacuum a static DHCP lease because both its IP address and miio token are used for the connection.

Extracting the miio Token

The token is a 32-character hexadecimal value, for example 0123456789abcdef0123456789abcdef. It is different from your Xiaomi account password.

Xiaomi Cloud Tokens Extractor

  1. Download and run the Xiaomi Cloud Tokens Extractor.
  2. Sign in with the Xiaomi account and region used by the Mi Home app.
  3. Find the vacuum in the returned device list.
  4. Copy its IP address and 32-character token into the Homebridge plugin settings.

python-miio

Install python-miio, then start its interactive Xiaomi Cloud device lookup:

pipx install python-miio
miiocli cloud

Select the correct Xiaomi region and copy the token shown for the vacuum. The Home Assistant Xiaomi Miio documentation also describes token retrieval methods.

Cloud access is needed only by these external extraction tools. Do not add your Xiaomi username or password to this plugin. The plugin stores only the IP address and token in the Homebridge configuration, never prints the token, and uses local miio communication during normal operation.

Some devices paired exclusively through the Roborock app may not expose a compatible Xiaomi miio token. This plugin requires a model and firmware that accept local miio commands.

Installation

Install from the Homebridge UI by searching for:

homebridge-xiaomi-roborock-matter

Or install from npm:

npm install -g homebridge-xiaomi-roborock-matter

Configuration

You can configure the plugin from the Homebridge UI, or add a platform entry manually:

{
  "platform": "XiaomiRoborockMatter",
  "devices": [
    {
      "name": "Living Room Vacuum",
      "ip": "192.168.1.100",
      "token": "0123456789abcdef0123456789abcdef",
      "pollInterval": 10000
    }
  ]
}

| Field | Required | Description | | --- | --- | --- | | name | Yes | Name shown in Matter controllers. | | ip | Yes | Vacuum LAN IP address. Use a static DHCP lease. | | token | Yes | 32-character hexadecimal miio token. | | pollInterval | No | State refresh interval in milliseconds. Defaults to 10000. | | rooms | No | Optional room name overrides or fallback mappings. Rooms are discovered over LAN. | | rooms[].name | Yes, when using rooms | Room name shown in Matter controllers. | | rooms[].segmentId | Yes, when using rooms | Roborock room segment ID from the active map. |

Room support uses get_room_mapping and app_segment_clean over the LAN. On startup, the plugin discovers segment IDs and room names before registering the Matter accessory. You can omit rooms entirely. Manual entries override a discovered room name with the same segment ID and act as a fallback when discovery is unavailable.

Matter Setup

Matter must be enabled in Homebridge. The plugin registers each configured Roborock as a Matter accessory through the Homebridge Matter API.

If the vacuum does not appear:

  • Confirm Homebridge Matter is enabled.
  • Confirm the Homebridge Matter bridge or accessory is commissioned in your Matter controller.
  • Check the Homebridge logs for Matter registration errors.

Supported Controls

| Matter control | Roborock action | | --- | --- | | Start cleaning | app_start | | Pause | app_pause | | Resume | app_start | | Return to dock | app_charge | | Quiet / Vacuum / Deep Clean / Max | set_custom_mode | | Room selection | app_segment_clean |

Mop-specific controls are not exposed yet. Mop-capable Roborock models usually require additional model-specific miio commands, so this plugin currently presents the device as a vacuum cleaner.

How It Works

Roborock vacuum
  <-> local miio LAN control
  <-> Homebridge plugin
  <-> Homebridge Matter
  <-> Apple Home / Google Home / other Matter controllers

Development

npm install
npm run lint
npm run build
npm pack --dry-run

npm run lint runs TypeScript in no-emit mode.

Troubleshooting

  • Matter is not enabled: enable Matter in your Homebridge bridge configuration.
  • Failed to connect: verify the vacuum IP, miio token, and LAN miio support.
  • Behaviors have errors: update to the latest plugin version and check Homebridge Matter logs.
  • Battery or status is stale: lower pollInterval, but avoid polling too aggressively.

Support Development

If this plugin is useful to you, donations help cover time spent testing devices, maintaining compatibility, and improving Homebridge Matter support.

License

MIT