Zum Hauptinhalt springen

Xiaomi Home Smart-Home-Integration, kostenlos und Open Source

Xiaomi Home-Integration für Gladys Assistant

Robot vacuums paired in the Xiaomi Home app: state, start/stop, fan power, dock, battery.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Control the robot vacuums of your Xiaomi Home account from Gladys Assistant.

This integration targets robots paired in the Xiaomi Home (Mi Home) app. It talks to them directly over your local network, with an automatic fallback to the Xiaomi cloud when a robot is not reachable.

If your robot is paired in the Roborock app, it answers on an entirely different service: the Roborock integration is the one you need. Both can be installed at once if you use both apps.

Features​

For every robot of your account:

  • State — the operational state of the robot (cleaning, paused, returning to the dock, charging, docked, error…).
  • Run mode — start or stop a cleaning cycle.
  • Clean mode — the suction level (silent, balanced, turbo, max, gentle).
  • Dock — send the robot back to its charging dock.
  • Battery — the current battery level, in percent.
  • Last clean start and Cleaned today — when the last cleaning started, and whether it was today (1) or not (0). Use Cleaned today as a scene condition, for example to start a cleaning only if the robot has not run yet.

Scenes​

The robot can start a scene when it starts or finishes a cleaning, returns to its dock, runs low on battery (20 %), finishes charging, reports an error, when a consumable is worn (10 % left), or on any change of state.

A scene can also command the robot: start, pause, stop, return to the dock, clean some rooms (their names separated by commas, e.g. "Kitchen, Living room"), or set the suction power.

Scenes need Gladys 5.1.0 or later.

Map widget​

Add the Vacuum widget to a dashboard and pick your robot: it shows the battery, the cleaned surface, the map with your rooms, the state and the wear of each consumable, with Start and Dock buttons plus two buttons you choose in its settings. While the robot cleans, the map refreshes about every 15 seconds.

The map is fetched through the Xiaomi cloud, even when the robot answers on your local network. The robots built by Roborock (S5, S6, S7…) provide it, and so does the Xiaomi Robot Vacuum S20+.

Configuration​

  1. Click Connect: the Xiaomi sign-in page opens.
  2. Approve it (you can also scan it with the Xiaomi Home app).
  3. The badge turns green on its own.
  4. Open the Discovery screen and start a scan: your robots appear and can be added to Gladys.

You never type your Xiaomi password into Gladys, and this is only needed once: the session is stored and reused automatically after a restart.

There is nothing to configure: the Xiaomi server region, your robots, their local encryption keys and their IP addresses are all discovered automatically.

How it works​

The integration discovers your robots through the Xiaomi cloud, along with their local encryption key and IP address. Commands and state readings then go through the local network first (encrypted miIO protocol), falling back to the cloud when a robot is unreachable. The transport in use is shown as a badge on the device.

Turn off Prefer the local (LAN) connection when available in the integration settings to send commands through the Xiaomi cloud first instead, with the local network as the fallback.

Limitations​

  • Robot vacuums only. The name matches the app, but a Xiaomi Home account carries many other device types and none of them is handled here.
  • Among the robots Xiaomi builds itself (MIoT protocol), only the Xiaomi Robot Vacuum S20+ is supported so far: state, battery, suction, brushes, filter, the map, room cleaning and the start / pause / stop / dock commands. The last cleaning is not available on it.
  • Suction-level codes vary across model generations. If your model behaves differently, open an issue with the fan_power value visible in the debug logs.

Konfigurationseinstellungen​

Diese Einstellungen fragt Xiaomi Home in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Xiaomi accountaccount_linkNeinClick Connect and approve the sign-in on the Xiaomi page that opens. Your robot vacuums are then detected automatically — there is nothing else to fill in.

So installierst du Xiaomi Home in Gladys​

  1. Öffne in Gladys Integrationen: Xiaomi Home erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/callemand/gladys-xiaomi-home:1.4.0) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/callemand/gladys-xiaomi-home.

Xiaomi Home benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

Xiaomi Home ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von callemand veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