How to Use Xiaomi Smart Home: From Connection to Complex Scenarios

Xiaomi’s Smart Home ecosystem is one of the most affordable and functional systems for home automation, connecting dozens of devices into a single network, from light bulbs and sockets to robot vacuum cleaners and security sensors, all managed through one Mi Home app (or Xiaomi Home in newer versions), but many users are struggling to connect the first device, let alone create complex automation scenarios.

In this article, you will find unique schemes for integrating Xiaomi devices with third-party systems (Google Home, Apple HomeKit, Yandex Alice), which are not officially advertised by the company. We will analyze not only basic settings, but also advanced features like geofences, time-of-day triggers or even automation based on weather station data. And for those who are afraid to download the network, we will give a table of device compatibility using the ZigBee, Wi-Fi and Bluetooth Mesh protocols.

If you’ve tried to set up a smart home but have encountered errors like Device offline or Failed to add device, there’s a section in the article that addresses 90% of typical problems, from device resets to manual registration. IP-And yes, we won't advise "just reboot the router" -- instead, you'll get a checklist of 7 specific actions to diagnose the network.

1. What devices are needed to start: the minimum and optimal set

To build a full-fledged smart home based on Xiaomi, you don’t have to buy everything at once. Start with the hub, the central device that connects all sensors and actuators, without it, most devices (especially on ZigBee) simply won’t work.

Minimum set for lighting automation and safety:

  • πŸ”Ή Xiaomi Mi Home Security Gateway 3 (Hub) + siren - about 3,500 β‚½
  • πŸ’‘ Xiaomi Mi LED Smart Bulb (color adjustable bulb) – 1,200 β‚½
  • πŸšͺ Xiaomi Door/Window Sensor 2 (sensor) β€” 800 β‚½
  • πŸ”‹ Xiaomi Smart Plug (smart socket) – 1,500 β‚½

The optimal set for full automation of the apartment (prices are relevant for 2026):

The deviceModelProtocolPrice, β‚½Why?
hubXiaomi Aqara Hub M2ZigBee 3.0 + Wi-Fi4 200Support for up to 128 devices, backup power
ThermostatXiaomi Smartmi Air Conditioner CompanionWi-Fi2 800Air conditioning management on schedule
Camera.Xiaomi Mi Home Security Camera 360Β° 2KWi-Fi3 900Video surveillance with facial recognition
Motion sensorXiaomi Aqara Motion Sensor P1ZigBee1 400Automatic lighting when driving

⚠️ Note: If you plan to use Aqara devices (a Xiaomi sub-brand), make sure the hub supports their protocol. M2 It works with ZigBee 3.0, and the old Mi Gateway 1 only works with ZigBee 1.2, which can cause compatibility issues.

πŸ“Š What Hub Do You Use in a Xiaomi Smart Home?
Xiaomi Mi Home Security Gateway 3
Aqara Hub M2
Xiaomi Mi Smart Home Gateway (Version 1)
Another hub
I haven't bought it yet.

Step-by-step: how to connect the first device to the Mi Home

Let’s start with a basic connection – for example, the Xiaomi Mi smart light bulb. LED Smart Bulb, you're gonna need it:

  • πŸ“± Smartphone with Android 8.0+ or iOS 12.0+
  • πŸ“Ά 2.4GHz Wi-Fi connection (5GHz not supported by most Xiaomi devices!)
  • πŸ”Œ The socket next to the device (for a light bulb - a cartridge)

Connection algorithm:

  1. Install the Mi Home app (Android/IOS) and sign up (you can use Google or Apple) ID).
  2. Include the light bulb in the cartridge - it should flash yellow (conjugation mode).
  3. In the app, click + β†’ Add the device β†’ Lighting β†’ Xiaomi Mi LED Smart Bulb.
  4. Select your 2.4GHz Wi-Fi network and enter your password. The light bulb flashes green, and the connection is successful.

If the device is not connected:

Check that the router is operating in mode. 802.11 b/g/n (2.4 GHz)

