Xiaomi gateways and Mi Home in a smart home (Oct 2026): which integration to use, miIO tokens, regions and local control

Discuss the Xiaomi Mi Hub and various Xiaomi Appliances
Post Reply
User avatar
ZerOne
Site Admin
Posts: 216
Joined: Sun Dec 13, 2020 8:21 am

An overview for this forum of how Xiaomi/Mijia/Aqara-style hubs and devices can be brought into Home Assistant and similar platforms, and where the traps are for Australian users. It is based on the Home Assistant "Xiaomi Home" integration docs, the python-miio documentation, Xiaomi's official ha_xiaomi_home README and the Valetudo docs as at October 2026. I have not tested every device, so please add what you know.

The main routes
  • Home Assistant's built-in "Xiaomi Home" integration (the xiaomi_miio code). You add the device in the Xiaomi Home app first, then in Home Assistant you sign in with your Xiaomi Home account and pick the server region you use. Home Assistant retrieves the device's connection info and API token, then talks to the device over your local network. Manual setup with an IP address and 32-character token exists but is marked "not recommended". Supports vacuums, air purifiers, humidifiers, fans, air quality monitors, IR remotes and Xiaomi gateways and some subdevices.
  • Xiaomi's official "Xiaomi Home" integration (ha_xiaomi_home), installed via HACS or git from GitHub. It logs in with OAuth 2.0 and controls devices through the Xiaomi cloud. Its README says local mode needs a Xiaomi central hub gateway, which it says is only available in mainland China, and lists the regions it supports as mainland China, Europe, India, Russia, Singapore and the USA. Australia is not on that list, so check whether your account works before investing time. It also offers a partial "LAN control" for Wi-Fi/Ethernet devices, but the README recommends against enabling it.
  • python-miio / miiocli, the community library that most of these integrations are built on. Great for testing and for devices that HA does not cover.
  • Valetudo, a cloud-free replacement software for some robot vacuums. See the cautions below.
  • For Zigbee devices behind a Xiaomi gateway, many people instead move them to a Zigbee coordinator with ZHA or Zigbee2MQTT and retire the gateway. Check the Zigbee threads.
Gateways in Home Assistant

The HA docs list gateway models and their Zigbee IDs: the Chinese version (DGNWG02LM, lumi.gateway.v3), the Mijia Zigbee 3.0 gateway (ZNDMWG03LM), the Aqara hub (ZHWG11LM) and the European version (ZHWG11LM-763 / DGNWQ05LM, lumi.gateway.mieu01), among others. For the European version, the docs say it is supported "with Xiaomi Home credentials", and that some gateways like it cannot list their subdevices locally. For those you turn on "Use Xiaomi Home service to get connected subdevices" in the integration options, after which HA gets the list from Xiaomi Home but controls the devices and receives status updates locally. Gateway features include an alarm panel, a light and an illuminance sensor. Several other models are marked "Not tested".

Regions

When you sign in to Xiaomi Home, the "server region" matters because accounts and devices are isolated per region. Xiaomi Home regions are listed on a country server list that the HA docs link. If your Australian account uses a region such as Singapore or the USA, choose the same one in Home Assistant. python-miio's cloud token tool prompts for a locale from a list (all, cn, de, i2, ru, sg, us), and "all" is available if you are not sure.

Things that bite
  • Subnets and VLANs. Both the HA docs and python-miio say Xiaomi devices may not respond if the request comes from a different subnet. python-miio's troubleshooting page explains the root cause as the UDP packet's source address not belonging to the device's subnet. Workarounds: put the client and device in the same subnet, dual-home the client (physically or with VLANs, with a local firewall protecting the client), or use IP masquerading on the router interface in the device's subnet. Test before you design a VLAN layout.
  • Use the Xiaomi Home app, not a vendor app. The HA docs say a Roborock vacuum connected through the Roborock app will not be discovered. It needs to be paired with the Xiaomi Home app. Re-pairing generates a new token.
  • Blocking internet access. If you block a vacuum's internet access, use a firewall REJECT rather than a silent DROP, otherwise the device software can hang until its watchdog restarts it (HA and python-miio docs).
  • Tokens. The 32-character token is the key to controlling the device locally. Treat it like a password.
Privacy and security
  • Change default Wi-Fi/gateway passwords, keep firmware updated through the app, and put gateways and vacuums with cameras or microphones on an isolated IoT network.
  • A vacuum with a camera or lidar maps your home. Decide whether you are comfortable with cloud connectivity, and note the rest of this thread about Valetudo.
  • Some gateways include an alarm function and a light. Check which cloud features you are enabling in the app.
Valetudo (cloud-free vacuums): read before you jump

Valetudo describes itself as an opinionated cloud-free software for vacuum robots. Its docs state that the list of supported robots is exhaustive and that a robot not on the list is not supported. It includes Roborock, Dreame and some other brands. Its "Why not Valetudo?" page contains sections such as "Reverting to stock is impossible", "Valetudo will expose you" and "Only supported robots are supported", so read it first. Rooting a robot may void a warranty and carries a real risk of making it unusable. Follow the project's own installation guide for your exact model.

Links
Question for the group: which Xiaomi hub or devices are you running in Australia, and which integration (built-in, official, python-miio, or a Zigbee coordinator replacement) works best for you? Which region did your Mi Home account end up in?
Post Reply

Return to “Xiaomi Mi Hub Discussion”