How to Build a Xiaomi Smart Home: A Complete Guide from Device Selection to Automation

Xiaomi’s smart home ecosystem is one of the most affordable and functional on the market, allowing you to automate lighting, climate, security and even appliances, controlling everything from your smartphone or voice. But where to start? Many users are lost in the variety of sensors, hubs and scenarios, not knowing how to properly integrate them into a single system.

In this article, you will find a step-by-step algorithm for building a smart home based on Xiaomi, from selecting devices to fine-tuning automation. We will analyze typical beginner mistakes, tell you how to avoid conflicts between gadgets of different generations, and show you how to integrate the system with Alice, Google Assistant or Apple HomeKit.

If you've tried building a smart home before and you've had problems -- like sensors that don't sync or scripts that are late -- you'll find solutions here, and if you're planning to buy, you can avoid spending too much by choosing only the devices that you really need for your tasks.

1. Smart Home Planning: Where to Start?

The first step is to define automation goals, and without a clear plan, you risk buying a bunch of unnecessary sensors or encountering incompatibility.

  • πŸ”Ή What should a smart home do, lighting control, energy savings, security, climate control, or all of that?
  • πŸ”Ή What's the budget? Xiaomi ecosystem allows you to start with 5-10 thousand rubles (basic set) or delve into professional solutions for 50 + thousand.
  • πŸ”Ή Do you need integration with other brands? For example, if you already have Philips Hue smart bulbs, you'll need a hub with Zigbee 3.0 support.

The mistake most newcomers make is to buy devices at random, without considering communication protocols.

  • πŸ“‘ Wi-Fi (lamps, sockets, cameras) is simple, but loads the router.
  • πŸ•ΈοΈ Zigbee (sensors, switches) - energy efficient, requires a hub.
  • πŸ“Ά Bluetooth Mesh (some sensors) – suitable for small systems.

The critical detail is that if you choose devices with different protocols, you will need multiple hubs (e.g., Mi Home Hub for Zigbee and router for Wi-Fi), which will complicate the system.

πŸ“Š What communication protocol do you plan to use in a smart home?
Wi-Fi
Zigbee
Bluetooth Mesh
I don't know, I need help.

Basic set of start devices

Minimum set for lighting, safety and climate automation:

Type of deviceModel (recommended)Price (2026)Challenges
Hub (gateway)Xiaomi Mi Home Hub 2 (or Aqara Hub M2)~3 500 β‚½Management of Zigbee devices, communication with the cloud
Motion sensorXiaomi Motion Sensor 2~1 200 β‚½Automatic lighting, security
Smart lamp.Yeelight LED Bulb (or Xiaomi Mi LED Bulb)~1 500 β‚½Brightness adjustment, color temperature
Door opening sensorXiaomi Door/Window Sensor 2~900 β‚½Entry control, intrusion notifications
Smart socketXiaomi Mi Smart Plug (Wi-Fi)~1 300 β‚½Remote management of household appliances

Why are these devices? They cover 80 percent of everyday tasks:

  • πŸ’‘ Lamp + motion sensor = automatic lighting in the hallway or bathroom.
  • πŸšͺ Door sensor + hub = smartphone intrusion notifications.
  • ⚑ Socket = remote shutdown of the iron or heater.

If your budget is tight, start with a hub and 2-3 sensors. Xiaomi allows you to gradually expand the system by adding new devices.

πŸ’‘

Before buying, check device compatibility in the official Mi Home app (Add Device section) and some models older than 2020 may not support new firmware versions.

3. Connecting and setting up the Mi Home Hub

The hub is the brain of your smart home, without which Zigbee devices will not be able to communicate with the app.

  1. Download the Mi Home app (available for Android and iOS).
  2. Create a Xiaomi account (or sign in through an existing one).
  3. Connect the hub to the outlet and wait for the blue flashing of the indicator.
  4. In the app, click + β†’ Add the device β†’ Xiaomi Mi Home Hub.
  5. Follow the instructions on the screen (the application will find the hub in the Wi-Fi network).

Important nuances:

  • 🌐 Hub must be connected to 2.4 GHz network (not working with 5 GHz!).
  • πŸ”„ If the hub is not located, restart the router and try again.
  • πŸ“ Place a hub in the middle of the apartment, which will improve communication with sensors.

After connecting the hub, add other devices through the same Add Device section. The app will automatically determine the type of gadget (for example, Motion Sensor or Door Sensor).

β˜‘οΈ Preparation for Hub Setup

Done: 0 / 5

4. Creation of automation scenarios

Scripts are rules like "if... (trigger), then... (action)."

  • πŸŒ… If the motion sensor is activated after sunset, the lamp is activated by 30%.
  • πŸšͺ If the door opens during business hours, a notification is sent to the phone.
  • β˜€οΈ If the temperature rises above 25Β°C, the air conditioning (through a smart socket) is switched on.

