All Projects → rytilahti → Python Miio

rytilahti / Python Miio

Licence: other
Python library & console tool for controlling Xiaomi smart appliances

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Miio

smart-home
🏡 My smart home setup built on top of Home Assistant
Stars: ✭ 140 (-92.98%)
Mutual labels:  home-automation, smart-home, home-assistant
Home Assistantconfig
🏠 Home Assistant configuration & Documentation for my Smart House. Write-ups, videos, part lists, and links throughout. Be sure to ⭐ it. Updated FREQUENTLY!
Stars: ✭ 3,687 (+84.81%)
Mutual labels:  home-assistant, home-automation, smart-home
Tuya-v2-Supported-Devices
A collection of all of the known working Tuya v2 Devices
Stars: ✭ 30 (-98.5%)
Mutual labels:  home-automation, smart-home, home-assistant
Miio
Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more
Stars: ✭ 1,669 (-16.34%)
Mutual labels:  home-automation, xiaomi, miio
Xiaomi Flower Care Api
Xiaomi Flower Care (MiFlora) API wrapper.
Stars: ✭ 111 (-94.44%)
Mutual labels:  home-automation, smart-home, xiaomi
zigbee
Database of Zigbee devices compatible with third party gateways: ZHA, deCONZ, Zigbee2MQTT, Tasmota, ZiGate, ioBroker,
Stars: ✭ 117 (-94.14%)
Mutual labels:  home-automation, smart-home, home-assistant
Home Assistant Config
🏠 Fully documented Home Assistant configuration for a smart-looking place. 😎 Be sure to ⭐️ my repo and copy ideas!
Stars: ✭ 258 (-87.07%)
Mutual labels:  home-assistant, home-automation, smart-home
Home Assistant Cli
💻 Command-line tool for Home Assistant
Stars: ✭ 243 (-87.82%)
Mutual labels:  home-assistant, home-automation, smart-home
Home Assistant Config
Home Assistant Configuration & Documentation for my Smart House.
Stars: ✭ 1,115 (-44.11%)
Mutual labels:  home-assistant, home-automation, xiaomi
Room Assistant
Presence tracking and more for automation on the room-level
Stars: ✭ 764 (-61.7%)
Mutual labels:  home-assistant, home-automation, smart-home
homeassistant
Home Assistant Config
Stars: ✭ 50 (-97.49%)
Mutual labels:  home-automation, smart-home, home-assistant
Homeassistant Config
Configuration for @brianjking & @KinnaT's Home Assistant Installation
Stars: ✭ 80 (-95.99%)
Mutual labels:  home-assistant, home-automation, smart-home
xiaomiplug
Xiaomi Mi Smart WiFi Socket integration for Home Assistant
Stars: ✭ 99 (-95.04%)
Mutual labels:  home-assistant, xiaomi, miio
ad-alexatalkingclock
Alexa (or other Smart Speakers) tell you the time without asking every hour. Please ⭐️if you like my app :)
Stars: ✭ 30 (-98.5%)
Mutual labels:  home-automation, smart-home, home-assistant
home-assistant-config
🏠 Home Assistant Configuration & Documentation for my smart home using Node-RED for automations. Press ⭐ for notification of updates.
Stars: ✭ 34 (-98.3%)
Mutual labels:  home-automation, smart-home, home-assistant
Home-Assistant-Main
My Home Assistant Configuration Be sure to ⭐ my repo so you can keep up to date on the daily progress!
Stars: ✭ 54 (-97.29%)
Mutual labels:  home-automation, smart-home, home-assistant
Home Assistant Config Fr
🏠Configuration de Home Assistant en français. 👨🏻‍💻 N'hésitez pas à ⭐ mon repo et à copier les bonnes idées ! 🇨🇵
Stars: ✭ 175 (-91.23%)
Mutual labels:  home-assistant, home-automation, smart-home
Openmqttgateway
MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility, SMS & LORA.
Stars: ✭ 2,413 (+20.95%)
Mutual labels:  home-assistant, home-automation, xiaomi
Miflora Mqtt Daemon
Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼🥀🏡🌳
Stars: ✭ 409 (-79.5%)
Mutual labels:  home-assistant, home-automation, xiaomi
Streamdeck Homeassistant
🏠 Use the Elgato Stream Deck as Home Assistant controller. Call any available service and toggle lights or resume your music.
Stars: ✭ 69 (-96.54%)
Mutual labels:  home-assistant, home-automation, smart-home

python-miio

Chat PyPI version PyPI downloads Build Status Coverage Status Documentation status Black

This library (and its accompanying cli tool) can be used to interface with devices using Xiaomi's miIO and MIoT protocols.

Getting started

If you already have a token for your device and the device type, you can directly start using miiocli tool. If you don't have a token for your device, refer to Getting started section of the manual for instructions how to obtain it.

The miiocli is the main way to execute commands from command line. You can always use --help to get more information about the available commands. For example, executing it without any extra arguments will print out options and available commands:

$ miiocli --help
Usage: miiocli [OPTIONS] COMMAND [ARGS]...

