How to build a Xiaomi smart home with your own hands: from the choice of devices to the setup of automation

Why Xiaomi is the Best Choice for a Smart Home

Xiaomi’s ecosystem has long since ceased to be just a smartphone manufacturer β€” today it is a full-fledged provider of solutions for the smart home, which offers more than 200 compatible devices. From door opening sensors to robot vacuum cleaners β€” all gadgets work in a single system Mi Home (now Aqara Home), making them an ideal choice for self-assembly. The main advantage is the price is 30-50% lower than the counterparts from Samsung SmartThings or Apple HomeKit with comparable functionality.

But how do you get lost in the variety of devices and build a system that will work steadily? In this article, we will analyze the step-by-step algorithm: from choosing a central hub to setting up complex automation scenarios. You will learn which devices are necessary to start, how to avoid typical connection errors and how to integrate the system with Alice, Google Assistant or Siri. No water is only proven solutions based on user experience and official Xiaomi documentation.

Step 1: Choosing a central hub is the heart of a smart home

Without a hub, most Xiaomi devices will not be able to communicate with each other, and it is responsible for Zigbee communication, command processing, and script execution. In 2026, three models are relevant:

  • πŸ”Ή Xiaomi Mi Smart Home Gateway 3 – basic model with support for up to 32 devices, built-in speaker and RGB-Suitable for apartments up to 50 mΒ².
  • πŸ”Ή Aqara Hub M2 β€” Extended version with Zigbee 3.0 support, Ethernet port and backup power option, optimal for 100-square homes+ Β².
  • πŸ”Ή Redmi Smart Home Gateway is a budget option with no backlighting, but with support for all key features.

Critical: the hub needs to be plugged into the outlet 24/7. When the power goes out, all automation scenarios will stop working and sensors will lose communication. If there are frequent power outages in your region, consider an Aqara Hub M2 with a backup battery or connect the hub via UPS (Uninterruptible Power Supply).

⚠️ Note: Xiaomi hubs are tied to the region when you first connect. If you bought a device in a Chinese store (for example, on AliExpress), it may not be possible to add it to the European or Russian version of the Mi Home application!

Hub modelMax. Devices.Zigbee versionAdditional functionsPrice (2026)
Mi Smart Home Gateway 332Zigbee 1.2RGB-lighting, speaker~2 500 β‚½
Aqara Hub M2128Zigbee 3.0Ethernet, backup power~4 000 β‚½
Redmi Smart Home Gateway32Zigbee 3.0Unlit.~1 800 β‚½
πŸ“Š What hub do you plan to use?
Xiaomi Mi Smart Home Gateway 3
Aqara Hub M2
Redmi Smart Home Gateway
I haven't decided yet.

Step 2: Basic set of devices to start

To make the system bring real benefits, and not a set of useless gadgets, start with a minimum working kit:

  1. Security sensors: Xiaomi Mi Door/Window Sensor 2 (for doors/windows) and Xiaomi Mi Motion Sensor 2 (motion sensor) will allow you to track penetration and turn on light when you move.
  2. Smart outlets: Xiaomi Mi Smart Plug (with energy consumption measurement) or Aqara Smart Plug. Necessary for remote control of household appliances.
  3. Smart lamps: Yeelight LED Bulb (color) or Xiaomi Mi LED Smart Bulb (white light). Yeelight lamps support more colors, but require a separate application.
  4. Smart thermostat: Aqara Temperature & Humidity Sensor + Aqara Smart Radiator Valve (for heating adjustment).

The average cost of this type of package is about 8 000 β‚½. It's in 2-3 The rule of thumb is to buy Zigbee-enabled devices (not just Wi-Fi) that work through a hub even when the internet is down.

πŸ’‘

If you live in a private home, add to the base set Xiaomi Mi Water Leak Sensor – it will notify you of a leak in the basement or kitchen, which will help to avoid flooding.

Step 3: Connect devices to the hub and app

The process of adding devices is the same for all Xiaomi gadgets:

  1. Install the Mi Home app (or Aqara Home if you use the Aqara hub).
  2. Create an account and select a region (important! it should match the hub region).
  3. Click + β†’ Add the device and select a category (e.g., β€œSensors”).
  4. Activate the pairing mode on the device (usually you need to press the button for 3-5 seconds until the indicator blinks).
  5. Wait until the connection is completed (it can take up to 1 minute).

Typical problems with connection:

  • πŸ”Œ Device not located: check that the hub is plugged in and connected to Wi-Fi. The distance between the hub and the sensor should not exceed 10 meters (no obstacles).
  • πŸ“Ά Unable to connect error: Reboot the hub (pull out the plug for 10 seconds) and try again.
  • πŸ”„ Device added, but not working: update the firmware hub in the settings of the application.