How to create a script in Mi Home:

  1. Open the Automation tab (the βš™οΈ icon at the bottom of the screen).
  2. Click Add β†’ User Automation.
  3. Select a trigger (e.g., β€œMotion Sensor detected”).
  4. Specify the action (for example, "Lighten the lamp on 50%").
  5. Save the script and test it out.

⚠️ Warning: If the scenario doesn't work, check: πŸ”‹ Sensor battery charge (in the app displayed as a percentage). πŸ“Ά Signal level between hub and device (must be at least 2-3 divisions). ⏱ Time in the Mi Home app (if it's not synchronized, schedule scenarios don't work).

How to eliminate delays in scripts?
If the lamp is turned on with a delay of 1-2 seconds, the problem may be: 1. Overloaded hub (connected > 30 devices) - divide them into two hubs. 2. Weak Wi-Fi signal - connect the hub via an Ethernet cable (if the model supports). 3. Cloud processing - some scenarios work faster in local mode (configure in the "Additional parameters" hub).

5. Integration with voice assistants

You can control a smart home by voice through Alice (Yandex), Google Assistant or Siri.

  1. In the Mi Home app, go to Profile β†’ Settings β†’ Voice Assistants.
  2. Choose the service (Yandex, Google or Apple HomeKit).
  3. Log in and allow access to the devices.

Examples of voice commands:

  • πŸ—£οΈ "Alice, turn on the light in the living room" (if the lamp is called "Living room").
  • πŸ—£οΈ OK Google, set a temperature of 22 degrees (for a smart thermostat).
  • πŸ—£οΈ Siri, show the camera at the front door (if you have a Xiaomi Camera connected).

⚠️ Warning: Not all Xiaomi devices support HomeKit. Integration with Apple will require the Aqara Hub M2 hub (it is certified to work with HomeKit Secure Router).

If the voice assistant doesn’t see the device, check:

  • πŸ”„ Account Sync (Settings for the Assistant and Mi Home must have the same account).
  • 🌍 Region in the Mi Home app (must match the region of the assistant, e.g. Russia for Alice).

6. Advanced features: scripts and third-party services

For advanced users, Xiaomi offers:

  • πŸ€– Home Assistant is an open platform for creating complex scenarios (e.g., communication with non--Xiaomi devices).
  • πŸ“Š Node-RED is a visual automation editor (allows you to build logical chains).
  • πŸ”Œ IFTTT β€” Integration with services like Telegram or Google Sheets.

Example of Home Assistant:

  1. Install Home Assistant on the Raspberry Pi or NAS.
  2. Connect the Xiaomi hub through Xiaomi Miio integration.
  3. Create a script that, when the Xiaomi Smoke Detector is triggered, will say: Turn off the sockets (to prevent fires), turn on the siren (Xiaomi Alarm), send SMS to all family phones.

Example of code for Home Assistant (fragment)


automation:




- alias: "Fire alarm"




trigger:




platform: state




entity_id: binary_sensor.smoke_sensor




to: "on"




action:




- service: switch.turn_off




entity_id: switch.living_room_plug




- service: script.turn_on




entity_id: script.fire_alarm

⚠️ Warning: When using third-party services (such as Home Assistant), turn off cloud sync in Mi Home to avoid conflict. Otherwise, devices may duplicate commands.

7.Typical mistakes and how to avoid them

Even experienced users face challenges. Here are the most common:

Problem.Reason.Decision
Devices are disconnected from the hubWeak Zigbee signal or interference from other devicesMove the hub closer to the center of the apartment or add a repeater (e.g. Xiaomi Zigbee Repeater)
Scenarios are delayedCloud processing or an overloaded hubConfigure local scenarios (in hub settings) or split devices into two hubs
Sensors are discharged quickly.Low-quality batteries or frequent operationUse Duracell alkaline batteries and adjust the delay (e.g. 30 seconds for motion sensor)
Hub does not connect to Wi-FiIncorrect router frequency or blocking MAC- addressesSwitch the router to 2.4GHz mode and turn off MAC filtering

Another common mistake is ignoring firmware updates, Xiaomi regularly releases patches to fix bugs and add new features, to update the hub:

  1. Open Mi Home and select your hub.
  2. Go to Settings β†’ Update firmware.
  3. If a new version is available, click Update.

To calibrate, reboot the sensor (remove and insert the battery).

Can Xiaomi be connected to a smart home from another brand (such as Samsung SmartThings)?
Yes, but you'll need middleware like Home Assistant or OpenHab, which supports Zigbee and Wi-Fi, allowing devices from different vendors to be combined, but some features (such as proprietary Mi Home scripts) won't work.
How many devices can you connect to a single Xiaomi hub?
The official limit is 128 devices per Mi Home Hub 2. However, in practice, more than 50 devices can be delayed, and for large systems it is recommended to use multiple hubs or switch to professional solutions (for example, Aqara Hub M3).