Options:
  -d, --debug
  -o, --output [default|json|json_pretty]
  --help                          Show this message and exit.

Commands:
  airconditioningcompanion
  ..

You can get some information from any miIO/MIoT device, including its device model, using the info command:

miiocli device --ip <ip> --token <token> info

Model: some.device.model1
Hardware version: esp8285
Firmware version: 1.0.1_0012
Network: {'localIp': '<ip>', 'mask': '255.255.255.0', 'gw': '<ip>'}
AP: {'rssi': -73, 'ssid': '<nnetwork>', 'primary': 11, 'bssid': '<bssid>'}

Each different device type is supported by their corresponding module (e.g., vacuum or fan). You can get the list of available commands for any given module by passing --help argument to it:

$ miiocli vacuum --help

Usage: miiocli vacuum [OPTIONS] COMMAND [ARGS]...

Options:
  --ip TEXT       [required]
  --token TEXT    [required]
  --id-file FILE
  --help          Show this message and exit.

Commands:
  add_timer                Add a timer.
  ..

Each command invocation will automatically detect the device model necessary for some actions by querying the device. You can avoid this by specifying the model manually:

miiocli vacuum --model roborock.vacuum.s5 --ip <ip> --token <token> start

API usage

All functionality is accessible through the miio module:

from miio import Vacuum

vac = Vacuum("<ip address>", "<token>")
vac.start()

Each separate device type inherits from miio.Device (and in case of MIoT devices, miio.MiotDevice) which provides a common API.

Each command invocation will automatically detect (and cache) the device model necessary for some actions by querying the device. You can avoid this by specifying the model manually:

from miio import Vacuum

vac = Vacuum("<ip address>", "<token>", model="roborock.vacuum.s5")

Please refer to API documentation for more information.

Troubleshooting

You can find some solutions for the most common problems can be found in Troubleshooting section.

If you have any questions, or simply want to join up for a chat, check our Matrix room.

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.

Supported devices

  • Xiaomi Mi Robot Vacuum V1, S4, S4 MAX, S5, S5 MAX, S6 Pure, M1S, S7
  • Xiaomi Mi Home Air Conditioner Companion
  • Xiaomi Mi Smart Air Conditioner A (xiaomi.aircondition.mc1, mc2, mc4, mc5)
  • Xiaomi Mi Air Purifier 2, 3H, 3C, Pro, Pro H (zhimi.airpurifier.m2, mb3, mb4, v7, vb2)
  • Xiaomi Mi Air (Purifier) Dog X3, X5, X7SM (airdog.airpurifier.x3, airdog.airpurifier.x5, airdog.airpurifier.x7sm)
  • Xiaomi Mi Air Humidifier
  • Xiaomi Aqara Camera
  • Xiaomi Aqara Gateway (basic implementation, alarm, lights)
  • Xiaomi Mijia 360 1080p
  • Xiaomi Mijia STYJ02YM (Viomi)
  • Xiaomi Mijia 1C STYTJ01ZHM (Dreame)
  • Xiaomi Mi Home (Mijia) G1 Robot Vacuum Mop MJSTG1
  • Xiaomi Roidmi Eve
  • 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
  • Huayi Huizuo Lamps
  • Xiaomi Universal IR Remote Controller (Chuangmi IR)
  • Xiaomi Mi Smart Pedestal Fan V2, V3, SA1, ZA1, ZA3, ZA4, ZA5 1C, P5, P9, P10, P11
  • Xiaomi Rosou SS4 Ventilator (leshow.fan.ss4)
  • Xiaomi Mi Air Humidifier V1, CA1, CA4, CB1, MJJSQ, JSQ, JSQ1, JSQ001
  • Xiaomi Mi Water Purifier (Basic support: Turn on & off)
  • Xiaomi Mi Water Purifier D1, C1 (Triple Setting)
  • 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), VA4 (zhimi.airfresh.va4), A1 (dmaker.airfresh.a1), 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
  • Smartmi Radiant Heater Smart Version (ZA1 version)
  • Xiaomi Mi Smart Space Heater
  • Xiaomiyoupin Curtain Controller (Wi-Fi) (lumi.curtain.hagl05)
  • Xiaomi Xiaomi Mi Smart Space Heater S (zhimi.heater.mc2)
  • Yeelight Dual Control Module (yeelink.switch.sw1)
  • Scishare coffee maker (scishare.coffee.s1102)
  • Qingping Air Monitor Lite (cgllc.airm.cgdn1)
  • Xiaomi Walkingpad A1 (ksmb.walkingpad.v3)
  • Xiaomi Smart Pet Water Dispenser (mmgg.pet_waterer.s1, s4)

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

Projects using this library

This library is used by various projects to support MiIO/MiOT devices. If you are using this library for your project, feel free to open a PR to get it listed here!

Home Assistant (official)

Home Assistant uses this library to support several platforms out-of-the-box. This list is incomplete as the platforms (in parentheses) may also support other devices listed above.

Home Assistant (custom)

Other related projects

This is a list of other projects around the Xiaomi ecosystem that you can find interesting. Feel free to submit more related projects.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].