Smart home Xiaomi from scratch: step-by-step instructions for beginners

Building a smart home based on the Xiaomi ecosystem is not only convenient, but also a real saving of time and energy. However, many beginners are lost in the choice of where to start, which hub to buy first, which sensors are really necessary and what to do without? This article will help avoid the typical mistakes when assembling a system from scratch, save money and build a scalable infrastructure that can be easily expanded.

We’ll explore three key principles for a successful start: choosing a central hub (and why the Mi Home Hub 2 isn’t always optimal), prioritizing sensors for basic automation, and ways to integrate with voice assistants, and focusing on hidden pitfalls that the manufacturer doesn’t mention β€” for example, why some Xiaomi devices stop working when the Chinese cloud is turned off or how to circumvent geolock restrictions.

If you’ve tried to set up a smart home and you’ve run into problems β€” there’s a section at the end of this article that addresses the most common bugs (from β€œI can’t see the device in the app” to β€œScenarios are delayed”). And for those just planning a purchase, we’ve compiled a hub comparison table with current prices and features.

1. Central Hub: The Heart of a Smart Home

Without a hub, most Xiaomi devices will not be able to communicate with each other.

  • πŸ”— Connecting sensors and actuators into a single network (via the ZigBee or Wi-Fi protocol)
  • πŸ“± Manage through the Mi Home or Home Assistant mobile app
  • ⚑ Automatic execution of scenarios (e.g. turning on lights when moving)
  • πŸ”’ Local command processing (without cloud dependency)

As of 2026, Xiaomi has three main hubs:

ModelProtocolMax. Devices.Voice assistantPrice (β‰ˆ)Features
Mi Home Hub 2 (MHS409)ZigBee 3.0128Alice, Google, Siri3 500 β‚½Matter support, laptop complete for setting up
Aqara Hub M2ZigBee 3.0128Alice, Google.4 200 β‚½Built-in IR- transmitter for control of equipment
Redmi Smart Home GatewayZigBee 3.064Alice.2 800 β‚½Budget option, without Matter support

Critical: If you plan to use Aqara devices (a subsidiary of Xiaomi), take the Aqara Hub M2 β€” It's better optimized for their sensors. For a purely Xiaomi ecosystem, the Mi Home Hub 2 is enough.

⚠️ Note: Xiaomi hubs are tied to the region when you first connect. If you choose China (Mainland China) in Mi Home, some features (such as voice control via Alice) will not work"!

πŸ“Š What hub do you plan to use?
Mi Home Hub 2
Aqara Hub M2
Redmi Smart Home Gateway
The other one didn't

2. Basic set of devices: without which to do

At the start, 4-5 devices are enough to cover 80% of everyday scenarios.

  1. Motion Sensor (Xiaomi Motion Sensor 2) – for lighting automation and safety, installed in the hallway, bathroom or hallway.
  2. Opening sensor of doors/windows (Xiaomi) Door/Window Sensor 2) β€” signaling.
  3. Smart socket (Xiaomi Smart Plug Wi-Fi) - for remote control of household appliances (for example, a heater or a kettle).
  4. Smart light bulb (Yeelight) LED Xiaomi Philips – with brightness and color adjustment.
  5. Xiaomi Wireless Switch – for manually running scripts (e.g., β€œLeaving Home”)

πŸ’‘

Don’t buy the first version of the sensors (without the number β€œ2” in the title) – they run on the outdated ZigBee 1.2 protocol and can conflict with new devices.

Cost of the basic set: ~8 000–10 000 β‚½. This is the minimum package that already allows:

  • πŸ’‘ Automatically turn on the light when driving in the dark
  • πŸšͺ Get notifications about open windows in winter
  • β˜• Remotely turn on the kettle on the way from work
  • πŸ”’ Simulate the presence of the house (accidental lighting on)

⚠️ Note: Xiaomi sensors on batteries (CR2032/CR2450) discharge 1–2 Buy a stock of batteries right away -- the original batteries last longer than the cheap ones.

3. Setup of the Mi Home application: step-by-step instructions

After buying the hub and devices, start setting up:

Download the Mi Home app (App) Store/Google Play)|Create a Xiaomi account (select the region of Russia)|Connect the hub to the outlet and wait for the yellow LED to blink.|In the app, click "+" β†’ "Add the device" β†’ "Mi Home Hub 2"|Follow the instructions (Bluetooth binding)|Update the hub firmware in the device menu-->

