--- id: python-miio version: "0.5.12" license: GPL-3.0-only license_treatment: copyleft maintenance: active --- # python-miio — Python library for interfacing with Xiaomi smart appliances License: copyleft · Maintenance: active · Downloads: 329.4K/mo ## What it is and what it does python-miio is a Python library and command-line tool for communicating with Xiaomi smart home devices using their proprietary miIO and MIoT protocols. It provides both a programmatic API (via classes like RoborockVacuum and Device) and a CLI tool (miiocli) for discovering devices, querying their status, and sending control commands. The library abstracts away protocol details and handles device model detection automatically. The package supports a wide range of Xiaomi and compatible devices—robot vacuums, air purifiers, fans, smart plugs, lights, humidifiers, and others—each exposed through a dedicated module. It is actively used by Home Assistant for official device integration. Installation is straightforward with low friction, though operation requires obtaining a device token and network access to the target device. Use it for: - Control a Xiaomi robot vacuum from Python or the command line without proprietary apps. - Automate Xiaomi smart home devices in a home automation system. - Query device status and execute device-specific commands via miiocli. - Build custom integrations for unsupported Xiaomi devices by extending the Device or MiotDevice base classes. - Monitor and control air purifiers, humidifiers, and environmental devices on a local network. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python library and CLI tool for controlling Xiaomi smart devices using the miIO and MIoT protocols over the network. Yes, if you own Xiaomi smart devices and want programmatic or CLI control without relying on cloud services or proprietary apps. The library is stable, actively maintained, and widely used. The copyleft GPL-3.0-only license is a consideration if you plan to distribute derivative work. No known security vulnerabilities as of the query date. ## Install pip install python-miio uv add python-miio poetry add python-miio ## Installing python-miio Before you install: Low install friction with a pure Python wheel. Active maintenance as of 2026-07-25 with 4285 repository stars. Supports Python 3.7 through 3.10. License in practice: Licensed under GPL-3.0-only (copyleft). Any derivative work or bundled distribution must also be open-source under compatible terms. Quickstart: pip install python-miio from miio import RoborockVacuum vac = RoborockVacuum("", "") vac.start() Requires a valid device token and network connectivity to the target Xiaomi device. Verify before relying: - Whether all 15 runtime dependencies are truly required for basic operation or if some are optional for specific device types. - Current maintenance status beyond the last commit date—whether active development continues or the project is in maintenance-only mode. - Specific IP address and token format requirements for device connection. ## Package facts - License: GPL-3.0-only (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 329.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags xiaomi smart home control, miio protocol interface, xiaomi device automation, smart appliance command line, xiaomi vacuum robot control, miot device management, home automation xiaomi, smart-home, iot-control, xiaomi-devices [View on SkillFed](https://skillfed.io/packages/python-miio) · [View on PyPI](https://pypi.org/project/python-miio/)