Turn off VPN or proxy on your phone

Restart the router and device (remove the battery from the sensors)

Try connecting from another phone.

Update the Hub's firmware through Settings β†’ Update of the PO-->

⚠️ Note: When connecting the Xiaomi Mi Home Security Gateway 3 hub, do not use symbolic passwords with Cyrillic or special characters (!@#$%). Some firmware versions incorrectly handle such passwords - use only Latin and numerals.

πŸ’‘

If you have a dual-band router with a common SSID for 2.4 and 5 GHz, temporarily divide the networks. 2.4 GHz MyWiFi_2G, 5 GHz β€” MyWiFi_5G. After connecting devices, you can return the previous settings.

Creating automation scenarios: from simple to complex

The basic automation in Mi Home is based on the principle of β†’ For example: β€œIf the motion sensor is triggered β†’ But the system also supports multi-criteria scenarios with logic operators and/or.

Examples of useful scenarios:

  • πŸŒ… Simulate presence: Turn on lights randomly between 18:00 and 23:00 when you are not at home (use geofences).
  • 🚰 Leak protection: If the Xiaomi Aqara Water Leak Sensor is working β†’ shut off the electric crane and send a push notification.
  • 🌑️ Climate control: If the temperature is above 25Β°C and humidity below 40% β†’ Include the Xiaomi Smartmi Air Humidifier.
  • πŸ”‹ Electricity savings: If the power of the Xiaomi Smart Plug socket exceeds 1 kW for more than 2 hours β†’ Send a notification about the β€œenergy-intensive” device.

How to create a script:

  1. In the app, go to Profile β†’ Automation β†’ Create β†’ Custom automation.
  2. Select the trigger (condition): time, geofence, device state, etc.
  3. Add an action (what is going to happen) and you can add several actions in one scenario.
  4. Save and activate the script. Check it manually through the Run button.

For advanced users: Mi Home has a hidden Advansed feature that allows variables and delays to be used, such as:

IF (Motion sensor is working)


I (Time between 22:00 and 6:00)




E (Lighting < 50 lux)




That




Turn on the light bulb at 30% brightness




Turn off the light bulb after 5 minutes if no movement is detected

How to Enable Advanced Mode in Mi Home
1. Go to Profile. β†’ Settings β†’ Region. 2. Select China, which will open up additional features. 3. Go back to the automation section and the Advansed tab will appear. ⚠️ After changing the region, some devices may appear in Chinese, but they can be renamed.

4.Integration with Google Home, Apple HomeKit and Alice

Officially, Xiaomi only supports integration with Google Assistant and Amazon Alexa. but there are workarounds for Apple HomeKit and Alice's Yandex that require additional action.

Methods of integration:

PlatformOfficial supportHow to connectLimitations
Google HomeYes.Through Mi Home. β†’ Profile β†’ Settings β†’ Google AssistantNot all devices are supported (e.g. sensors)
Apple HomeKitNo.Through the Home Assistant Hub + Plugin of Mi Home IntegrationRequires a permanent server (Raspberry Pi)
Yandex AlicePartially.Through Yandex Station + smart-home"It works only with light bulbs, sockets and some sensors

To connect to Apple HomeKit:

  1. Install Home Assistant on the Raspberry Pi or NAS.
  2. Add Xiaomi Mi Home integration through HACS (Home Assistant Community Store).
  3. In the configuration file configuration.yaml, specify a token from Mi Home (you can get it through miot-spec.org).
  4. After synchronization, the devices will appear in Apple Home.

⚠️ Note: When integrating with Yandex Alice, some devices (such as Xiaomi Aqara) may not show up.Solution: plug them in via Mi Home, then manually add them to the Smart Home skill via Add Device β†’ Other.

5. Solving typical problems: offline devices, connection errors

Even in a perfectly configured system, sometimes there are failures, and here are the most common mistakes and their solutions:

Problem 1: Offline device in the application

  • πŸ”Œ Check the power: the sensors replace the battery (for example, CR2032), At the outlets - reconnect to the network.
  • πŸ“Ά Make sure your device is within range of Wi-Fi or ZigBee (maximum 10 meters from the hub without obstacles).
  • πŸ”„ Reboot the hub: disconnect it from the network for 30 seconds, then turn it back on.
  • πŸ“‘ Check your router settings: Turn off Band Steering (automatically switching between 2.4 and 5 GHz). IGMP Snooping and Multicast for ZigBee Devices.

Problem 2: Failed to add device (Failed to add device)

  • πŸ“± Update the Mi Home app to the latest version.
  • πŸ”„ Reboot your phone and router.
  • πŸ”§ Reset the device to factory settings: For light bulbs: turn on/off 5 times in a row. For sensors: hold the reset button for 10 seconds (until the indicator flashes). For hubs: press and hold the button on the back for 20 seconds.
  • 🌐 Check out the region in Mi Home: some devices (like Aqara) are not added if you select the region of Russia.

Problem 3: Delays in the execution of commands

  • πŸ“Ά Check Wi-Fi network load: if more than 20 devices are connected to the router, divide them into different channels.
  • πŸ”„ For ZigBee devices: reduce the number of jumps between the hub and sensors (maximum 3 intermediate devices).
  • ⚑ Connect the hub to the router via Ethernet (if there is a port) – this will reduce delays.

πŸ’‘

If the problem recurs regularly, check device logs in Mi Home (Profile) β†’ The device β†’ Three points. β†’ Logs: Often, specific errors are listed, such as ZigBee network overload).

