Skip to main content

Local control for Xiaomi/Dreame robot vacuums via MIoT protocol

Project description

xiaomi-vacuum

Local control for Xiaomi and Dreame robot vacuums via the MIoT protocol.

If your vacuum gives you user ack timeout when you try to control it locally — this library fixes that. Newer models (2023+) dropped the classic miio protocol. This uses MIoT instead, the same protocol the Mi Home app uses.

Install

pip install xiaomi-vacuum

Usage

Python

from xiaomi_vacuum import XiaomiVacuum

vac = XiaomiVacuum("192.168.1.100", "your_32char_token", "xiaomi.vacuum.d109gl")

vac.start()
vac.stop()
vac.home()

status = vac.status()
print(status)

CLI

xiaomi-vacuum --ip 192.168.1.100 --token YOUR_TOKEN --model xiaomi.vacuum.d109gl status
xiaomi-vacuum --ip 192.168.1.100 --token YOUR_TOKEN --model xiaomi.vacuum.d109gl start

Setup

Get your token

Use Xiaomi Cloud Tokens Extractor to get your device token.

Configuration

Create ~/.xiaomi-vacuum.json:

{
    "token": "your_32char_token",
    "model": "xiaomi.vacuum.d109gl"
}

Or set environment variables:

export XIAOMI_VACUUM_TOKEN=*** XIAOMI_VACUUM_MODEL="xiaomi.vacuum.d109gl"

Supported Devices

Any Xiaomi/Dreame vacuum with a MIoT spec on miot-spec.org. The library fetches the spec automatically.

Tested:

  • Xiaomi Robot Vacuum X20 Max (xiaomi.vacuum.d109gl)

How It Works

Newer Xiaomi vacuums dropped support for the classic miio RPC protocol. Commands like get_status and get_prop timeout with user ack timeout.

This library uses the MIoT action protocol instead — the same one the Mi Home app uses internally. It fetches the device spec from Xiaomi's official spec database and maps service/property IDs automatically.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xiaomi_vacuum-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xiaomi_vacuum-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file xiaomi_vacuum-0.1.0.tar.gz.

File metadata

  • Download URL: xiaomi_vacuum-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for xiaomi_vacuum-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0bf9166109b116f76d799ce541747f6f582b5e69338ec62cdf236aa891b8808d
MD5 d3a6994523ab43355b270ed08048c44b
BLAKE2b-256 02572ffbec07f73c26a03a804bd485df941b55c149e999525c4effbd7d480f35

See more details on using hashes here.

File details

Details for the file xiaomi_vacuum-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xiaomi_vacuum-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for xiaomi_vacuum-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fcc648d7a2ab23dfd37a3622207a8cd5e10e8e78780b3ced9baa8c93bc38db9
MD5 1a605c368bcc34a6b22137a72524fea4
BLAKE2b-256 6aaa800bee414566127e97ffae687d68432b09178aac044a84724fd93a8bfa09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page