Smart home Xiaomi: how the system is designed and how to configure it from scratch

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.

πŸ“Š What Smart Home Platform Are You Using?
Xiaomi Mi Home
Aqara
Home Assistant
Google Home
Apple HomeKit
Another.

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:

ProtocolExamples of devicesPlusesConsDelayed response
Zigbee (through the gateway)Aqara sensors, Mi Wireless Switch buttons, thermostatsLow power consumption, reliability, support for mesh-networkRequires hub, limit to 128 devices per gateway500–2,000 ms.
Wi-Fi (direct connection)Yeelight lamps, Mi Smart Plug sockets, camerasHigh speed, no need for a hubHigh power consumption, router overload200-500 ms.
Bluetooth MeshMi Bluetooth Temperature Sensors, Mi Bluetooth ButtonLow power consumption, no link to the hubLimited range, synchronization problems1000-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:

  1. πŸ”„ Zigbee Router: Organizes a Mesh Network for Devices (up to 128 per Hub).
  2. ☁️ Local processor: executes simple scenarios without a cloud (e.g., if the motion sensor is triggered) β†’ light up").
  3. πŸ”Š 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?
Without a gateway, Zigbee devices will no longer send data to the cloud and execute scripts, but some (such as Aqara sensors with batteries) can continue to work offline, recording events in internal memory (up to 100 events), and once power is returned, the data is synchronized with the cloud.

⚠️ 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:

  1. πŸ“Š Data storage: the history of sensors, automation logs, device settings.
  2. πŸ”— 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:

  1. Use local scripts (available in the Mi Home app for single-hub devices).
  2. Go to Home Assistant with Xiaomi Mi Home integration or Zigbee2MQTT.
  3. 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:

  1. Local: operate through a gateway without a cloud (e.g., if the motion sensor is triggered) β†’ light up").
  2. Cloud: require internet (e.g., if the temperature is above 25)Β°C β†’ air-condition").
  3. Geolocation: triggered by the coordinates of the smartphone (for example, if I leave) β†’ plug out").

To create a script:

  1. Open the Mi Home app and go to Automation β†’ Create.
  2. Select a trigger (condition): for example, a motion sensor. β†’ Traffic detected.
  3. Add an action: for example, a lamp β†’ Turn on.
  4. 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:

  1. Install Xiaomi Mi Home integration through HACS.
  2. Get a token for your Mi Home account (e.g., via miot-spec).
  3. 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 causeDecision
The device does not connect to the hubToo much distance or interferenceMove the gateway closer or add a Zigbee repetitor (e.g., Mi Smart Plug socket)
Scripts don't work.Conditions conflict or cloud delaysCheck out the magazine in Mi Home β†’ Automation β†’ Switch to local scripts.
The lamp flashes or shuts offUnstable power supply or Wi-Fi overloadConnect the lamp to another 2.4 GHz network or use a voltage stabilizer
Sensors discharge in 1-2 monthsFrequent 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:

  1. Check the signal level in Mi Home (Devices section) β†’ Network status: Optimal level higher -80 dBm.
  2. Update the gateway firmware: Hub settings β†’ Update of the PO.
  3. Reset the device to factory settings (hold the reset button for 5-10 seconds).

FAQ: Frequent questions about Xiaomi smart home

Can I use Xiaomi devices without the internet?
Yes, but with limitations: πŸ”„ Zigbee devices will operate locally through the gateway (for example, a motion sensor will turn on the light). πŸ“΅ Wi-Fi devices (lamps, sockets) will be unavailable for management without the cloud. πŸ“± The Mi Home app won't show the status of the devices, but local scenarios will work.
How to transfer a Xiaomi smart home to another account?
Xiaomi officially does not support transferring devices between accounts.A workaround: Remove the device from your current account in Mi Home β†’ Settings of the device β†’ Reset the device to factory settings (usually hold the button 5-10 seconds). Add the device to the new account via Add the device. ⚠️ Zigbee devices will need to reset the entire gateway, which will remove all associated devices!
What Xiaomi devices support Matter?
At the beginning. 2026 Xiaomi has certified the following devices for Matter: πŸ’‘ Yeelight Pro lamps (models marked Matter in the title). πŸ”Œ Mi Smart Plug outlets 2 (only EU/US market). 🏠 Aqara Hub hubs M2 and Aqara Hub E1. Devices on Zigbee (such as Aqara sensors) do not support Matter directly, but can be integrated through the Aqara hub.
How to reduce the delay of scripts?
Optimization methods: πŸ”„ Use local scripts (only for single hub devices). πŸ“Ά Switch the gateway to the Zigbee channel with minimal interference (in the hub settings, select the channel). 11, 15 or 20). ☁️ Turn off cloud checks in Home Assistant (set up) polling_interval more often 60 seconds). πŸ”Œ Connect critical devices (such as a siren) directly to the hub, not through the cloud.
Can I use Xiaomi Smart Home with Apple HomeKit?
Yes, but with reservations: 🍎 Only Aqara hubs (e.g. Aqara Hub) are officially supported. M2). πŸ”„ Zigbee devices (sensors, switches) will be available in HomeKit via the hub. πŸ“΅ Wi-Fi devices (Yeelight lamps, sockets) require third-party bridges (for example, Home Assistant with the HomeKit Bridge plugin). QR-code on the device body in the Apple Home app.