6. Advanced chips: geofences, voice control, API

If you've already mastered basic automation, it's time to move on to advanced features, such as geofences that allow you to run scenarios as you approach or move away from home.

How to set up geofences:

  1. At Mi Home, go to Profile β†’ Geozones.
  2. Add a new zone, address and radius (500-1000 meters are recommended).
  3. Create automation with a Geozon trigger β†’ Arrival/Departure.
  4. Example scenario: "If everyone left the 'Home' zone' β†’ turn off the heater and turn on the alarm".

For voice control via Yandex Alice or Google Assistant:

  • 🎀 In Mi Home, link your account to a voice assistant (Profile) β†’ Settings β†’ Voice assistants).
  • πŸ”Š Example commands for Alice: "Alice, turn on the light in the living room" (if the light bulb is called "Living room"). "Alice, show the camera at the door" (for Xiaomi Camera).

For advanced users: Xiaomi provides API to control devices through HTTP-For example, you can send commands directly:

POST /miot-spec/prop/set


Host: api.io.mi.com




Headers:




Authorization: Bearer {YOUR_TOKEN}




x-xiaomi-protocal-flag-cli: PROTOCOL_TYPE_CLOUD





Body:




{




"id": 12345,




"method": "set_properties",




"params": [




{




"did": "did_of_your_device",




"siid": 2,




"piid": 1,




"value": true




}




]




}

Where did you do it? ID Devices (can be found in Mi Home through Profile) β†’ The device β†’ About the device).

How to get a token for a token API Xiaomi
1. Install the extension for the Mi Token Extractor browser (for Chrome). 2. Sign in at account.xiaomi.com. 3. The extension will automatically remove the token from cookies. ⚠️ The token is valid for a limited time (usually 1-2 weeks), then it must be updated.

7 Smart Home Security: How to Protect Data and Devices

Smart devices are a potential vulnerability for hackers, and here's how to minimize the risks:

Basic safety measures:

  • πŸ” Use complex passwords for your Mi Home account (at least 12 characters with numbers and special characters).
  • πŸ“Ά Divide the Wi-Fi network into two: The main network is for phones, laptops, guest network is for smart devices (with limited access to the local network).
  • πŸ”„ Regularly update the device firmware (there is an Update section in Mi Home).
  • 🚫 Disable remote access to the hub if you do not use it (Hub Settings) β†’ Network settings β†’ Remote access).

