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 device | Model | Protocol | Price, β½ | Why? |
|---|---|---|---|---|
| hub | Xiaomi Aqara Hub M2 | ZigBee 3.0 + Wi-Fi | 4 200 | Support for up to 128 devices, backup power |
| Thermostat | Xiaomi Smartmi Air Conditioner Companion | Wi-Fi | 2 800 | Air conditioning management on schedule |
| Camera. | Xiaomi Mi Home Security Camera 360Β° 2K | Wi-Fi | 3 900 | Video surveillance with facial recognition |
| Motion sensor | Xiaomi Aqara Motion Sensor P1 | ZigBee | 1 400 | Automatic 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.
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:
- Install the Mi Home app (Android/IOS) and sign up (you can use Google or Apple) ID).
- Include the light bulb in the cartridge - it should flash yellow (conjugation mode).
- In the app, click + β Add the device β Lighting β Xiaomi Mi LED Smart Bulb.
- 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:
- In the app, go to Profile β Automation β Create β Custom automation.
- Select the trigger (condition): time, geofence, device state, etc.
- Add an action (what is going to happen) and you can add several actions in one scenario.
- 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 detectedHow to Enable Advanced Mode in Mi Home
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:
| Platform | Official support | How to connect | Limitations |
|---|---|---|---|
| Google Home | Yes. | Through Mi Home. β Profile β Settings β Google Assistant | Not all devices are supported (e.g. sensors) |
| Apple HomeKit | No. | Through the Home Assistant Hub + Plugin of Mi Home Integration | Requires a permanent server (Raspberry Pi) |
| Yandex Alice | Partially. | Through Yandex Station + smart-home" | It works only with light bulbs, sockets and some sensors |
To connect to Apple HomeKit:
- Install Home Assistant on the Raspberry Pi or NAS.
- Add Xiaomi Mi Home integration through HACS (Home Assistant Community Store).
- In the configuration file configuration.yaml, specify a token from Mi Home (you can get it through miot-spec.org).
- 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:
- At Mi Home, go to Profile β Geozones.
- Add a new zone, address and radius (500-1000 meters are recommended).
- Create automation with a Geozon trigger β Arrival/Departure.
- 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
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
- 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.