Xiaomi Smart Home: A Complete Guide to Build and Setup

How to start building a Xiaomi smart home

Xiaomi's ecosystem offers one of the most affordable and functional solutions for home automation, but before buying sensors and sockets, it's important to understand the key principles: device compatibility, communication protocol (ZigBee/Wi-Fi/Bluetooth) The central hub that will manage the entire system.

Xiaomi’s main advantage is cross-platform: most devices work through a single Mi Home app (or Xiaomi Home in newer versions). However, there are nuances: for example, the Aqara series sensors require a separate Aqara Hub, and some devices (like Yeelight) have their own applications but integrate into the overall ecosystem. Without a ZigBee hub (like Xiaomi Mi Smart Home Gateway), you will not be able to connect door opening, movement or leak sensors – they work only through this protocol.

If you are a beginner, start with a minimum set:

  • πŸ“± Smartphone on Android/iOS with the Mi Home app
  • πŸ”Œ Smart socket (for example, Xiaomi Mi Smart Plug) for remote control of household appliances
  • πŸ”¦ Smart Lamp (Yeelight or Mi) LED Smart Bulb for lighting
  • πŸšͺ ZigBee (Xiaomi Mi Smart Home Gateway 3)

Device Choice: What to Buy for Basic Automation

Xiaomi ecosystem has hundreds of devices, but enough to start 5-7 The rule of thumb is, give priority to ZigBee-enabled devices that are more stable than Wi-Fi analogues and don't overload your home network.

Here is the best set for an apartment area 50-70 Β²:

Type of deviceModelProtocolPrice (2026)Why?
Central hubXiaomi Mi Smart Home Gateway 3ZigBee 3.0~3 500 β‚½Sensor control, siren, RGB-lighting
Motion sensorXiaomi Mi Motion Sensor 2ZigBee~1 200 β‚½Automatic lighting when driving
Opening sensorAqara Door and Window SensorZigBee~900 β‚½Door/window control, gas leakage (with gas sensor)
Smart socketXiaomi Mi Smart Plug Wi-FiWi-Fi~800 β‚½Remote control of equipment, monitoring of energy consumption
Smart lamp.Yeelight LED Smart Bulb (Color)Wi-Fi/Bluetooth~1 500 β‚½Brightness adjustment, color scenes, timers

⚠️ Note: If you plan to use Aqara devices (such as leakage sensors or buttons), buy an Aqara Hub instead of a Xiaomi Gateway.

For advanced automation, add:

  • 🌑️ Aqara Smart Radiator Thermostat for heating control
  • πŸ’§ Aqara Water Leak Sensor for the bathroom and kitchen
  • πŸ”Š Xiaomi Mi Smart Speaker for voice control
  • πŸ“Ί Smart TV (Mi) TV Mi Home support for centralized management

πŸ“Š Which device do you plan to buy first?
Smart socket
Motion sensor
ZigBee hub
Smart lamp.
Other

Installation and connection of the Xiaomi Mi Smart Home Gateway hub

The hub is the brain of your smart home, and without it, ZigBee devices (sensors, buttons, some switches) won't work. 10-15 minutes, but there are critical nuances:

1. Hub location: place it in the center of the apartment, at a height 1.5-2 Avoid metal surfaces and thick walls, which will screen the ZigBee signal, optimally on a shelf or wall in the hallway.

2. Network connection: the hub requires constant power (included) and connection to the router via Ethernet. Wi-Fi version of the hub (Gateway 3) is unstable - use the cable!

Step-by-step:

  1. Connect the hub to the outlet and router via Ethernet.
  2. Open the Mi Home app, click on it. + β†’ Add the device β†’ Gateway.
  3. Choose the region of China – it is important for the correct operation of sensors!
  4. Press the button on the hub when the app asks to confirm the connection.
  5. Wait for the firmware update (it can take up to 10 minutes).

Hub connected to router via cable|

The indicator on the hub burns blue|

The appendix displays the status "Online"|

The firmware has been updated to the latest version-->

⚠️ Note: If the hub is not connected, check:

  • πŸ”Œ Power: The indicator should be orange (load) or blue (work).
  • 🌐 Network: Turn it off VPN Check that the router does not block ports 80 and 443.
  • πŸ“± Region: If China is not selected, some sensors will not be recognized.