After adding the hub:

  1. Go to Profile. β†’ Settings β†’ Region and make sure that Russia is selected.
  2. Enable Local Management in the hub settings (this will reduce cloud dependency).
  3. Add the rest of the devices through + β†’ Add the device (each device must be brought to the hub for a distance) < 1m).

What to do if the device is not added?
1. Reboot the hub (remove the plug for 10 seconds). 2. Make sure the phone is on Bluetooth and Wi-Fi. 3. Check if the device is added to another account (reset it with the reset button). 4. Update the hub firmware and the Mi Home app. 5. If a ZigBee device is a problem, try adding it via Aqara Home (sometimes it works more stable).

For convenience, group the devices into rooms:

  1. Open the Devices tab in the app.
  2. Click Add room (e.g., "Kitchen", "Bedroom").
  3. Drag the devices to the appropriate rooms.

4. Automation scenarios: examples for beginners

Scenarios allow devices to interact without you, and start with these basic rules:

ScriptConditionsAction.Example of devices
Traffic lightingThe motion sensor is activated and the level of illumination < 50 luxTurn on the smart light bulb for 3 minutesMotion Sensor 2 + Yeelight
Windows securityThe window opening sensor is activated and the temperature outside < 10Β°CSend push notifications to your phoneDoor Sensor 2 + weather-service
Leaving the Home modePress the Wireless Switch button 2 timesTurn off all sockets and light bulbsWireless Switch + Smart Plug

To create a script:

  1. At Mi Home, go to Automation. β†’ Create β†’ Custom automation.
  2. Select a Condition (e.g., a motion sensor).
  3. Add Action (turn on the light bulb).
  4. Save the script and test it out.

πŸ’‘

Use difficult conditions with the operator and" (AND), For example, the lights should only turn on if the movement is detected and it is dark outside.

⚠️ Note: Mi Home scripts are 1-3 seconds late. If you need an instant response (e.g. for alarms), consider switching to Home Assistant with local processing.

5. Integration with voice assistants

You can control a smart home by voice through:

  • πŸ—£οΈ Alice (Yandex) – supports all Xiaomi devices marked β€œWorks with Yandex"
  • πŸ€– Google Assistant – Requires you to link your Mi Home account to Google Home
  • 🍎 Siri (HomeKit) – only through Home Assistant HOOBS

To connect to Alice:

  1. Open the Yandex application β†’ Devices β†’ Add the device β†’ Xiaomi.
  2. Sign in to Mi Home account (should be linked to Russia!).
  3. Allow access to the devices.
  4. Say commands like, "Alice, turn on the light in the kitchen" or "Alice, show the temperature in the room."

1. whether all devices are added to the rooms in Mi Home (without a room they are not displayed in Yandex).

2. Are there any restrictions on the region (for example, Chinese firmware is not supported).

3. Has the hub firmware been updated to the latest version.-->

6 Advanced Features: Home Assistant and Local Management

The Mi Home app is convenient for beginners, but has limitations:

  • ⏳ Delays in scripting (up to 5 seconds)
  • 🌐 Dependence on Chinese servers (with the Internet break some functions do not work)
  • πŸ”§ Limited Automation Settings

Solution: Home Assistant (HA). It is an open platform for a smart home that:

  • 🏠 It works locally (without the cloud)
  • πŸ”§ Supports complex scenarios with conditions and cycles
  • πŸ“Š Keeps a history of changes (e.g., temperature charts)
  • πŸ”„ Integrates with 1000+ devices of different brands

Minimum installation requirements:

  • πŸ–₯️ Old PC, Raspberry Pi 4 (from 5,000) β‚½) or NAS
  • πŸ“€ Flash drive./SSD on 32 GB (for log recording)
  • ⚑ Unbreakable (UPS) light-shield

Instructions for connecting Xiaomi devices to HA:

1. Install Home Assistant (we recommend the Home Assistant OS method).


2.In the configuration.yaml file, add integration:




zigbee:




device: /dev/ttyACM0 # port of your ZigBee adapter




baudrate: 115200




3. Reset HA.




4. In the web interface, go to Settings β†’ Devices and Services β†’ Add Integration β†’ Xiaomi Miio.