Advanced protection:

  • πŸ›‘οΈ Set up. VLAN on a router to isolate smart devices from the main network.
  • πŸ” Use Pi-hole or AdGuard Home to block suspicious requests from Xiaomi devices (some send data to servers in China).
  • πŸ“‘ Replace the standard DNS at 1.1.1.1 (Cloudflare) or 8.8.8.8 (Google) in the router settings.

⚠️ Note: Xiaomi devices with ZigBee protocol (such as Aqara sensors) are vulnerable to Replay attacks when an attacker intercepts and repeats commands. To protect yourself, turn on ZigBee Security Mode in the hub settings (available only in firmware for China).

8. Alternative firmware and custom solutions

If standard Mi Home features aren’t enough, you can install custom firmware on Xiaomi hubs, such as OpenMiHome or Aqara Home Assistant, adding:

  • πŸ”§ Support for third-party devices (e.g, IKEA Tradfri or Philips Hue).
  • πŸ“Š Advanced logs and statistics (e.g., power consumption schedules).
  • πŸ”„ Local management without the cloud Xiaomi (reduces delays).

How to install Xiaomi Mi Home Security Gateway 3

  1. Download OpenMiHome firmware from GitHub.

⚠️ Attention: Castom firmware can disrupt devices connected to the Xiaomi cloud (such as cameras or vacuum cleaners.

πŸ’‘

If you’re not sure about your skills, use Home Assistant instead of custom firmware.It supports all Xiaomi devices out of the box and has a friendlier interface.

FAQ: Answers to Frequent Questions

Can I use Xiaomi devices without a hub?
Yes, but with limitations. Without the hub, only Wi-Fi (light bulbs, sockets, cameras) and Bluetooth (some sensors) devices on ZigBee (most Aqara sensors) require a hub, except for the Xiaomi Mi smart light bulbs. LED Smart Bulbs can be connected directly to Wi-Fi, but they won’t be involved in complex automation scenarios.
How to transfer a smart home to a new phone?
Mi Home does not have the option of export/import settings. To transfer devices: On the old phone, go to Profile β†’ Settings β†’ Account. β†’ Data export (not available in all regions) If no export, add a new phone as a "family member" to Profile β†’ Family, then delete the old device from your account. Sign in on the new phone, all devices will automatically fit in. ⚠️ Geosons and automation scenarios will have to be reconfigured!
Why Xiaomi smart devices are cheaper than their counterparts?
Xiaomi is saving on: 🏭 Mass production (orders for millions of devices reduce the cost of production). πŸ“¦ Packaging and completeness (no extra cables or instructions). 🌍 Localizations (many devices are sold with Chinese firmware, which users update independently). πŸ“‘ Cloud services (data is partially processed on the user side, not on the company’s servers), but this does not mean that the quality is worse: for example, Aqara sensors are not inferior to Philips Hue in reliability, but are 2-3 times cheaper than the price of the device.
Can Xiaomi be connected to a smart home system from another manufacturer (e.g. Rubetek)?
Technically yes, but with reservations: πŸ”„ Home Assistant or OpenHAB can integrate devices from different brands into one system. πŸ”Œ ZigBee devices (such as Xiaomi Aqara) are compatible with Rubetek or Samsung SmartThings hubs, but manual settings may be required. 🚫 Devices with proprietary protocols (such as some Xiaomi cameras) won't work with other systems.The best option for a multi-brand system is the Raspberry Pi's Home Assistant hub.
How to reset all the settings of Xiaomi smart home?
To completely reset the system: Remove all devices from the Mi Home app (Profile) β†’ The device β†’ Reset the hub to factory settings (hold the reset button). 20 seconds before the indicator flashes. In the app, go to Profile β†’ Settings β†’ Account. β†’ Delete your account (this will delete all data from Xiaomi servers).If you use Home Assistant, clear the configuration files in the folder /config. ⚠️ Once reset, all scenarios and geo-fences will be lost.