What to do if the hub is not updated?
If the hub's firmware is stuck in the upgrade phase: 1. disconnect it from power for 30 seconds. 2. reconnect and wait for the orange indicator. 3. In the Mi Home app, go to Profile β†’ Settings β†’ Update the firmware manually. 4. If the error repeats, reset the hub with the Reset button (hold 10 seconds).

Connecting devices to the hub and setting up in Mi Home

Once the hub is installed, you can add other devices.The process is universal for most Xiaomi gadgets, but there are exceptions (for example, Yeelight requires its app to initially set up).

The general connection algorithm:

  1. Open Mi Home, press + β†’ Add the device.
  2. Select a category (e.g., Sensors and switches for Motion Sensor).
  3. Activate the device: Sensor: Remove the battery film (if any). Sockets: hold the button 5 seconds until the indicator flashes. Lamps: turn on / off 3 times in a row.

Wait for confirmation in the appendix.

⚠️ Note: If the device is not located, check:

  • πŸ”‹ Power: Sensors require batteries (usually) CR2032 or AAA).
  • πŸ“Ά Distance: Maximum distance between hub and device β€” 10-15 meters (no obstacles).
  • πŸ”„ Reboot: Reboot the hub and router if the connection freezes.

Once connected, the devices will appear in the Mi Home main menu, where you can:

  • πŸ“› Rename (e.g., "Bedroom Lamp" instead of "Bedroom Lamp "Yeelight_123").
  • πŸ“Š Set up notifications (for motion/open sensors).
  • ⏱️ Create timers (for example, turn off the socket at night).
  • πŸ”— Grouping in groups (for example, all lamps in the living room).

πŸ’‘

To speed up the connection of multiple devices, use the β€œQuick Add” mode in Mi Home: go to Profile β†’ Settings β†’ Laboratory β†’ Quick addition of devices.

Creating Automations (Scenes and Rules)

The main advantage of a smart home is the automation of routine activities. In Mi Home, this is done through Scenes and Automation.

  • 🎭 Scene – a set of manually triggered actions (e.g., β€œEvening Mode” turns off the lights and turns on the TV).
  • βš™οΈ Automation – the β€œif... then...” rule (e.g., β€œif the motion sensor is triggered, turn on the lights").

Examples of useful automation:

Trigger (condition)Action.Example of use
The motion sensor is activated.Turn on the Yeelight lampLighting in the hallway at the entrance
Door opening sensor activatedTurn on the siren at the hubSecurity alarms
Time 22:00.Turn off all sockets.Saving electricity
Temperature below 18Β°CTurn on the heater through the socketClimate support

How to create automation:

  1. In Mi Home go to Automation β†’ Create β†’ If...
  2. Select a trigger (such as a motion sensor). β†’ Traffic detected).
  3. Click Add Action and select the device (e.g. Yeelight) β†’ Turn on).
  4. Keep the rule and test it.

πŸ’‘

For stable automation, turn off battery optimization for the Mi Home app in Android settings (or enable background update on iOS).

⚠️ Warning: Avoid cyclical automation (e.g., β€œif the lamp is on, turn off the socket, and if the socket is off, turn on the lamp”). This leads to looping and overloading the hub.

Integration with voice assistants (Alice, Google, Siri)

Smart home Xiaomi can control voice through Yandex Alice, Google Assistant or Apple HomeKit (with restrictions).

Connection to Yandex Alice:

  1. Open the Yandex app with Alice.
  2. Go to Devices β†’ Add the device β†’ Xiaomi.
  3. Enter the username/password from your Mi Home account (use the same region as in the hub!).
  4. Allow access to the devices.

Now you can use commands:

  • πŸ’‘ "Alice, turn on the light in the living room"
  • πŸ”Œ "Alice, turn off the kettle socket"
  • 🌑️ "Alice, what's the temperature in the room?"

⚠️ Note: Not all Xiaomi devices are supported by Alice. For example, Aqara sensors may not be displayed. For a full list of compatible devices, see Yandex documentation.

Connection to Google Assistant:

  1. In the Google Home app, click + β†’ Set up your device β†’ Are there devices already?
  2. Select Xiaomi Mi Home and sign in.
  3. Assign room devices (for example, "Bedroom", "Kitchen").