⚠️ Note: Some devices (e.g. Xiaomi Mi Robot Vacuum) connect directly to Wi-Fi, not via a hub.They need to be added separately in the same app, but they will not participate in Zigbee scenarios.

β˜‘οΈ Checklist before connecting devices

Done: 0 / 4

Step 4: Setup automation and scenarios

The most interesting part is creating automatic scripts that will be executed without you.

  • πŸ’‘ Turn on the light in the corridor when driving from 18:00 to 23:00.
  • πŸšͺ Send a notification to your phone if the door is open for more than 5 minutes.
  • β˜€οΈ Close smart curtains if the brightness of the sun exceeds 50,000 lux (illumination sensor).

How to create a script:

  1. In the Mi Home app, go to Profile β†’ Automation β†’ Create.
  2. Select a condition (e.g., "Motion Sensor Acted").
  3. Add an action (e.g., "Switch on the lamp").
  4. Set up additional settings (time, days of the week, delay).
  5. Save the script and test it out.

For complex scenarios (such as those with delays or multiple conditions), use Aqara Home, which has more flexibility.

IF (Motion Sensor Activated) AND (Time between 22:00 and 6:00) AND (Lighting < 10 lux),


Turn on the lamp for 5 minutes, then turn off.

An example of a complex scenario for saving electricity
IF (room temperature > 25Β°C) AND (Nobody is home by geolocation), THE Switch off all outlets except the fridge and close the curtains, which is a scenario that reduces energy consumption by 15-20% on hot days.

Step 5: Integration with voice assistants

To control your smart home, connect it to Alice (Yandex), Google Assistant or Siri (via HomeKit).

  1. In the Mi Home app, go to Profile β†’ Settings β†’ Voice Assistants.
  2. Select the service (Yandex, Google or Apple) and log in.
  3. Confirm access to devices (only those that need to be controlled by voice can be selected).
  4. In the assistant application (Yandex, Google Home or Home on iOS), synchronize your devices.

After setting up, you can use commands:

  • 🎀 "Alice, turn on the light in the living room" (if the lamp is called "Living room").
  • 🎀 "Okay, Google, show me the temperature in the kitchen".
  • 🎀 "Hey Siri, close the curtains in the bedroom".

⚠️ Note: Aqara Hub will be required to work with HomeKit (Apple) M2 β€” It's the only one in Xiaomi's lineup that supports this protocol!

Step 6: Enhanced Opportunities and Integration

When the core system is configured, you can move on to advanced features:

  • πŸ“± Management through Telegram-bot: using the service IFTTT Or Node-RED can configure notifications and control via messenger, for example, a bot will send a message if the smoke sensor is triggered.
  • πŸ–₯️ Local Management Without Cloud: Aqara Hubs Support Protocol LAN, This allows you to manage devices even without the Internet (via applications like Home Assistant).
  • πŸ”„ Integration with other systems: With Home Assistant or OpenHAB, you can connect Xiaomi with devices from other brands (for example, Philips Hue or Sony Bravia).

For those who are ready to dive into the settings, we recommend you to explore Home Assistant, an open platform for smart homes.

  • Create scripts using Python.
  • Visualize data from sensors on graphs.
  • Manage devices via a web interface or mobile application.

πŸ’‘

If you want full control of the system without depending on the Xiaomi cloud, Home Assistant + Aqara Hub M2 hub is the best solution.It takes time to set up, but gives 100% flexibility.

FAQ: Frequent questions about Xiaomi smart home

Can I use Xiaomi devices without a hub?
Yes, but with limitations. Wi-Fi devices (like Yeelight smart bulbs or Mi Smart Plug outlets) will run through the app, but you can't create automation scenarios between them. Sensors on Zigbee (like door-opening sensors) without a hub won't work.
How to transfer a smart home to a new phone?
Sign in to the Mi Home app on your new phone with the same account, all devices and scripts will automatically fit. If you want to transfer your system to another account, use the Transfer Control feature in the settings of each device (available only for devices added through the hub).
Why do the sensors sometimes turn off?
This is a typical problem with a weak Zigbee signal. Solutions: Move the hub closer to the center of the apartment. Add a Zigbee repeater (for example, a smart Aqara outlet, it works as a signal amplifier). Make sure there are no sources of interference (microwaves, cordless phones) near the hub.
Can you use Xiaomi and Aqara devices together?
Yes, they are fully compatible, because both brands are owned by Xiaomi and use the same Zigbee protocol. For example, you can connect the Xiaomi Mi Door Sensor to the Aqara Hub M2 hub, everything will work. The only difference is that Aqara devices often have more reliable coverage and support for HomeKit.
How to reset the hub to factory settings?
Press and hold the button on the hub for 10 seconds until the indicator flashes yellow quickly, and then the hub is reset and can be added back to the app. Attention: all scripts and devices connected through this hub will be disabled!