External integration - Xiaomi MIoT (air purifiers, humidifiers, plugs…)

Hi everyone! :waving_hand:

Xiaomi vacuum cleaners already have their integrations (Xiaomi Home by @callemand, Roborock, Dreame). But the rest of the Mi Home ecosystem was still missing: air purifiers, humidifiers, fans, plugs, lamps… Here comes Xiaomi MIoT, which controls them locally.

What it does

  • No manually coded list of models: the integration reads the public specification of each model (miot-spec.org) and translates what it finds into Gladys devices:
    • Air purifiers: on/off, mode, speed, PM2.5, remaining filter, child lock;
    • Humidifiers and dehumidifiers: humidity, setpoint, tank;
    • Fans: speed, oscillation;
    • Plugs (with power consumption when measured);
    • Lights: brightness, color temperature, color;
    • Environmental sensors: temperature, humidity, PM2.5, PM10, CO2, brightness.
    • Heaters are displayed but never controlled: I prefer not to heat anything remotely.
  • A trigger « maintenance needed »: filter at 10% or less, empty tank, fault.
  • A scene action to set any property of a device, for advanced cases.
  • An « Air Quality » widget: PM2.5, humidity, filter, and on/mode buttons.
  • In French, English, German, and Spanish.

The cool part

PM2.5 above 35 → the purifier switches to max mode
Humidifier tank empty → notification
I leave the house → all Xiaomi plugs turned off

Installation

:warning: Gladys 5.1 minimum.

It will arrive in the store at the next indexer run. In the meantime: Integrations → Install from GitHub, with GitHub - guim31/gladys-xiaomi-miot: Xiaomi MIoT / Mi Home purifiers, humidifiers, fans, plugs and lights for Gladys Assistant, local miIO protocol · GitHub

  1. Import your devices from your Xiaomi account (email, password, account region; two-step verification is handled). The account is only used to retrieve the « tokens » of the devices, once: then, everything happens locally.
  2. Or add a device manually, with its IP address and token.
  3. Discovery tab: add them.

Honest small reservations

  • Developed without the hardware: everything was tested on the real specifications of 14 models, and I checked that the connection to the Xiaomi account goes well up to the real server, but nothing has run on a real purifier. Your feedback is welcome :folded_hands:
  • Vacuum cleaners, and Bluetooth or Zigbee devices that go through a Xiaomi gateway, are not managed here.

It relies on the work of hass-xiaomi-miot (Apache 2.0): thanks to al-one! Like the previous ones, developed with Claude Code. Independent project, not affiliated with Xiaomi.

Repository: GitHub - guim31/gladys-xiaomi-miot: Xiaomi MIoT / Mi Home purifiers, humidifiers, fans, plugs and lights for Gladys Assistant, local miIO protocol · GitHub