How to connect Xiaomi to Apple HomeKit?
Xiaomi does not officially support HomeKit, but there is a workaround: 1. Buy a Home Assistant hub (for example, on the Raspberry Pi). 2. Connect Xiaomi devices to it through the Xiaomi Mi Home Integration plugin. 3. Configure a bridge between Home Assistant and HomeKit. Cons: Requires technical skills and additional equipment (~5 000 β‚½).

Advanced Features: Home Assistant and Local Management

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

  • 🌐 Xiaomi Cloud Dependence (Device Fails in Case of Server Failure).
  • ⏳ Delays in execution of commands (up to) 1-2 seconds).
  • πŸ”— No complex automation (e.g. time of day and weather).

The solution is the Home Assistant platform, which allows you to manage devices locally and create complex scenarios.

The advantages of Home Assistant:

  • 🏠 Local control: devices work even without the Internet.
  • ⚑ Instant response: teams are executed for 0.1-0.3 seconds.
  • πŸ“Š Advanced analytics: power consumption graphs, sensor response history.
  • πŸ€– Integration: support 2000+ devices, not just Xiaomi).

How to connect Xiaomi to Home Assistant:

  1. Install Home Assistant on Raspberry Pi or NAS (Instructions: Official website).
  2. In the configuration file configuration.yaml add: xiaomi_aqara: gateways: - key: YOUR_GATEWAY_KEY (The key can be obtained through Mi Home with this tool).
  3. Reboot Home Assistant and add devices to the interface.

Example of automation in Home Assistant (turn on the light when driving and if it is dark outside):

automation:


Alias: "The hallway: light by movement (at night)"




trigger:




platform: state




entity_id: binary_sensor.motion_sensor_158d0001234567




to: "on"




condition:




- condition: sun




after: sunset




before: sunrise




action:




service: light.turn_on




entity_id: light.yeelight_12345678

πŸ’‘

Home Assistant requires basic knowledge in IT, But it gives you complete control of the smart home. + voice-assistant.

FAQ: Frequent questions about Xiaomi smart home

πŸ”Ή Can you use Xiaomi devices without a hub?
Yes, but with limitations. Wi-Fi devices (outlets, Yeelight lamps, some cameras) work without a hub, but: Sensors (movements, openings, leaks) require a ZigBee hub. Without a hub, you can't create automation between devices (for example, "if the sensor is working, turn on the lamp"). Sensor notifications will only come through the hub.
πŸ”Ή Why Xiaomi sensors are quickly discharged?
The life of batteries in sensors depends on: Frequency of operation: motion sensor in the hallway will be discharged 3-6 The door opening sensor will last for months. 1-2 Type of battery: use high-quality alkaline (Duracell, Energizer) or lithium (CR2032). Temperatures: In the cold (e.g., on the balcony), batteries go down faster. Tip: In the sensor settings in Mi Home, reduce sensitivity (e.g., for Motion Sensor, set the delay to trigger). 30 second 5).
πŸ”Ή How to Transfer a Smart Home to a New Phone?
When changing your smartphone: On your old phone in Mi Home, go to Profile β†’ Settings β†’ Xiaomi account β†’ Data export (if available) Install Mi Home on a new phone and log in to the same Xiaomi account. All devices and automations will boot automatically (if the phone is on the same platform β€” Android/Android or iOS/iOS). ⚠️ Warning: When you switch from Android to iOS (or vice versa), some automation may reset. Before moving, take screenshots of your settings.
πŸ”Ή Can you use Xiaomi smart home without the Internet?
Partially, without the Internet: βœ… Local commands are running (for example, turning on the lamp via an application on the same Wi-Fi network). βœ… Automations created in Mi Home (if trigger and action are local devices). ❌ Notifications on the phone (for example, from the door opening sensor) do not work). ❌ Voice control not available (Alice)/Google demand cloud). ❌ No updates to the status of devices in the app (e.g. temperature from the sensor) require a Home Assistant or other local controller for full autonomy.
πŸ”Ή How to reset Xiaomi device to factory settings?
Reset method depends on the type of device: Device Reset Hub Gateway Hold the Reset button 10 seconds until blinking orange. Smart socket Hold the button 5 seconds until the indicator flashes. Yeelight Lamp on / off 5 times in a row (interval 1 second). Motion / Open Sensor Remove the battery for 10 seconds, then insert back. After reset, the device will disappear from the Mi Home and need to be added again.