5. Enter your hub’s token (how to get it: see mihome.dev).

How to get a token hub Mi Home?
1. Install the Mi Home app on Android. 2. Download Packet Capture and start recording traffic. 3. Open Mi Home and go to the hub settings. 4. In the Packet Capture logs, find a request to API 5. Copy the token (a string of 32 characters).

⚠️ Note: When using Home Assistant, turn off cloud sync in Mi Home (Profile) β†’ Settings β†’ Cloud. β†’ Disable it. Otherwise, devices may duplicate commands.

7.Typical errors and their solutions

Even with the right setup, there can be problems. Here are the most common:

Problem.Reason.Decision
Hub does not connect to Wi-FiDoes not support 5 GHz or hidden networkSwitch router to 2.4 GHz, disable SSID hiding
Sensors fall off once a day.ZigBee weak signalInstall a repeater (e.g. Xiaomi Smart Plug as a router)
Scenarios are delayedCloud Processing in Mi HomeGo to Home Assistant or enable local management in the hub settings
Alice can't see the device.The wrong region in Mi HomeChange the region to Russia and re-link the hub

1. Remove the device from the Mi Home.

2. Remove the battery for 10 seconds.

3. Insert the battery back and wait for the LED to blink.

4. Add the device again.-->

8.How to expand the system: tips for scaling

When the underlying system is stable, you can add:

  • 🌑️ Climate Control: Xiaomi Smart Thermostat + heater
  • 🚰 Proof of leakage: Aqara Water Leak Sensor + electric
  • πŸŽ₯ Video surveillance: Xiaomi Home Camera 360Β° 2K note-on SD-map
  • πŸ” Smart lock: Xiaomi Smart Door Lock (requires a separate hub) NFC Gateway)

The scaling rules:

  1. Add no more than 2-3 devices per week to test stability.
  2. Use ZigBee repeaters (such as smart sockets) to amplify the signal.
  3. Keep documentation: Write down which devices are installed and which scripts are tied to them.
  4. Before buying, check compatibility on the website. Zigbee2MQTT.

πŸ’‘

Don't chase the number of devices. Start with specific tasks (like "automatic lighting in the hallway"), and then expand the system.

FAQ: Answers to Frequent Questions

Can I use Xiaomi devices without a hub?
Yes, but with limitations. Yeelight, sockets and some cameras run directly over Wi-Fi via the Mi Home app. However: You can't create scripts between devices. Zigby devices (sensors, buttons) without a hub won't work. Dependence on the cloud will increase (commands will run slower).
How to transfer devices to another Mi Home account?
Xiaomi does not officially support transferring devices between accounts. A workaround: Reset the device to factory settings (reset button). Delete it from your old Mi Home account. Add the device to your new account. Except that hubs and cameras are permanently attached to the account. These can only be ported through Xiaomi support (purchase checks are required).
What is the alternative to Mi Home if you don’t like the app?
There are several options: Home Assistant – local management, maximum flexibility (hard to configure), Aqara Home – an alternative application from Aqara (simple, but fewer functions), Yandex Smart Home – if you use mainly Alice (limited automation). Zigbee2MQTT β€” For advanced users (works through the MQTT-For most users, the Mi Home duo is optimal (for basic management) + Home Assistant (for automation).
How many devices can one Xiaomi hub withstand?
The official limit is Mi Home Hub 2 and Aqara Hub. M2: Redmi Smart Home Gateway: Up to 64 devices, but in practice, 50 devices.+ Problems begin with devices: Delays in execution of commands, spontaneous shutdown of sensors, overheating of the hub (especially if it is in a closed cabinet), Solutions: Break the system into 2-3 hubs (for example, separately for each floor). Use ZigBee repeaters (smart sockets). Go to Home Assistant with a dedicated coordinator (e.g. Sonoff Zigbee 3.0) USB Dongle).
Can I use Xiaomi devices with Apple HomeKit?
Xiaomi doesn’t have direct support for HomeKit, but there are workarounds: Through Home Assistant: Install HomeKit integration into the homeKit HA. Add the devices to the app Home (iOS). HOOBS (fee, ~3 000 β‚½/year: Install HOOBS Connect your Mi Home account via a plugin. AliExpress plugins (not recommended): Use adapters like Athom Homey or BroadLink. Risk of unstable work and data leakage. Locally managed Home Assistant is the best option.