Xiaomi Smart Home is one of the most popular automation platforms in the world, with more than 400 devices ranging from motion sensors to robot vacuum cleaners. But how do these devices interact? Why do some devices run without a gateway and others require a Mi Home Hub? And can you operate without a Mi Home cloud?
In this article, we will take a closer look at Xiaomiβs smart home architecture, from communication protocols (Zigbee, Wi-Fi, Bluetooth Mesh) to scripting logic and integration with third-party platforms like Home Assistant or Google Home. You will learn how data is transferred between sensors and actuators, what limitations the Mi Home cloud imposes, and how to circumvent them with local solutions. And for those who are just planning to build the system, here is a unique comparison of Xiaomi protocols on reliability, response speed and power consumption.
1. Basic architecture: what makes up a smart home Xiaomi
The ecosystem is based on a three-tier model:
- π± Control devices: smartphones with the Mi Home application, tablets, voice assistants (XiaoAI, Alice, Google Assistant).
- π Gateways and hubs: Mi Home Hub (Zigbee), Aqara Hub, Mi Gateway (older devices) provide communication between devices and the cloud.
- π‘ Actuators: lamps (Yeelight), sockets (Mi Smart Plug), sensors (movements, openings, leaks), cameras (Mi Home Security Camera), etc.
The key feature is hybrid topology: some devices connect directly to Wi-Fi (e.g., the Mi Robot Vacuum robot vacuum cleaner), and some operate through the gateway via Zigbee protocol (Aqara sensors, Mi Wireless Switch buttons), which creates a difference in response speed: So, the command to turn on the Yeelight lamp over Wi-Fi is performed for ~300 ms, and the signal from the motion sensor through Zigbee can be delayed up to 1-2 seconds due to the queue in the hub.
Itβs important to understand that Xiaomi doesnβt make all devices on its own, and Mi Ecosystem branded devices from partners (e.g. Yeelight, Aqara, security sensors), but theyβre all certified to work in a single system, which means that even devices from different manufacturers can participate in common scenarios, provided theyβre connected to the same Mi Home account.
2. Communication protocols: Zigbee vs Wi-Fi vs Bluetooth Mesh
The choice of protocol depends on the stability of the system, power consumption and scalability. Xiaomi uses all three basic standards, but with different goals:
| Protocol | Examples of devices | Pluses | Cons | Delayed response |
|---|---|---|---|---|
| Zigbee (through the gateway) | Aqara sensors, Mi Wireless Switch buttons, thermostats | Low power consumption, reliability, support for mesh-network | Requires hub, limit to 128 devices per gateway | 500β2,000 ms. |
| Wi-Fi (direct connection) | Yeelight lamps, Mi Smart Plug sockets, cameras | High speed, no need for a hub | High power consumption, router overload | 200-500 ms. |
| Bluetooth Mesh | Mi Bluetooth Temperature Sensors, Mi Bluetooth Button | Low power consumption, no link to the hub | Limited range, synchronization problems | 1000-3,000 ms. |
The critical nuance: devices on Zigbee and Bluetooth Mesh canβt communicate directly β they always need an intermediary (a hub or a smartphone). For example, if the Aqara motion sensor (Zigbee) is to turn on a Yeelight lamp (Wi-Fi), the signal will go the way: the sensor β lock β Mi Home cloud β It adds to the latency and the dependence on the Internet.
To minimize the lags, Xiaomi has implemented local scenarios (working without the cloud), but they are only available for single protocol devices. For example, the Aqara door opening sensor can directly control the Aqara siren through the gateway, but will not be able to turn on the Mi Smart Plug (Wi-Fi) outlet without cloud processing.
π‘
If you have a lot of Zigbee devices, place the gateway in the center of the house β this will reduce the number of βjumpsβ of the signal between the nodes of the mesh network and reduce delays.
3.The role of the gateway (Mi Home Hub) and whether it is possible to do without it
The Mi Home Hub (or Aqara Hub) gateway performs three key functions:
- π Zigbee Router: Organizes a Mesh Network for Devices (up to 128 per Hub).
- βοΈ Local processor: executes simple scenarios without a cloud (e.g., if the motion sensor is triggered) β light up").
- π Audible Alert: Replays alarms or voice notifications.
However, not all Xiaomi devices require a gateway.
- β‘ Zigbee devices (Aqara sensors, Mi Wall Switch switches).
- π For local automation (scenarios "if" β "the).
- π΅ To use the Mi Home Hub as a speaker (e.g. for alarm clocks).
In these cases, the gateway is not needed:
- πΆ For Wi-Fi devices (Yeelight lamps, Mi Smart plugs).
- π± To manage via the Mi Home cloud (even if the Zigbee device is connected to the friendβs hub).
- π€ For integration with Home Assistant or Google Home (if an alternative hub is used, for example, Zigbee2MQTT).
What happens if you turn off the airlock?
β οΈ Note: If you use the Mi Home Hub gateway (round, with a s) RGB-Note that it does not support Matter protocol and cannot be added to Apple HomeKit directly. M2 or third-party software like Home Assistant.
4.Mi Home Cloud: How it works and what data it collects
All Xiaomi Smart Home devices are connected to the Mi Home cloud by default, which performs two tasks:
- π Data storage: the history of sensors, automation logs, device settings.
- π Remote control: the ability to turn devices on/off from anywhere in the world.
However, cloud dependency has disadvantages:
- β³ Delays: The command to turn on the lamp can be executed up to 2-3 seconds (if the Mi Home servers are overloaded).
- π Privacy: Xiaomi collects metadata about device activity (e.g., light switching on time).
- π« Limitations: Some scenarios (e.g., using geolocation) only work through the cloud.
To reduce your dependence on the cloud, you can:
- Use local scripts (available in the Mi Home app for single-hub devices).
- Go to Home Assistant with Xiaomi Mi Home integration or Zigbee2MQTT.
- Set up alternative hubs (such as Sonoff Zigbee Bridge).
π‘
Local scenarios in Mi Home only work for devices connected to a single gateway, and if the script uses Wi-Fi devices (like a Yeelight lamp), the cloud will be activated anyway.
β οΈ Note: When using geolocated cloud scenarios (If I come home) β Turn on the lights) Mi Home tracks your smartphone coordinates to 100 meters. This data is stored on Xiaomi servers and can be shared with third parties (according to the privacy policy). β Settings β geodata.
5. Scenarios and Automation: How to Configure Device Interaction
The scripts in Mi Home are divided into three types:
- Local: operate through a gateway without a cloud (e.g., if the motion sensor is triggered) β light up").
- Cloud: require internet (e.g., if the temperature is above 25)Β°C β air-condition").
- Geolocation: triggered by the coordinates of the smartphone (for example, if I leave) β plug out").
To create a script:
- Open the Mi Home app and go to Automation β Create.
- Select a trigger (condition): for example, a motion sensor. β Traffic detected.
- Add an action: for example, a lamp β Turn on.
- Save the script and check it out in the Journal section.
The correct condition is indicated (e.g., βmovement detectedβ rather than βno movementβ)
The action is compatible with the device (for example, the lamp supports brightness control)
The scenario does not conflict with other automations.
Testing was conducted manually (button "Execute")
-->
An example of a complex scenario:
Condition: If (door opening sensor is operative) AND (time between 22:00 and 06:00) Action: Turn on Aqara siren for 30 seconds + send out a push notification
β οΈ Note: In multi-condition (E/OR) scenarios, Mi Home uses the short-circuit logic, which means that if the first condition is false (e.g., time is NOT between 22:00 and 6:00), the rest of the conditions are not checked.
6.Integration with Home Assistant and other platforms
If Mi Home is not enough, the system can be expanded with:
- π Home Assistant: Open platform with support for Xiaomi Mi Home and Zigbee2MQTT.
- π€ Google Home/Alexa: Voice control through the cloud.
- π Apple HomeKit: Only through Aqara hubs or plugins.
To connect to Home Assistant:
- Install Xiaomi Mi Home integration through HACS.
- Get a token for your Mi Home account (e.g., via miot-spec).
- Add configuration to configuration.yaml: miio: username: your login@email.com password: your servers password: - cn # or ru, de, us depending on the region
The advantages of Home Assistant over Mi Home:
- π Local management: scenarios work without the cloud.
- π Advanced Analytics: Energy Consumption Charts, Response History.
- π Support for Matter: Compatibility with other ecosystems.
π‘
If you use Xiaomi Zigbee devices with Home Assistant, replace the standard gateway with a new one. Zigbee2MQTT coordinator CC2652. This will eliminate delays and add support for devices from other manufacturers (e.g., the company's own devices, IKEA Tradfri).
7 Problems and Solutions: What to Do When the System Fails to Work
Common mistakes and ways to eliminate them:
| Problem. | Possible cause | Decision |
|---|---|---|
| The device does not connect to the hub | Too much distance or interference | Move the gateway closer or add a Zigbee repetitor (e.g., Mi Smart Plug socket) |
| Scripts don't work. | Conditions conflict or cloud delays | Check out the magazine in Mi Home β Automation β Switch to local scripts. |
| The lamp flashes or shuts off | Unstable power supply or Wi-Fi overload | Connect the lamp to another 2.4 GHz network or use a voltage stabilizer |
| Sensors discharge in 1-2 months | Frequent state surveys (polling) | Increase the survey interval in Home Assistant settings or disable unnecessary automations |
If the Zigbee device is constantly falling off the network:
- Check the signal level in Mi Home (Devices section) β Network status: Optimal level higher -80 dBm.
- Update the gateway firmware: Hub settings β Update of the PO.
- Reset the device to factory settings (hold the reset button for 5-10 seconds).