The Wayback Machine - https://web.archive.org/web/20200206024603/https://github.com/rytilahti/python-miio
Skip to content
Python library & console tool for controlling Xiaomi smart appliances
Python
Branch: master
Clone or download
petrkotek and rytilahti Refactoring: Split Device class into Device+Protocol (#592)
* Extract command-sending functionality from Device class to new CommandSender class to separate concerns

* Rename CommandSender class to Protocol to better describe what it is
Rename do_discover() to send_handshake() & create a proxy method send_handshake() in Device class

* Device: bring back ip and token

* airfresh_t2017.py: fix tests after merge

* tests: bring back `return_values` to simplify the diff

* Device: update deprecation message

* Device: make protocol field private; don't deprecate Device.send method to keep everything compatible.
Protocol: update docstring to reflect new code.
Vacuum: expose raw_id from the Protocol.

* Rename Protocol class to MiIOProtocol
Latest commit 9a7c6c4 Jan 12, 2020

README.rst

python-miio

PyPI version Build Status Coverage Status Documentation status Black Hound

This library (and its accompanying cli tool) is used to interface with devices using Xiaomi's miIO protocol.

Supported devices

  • Xiaomi Mi Robot Vacuum V1, S5, M1S
  • Xiaomi Mi Home Air Conditioner Companion
  • Xiaomi Mi Air Purifier
  • Xiaomi Aqara Camera
  • Xiaomi Mijia 360 1080p
  • Xiaomi Mijia STYJ02YM (Viomi)
  • Xiaomi Mi Smart WiFi Socket
  • Xiaomi Chuangmi Plug V1 (1 Socket, 1 USB Port)
  • Xiaomi Chuangmi Plug V3 (1 Socket, 2 USB Ports)
  • Xiaomi Smart Power Strip V1 and V2 (WiFi, 6 Ports)
  • Xiaomi Philips Eyecare Smart Lamp 2
  • Xiaomi Philips RW Read (philips.light.rwread)
  • Xiaomi Philips LED Ceiling Lamp
  • Xiaomi Philips LED Ball Lamp (philips.light.bulb)
  • Xiaomi Philips LED Ball Lamp White (philips.light.hbulb)
  • Xiaomi Philips Zhirui Smart LED Bulb E14 Candle Lamp
  • Xiaomi Philips Zhirui Bedroom Smart Lamp
  • Xiaomi Universal IR Remote Controller (Chuangmi IR)
  • Xiaomi Mi Smart Pedestal Fan V2, V3, SA1, ZA1, ZA3, ZA4, P5
  • Xiaomi Mi Air Humidifier V1, CA1, CB1, MJJSQ
  • Xiaomi Mi Water Purifier (Basic support: Turn on & off)
  • Xiaomi PM2.5 Air Quality Monitor V1, B1, S1
  • Xiaomi Smart WiFi Speaker
  • Xiaomi Mi WiFi Repeater 2
  • Xiaomi Mi Smart Rice Cooker
  • Xiaomi Smartmi Fresh Air System VA2 (zhimi.airfresh.va2), T2017 (dmaker.airfresh.t2017)
  • Yeelight lights (basic support, we recommend using python-yeelight)
  • Xiaomi Mi Air Dehumidifier
  • Xiaomi Tinymu Smart Toilet Cover
  • Xiaomi 16 Relays Module
  • Xiaomi Xiao AI Smart Alarm Clock

Feel free to create a pull request to add support for new devices as well as additional features for supported devices.

Getting started

Refer the manual for getting started.

Contributing

We welcome all sorts of contributions from patches to add improvements or fixing bugs to improving the documentation. To ease the process of setting up a development environment we have prepared a short guide for getting you started.

Home Assistant support

You can’t perform that action at this time.