Building an automated living space management system has moved from being the domain of select engineers to being accessible to every smartphone owner. Xiaomiβs ecosystem offers perhaps the most democratic and scalable entry into the IoT world, allowing you to turn a typical apartment into a responsive environment in a matter of hours. Starting a dive is not by buying dozens of gadgets, but by understanding the network architecture that will connect all devices into a single organism. It is the right choice of a central node, or gateway, that determines the stability of the entire system in the future.
Many beginners make the mistake of buying disparate devices without a clear plan, which leads to chaos in the Mi Home app and broken scenarios. The key is understanding the difference between communication protocols such as Zigbee, Bluetooth Mesh and regular Wi-Fi. Devices running over Wi-Fi can connect directly to the router, but they quickly land the battery and put strain on the network. It is critical for sensors and switches to use gateways that take on the role of coordinators, providing instant response and energy savings.
In this article, we'll take a step-by-step approach to building a reliable network, select the right hardware, and set up complex logic circuits, explain why some sensors can't be seen without a gateway, and how to make light bulbs turn on on cotton in your hands. Proper preparation at the start will save you hours of troubleshooting and nerves.
Choosing a central gateway: the heart of your system
The foundation of any automation is the Gateway, which bridges the gap between low-power peripherals and the Internet. Xiaomi and sub-brands like Aqara have many models, and the choice depends on your goals. If you plan to scale to 50-100 devices, you will need a professional hub with Zigbee 3.0 support, which provides high response speed and stability of connection. Simpler models can only work with Bluetooth devices or have a limited list of supported devices.
It is important to distinguish between gateways that require separate power from the outlet and those that can run on the battery, although the latter are rare and have limited functionality. Only gateways with Zigbee 3.0 support ensure that autonomous scenarios work when the Internet is turned off. This means that switches will turn on lights and motion sensors will fire even when the communication channel with the outside world breaks, since logic is processed locally on the device.
β οΈ Warning: When buying a gateway, be sure to check the anchor region (China or Global Version). Chinese versions often require changing the region in the Mi Home app to China, which can slow down the server for other devices.
Modern multimodal gateways often combine night light, radio, and even voice assistant functions. They can act as repeaters to enhance Zigbee coverage in the far corners of an apartment. For a large apartment or house, multiple gateways or relay devices make sense to create a mesh network where each gadget amplifies the neighbor's signal.
π What communication protocol is a priority for you?
Zigbee (stability)
Bluetooth Mesh (Availability)
Wi-Fi (simplicity)
Matter (future)
Communication protocols: Zigbee vs Bluetooth Mesh and Wi-Fi
Understanding the differences between protocols is what sets the amateur from the professional in the smart home world: Wi-Fi devices are easy to connect: you typed in a password and you're done. But each device puts a constant strain on the router, and with more than 15-20 devices, a standard home router can start to choke, losing data packets, and Wi-Fi devices consume significantly more power, making them unusable for miniature sensors that run for years on a single battery.
Zigbee is designed specifically for IoT. It forms a mesh network (mesh), where every constant-powered device (light bulbs, sockets, switches) relays a signal to other devices. This allows the signal to bend around walls and reach the most remote points. Sensors on Zigbee βfall asleepβ and wake up only to transmit a signal, living on a battery for 2-3 years. Bluetooth Mesh works on a similar principle, but requires a gateway that is often built into modern speakers or Xiaomi TVs.
Technical nuances of Zigbee network
Zigbee network operates at 2.4 GHz, like Wi-Fi, but uses other channels. When setting up the gateway, the system automatically selects the least noisy channel to avoid interference with your home Wi-Fi router.> To build a reliable system, it is recommended to adhere to the golden rule: sensors and switches - only Zigbee or Bluetooth, smart lamps and sockets - Zigbee or Wi-Fi (if there are few of them). Mixing protocols in one scenario is possible through the application, but the local response rate will be higher when using a homogeneous network, it is first to buy the sensor in the baseline, which is usually equipped with the first sensor in the sensor, which is the first to buy the sensor in the baseline. Choose models with a 170-degree viewing angle and the ability to mount on a wall or set on a table. Modern motion sensors also know how to measure light, which allows you to turn on the light only when the room is really dark. The second essential element is the door and window opening sensor. It consists of two parts: a main unit and a magnet. When you open the door, the system instantly receives a signal. It is the base for security scenarios (a siren when you open) or comfort scenarios (lights on when you enter). The third element is a smart socket or relay, which will allow you to control the usual technique: a humidifier, heater or coffee maker. π Motion sensor: detects the movement of people and animals, has night lights. πͺ Opening sensor: responds to the opening of the magnet, has a small size. π‘ Smart lamp: changes color and brightness, requires constant power to work. π‘οΈ Temperature sensor: It measures climate, often combined with a hygrometer. Don't forget the buttons. A wireless button is a universal control panel, and with one click, it can turn off all the lights, run a robot vacuum cleaner, or send a notification to your phone. Unlike sensors, buttons require physical action, giving the user full control over the automation. βοΈ Basic set to start Select a gateway location Buy Zigbee Gateway Purchase 2-3 Motion sensor Buy smart light bulbs Check battery charge in sensors: 0 / 5 Installation and pairing of devices in Mi Home The setup process begins with the installation of the Mi Home application (or Aqara Home, if you choose the ecosystem of this brand. Usually, you need to press the reset button on the device before the indicator flashes and select "Add device" in the application. It is important to bring the smartphone as close as possible to the gateway during pairing, since the phone's Bluetooth module is used to initially transmit data about the Wi-Fi network. After successful addition of the gateway, the connection of the periphery begins. For Zigbee devices, you need to transfer the gateway to search mode (usually by long pressing or through the menu) and activate the pairing mode on the sensor itself (it often requires 5 times to quickly press the reset button). Device type Reset method Indication Time to pair Motion sensor 5 Click on the button Blue Blink Before 10 SEC Smart Lamp 5 switching on/off Light pulsation Before 15 SEC Opening Sensor 5 Click on the button Blue Blink Before 10 sec Gateway Holding 5-7 sec Orange blinking Until 30 If the device is not located, try to bring it close to the gateway, and after successful addition, carry it to the installation site. 1-2 Also make sure that the battery protector film is removed completely and the contacts fit tightly. Scenarios and automations The magic of the smart home is revealed in scenarios, if... then... In the Mi Home app, the Automation section (or Scenarios depending on the version) allows you to create a logic of work. Basic security scenario: IF the door opening sensor is triggered and the time between 23:00 and 07:00, TR: Turn on the siren on the gateway and send a push notification to the phone. More complex scenarios may involve several conditions. For example, the "I'm at home" scenario: IF the phone's geolocation shows the arrival in radius 100 And the light sensor says "dark," TR turns on the hallway and living room. 5 Turn off the lights after the movement, which is ideal for corridors. β οΈ Attention: When creating geolocation scenarios (GPS) Note that they only work when the Internet is turned on and may have a delay to 1-2 You can't rely on them for critical security tasks, but local scripts, which are tied to the Zigbee gateway, run instantly and run without the Internet. This is critical for light switches: you donβt have to depend on the provider to just turn on the light bulb.When creating a script, pay attention to the local or cloud icon β try to minimize cloud dependencies for commonly used features. π‘The main principle of automation is that the script should solve the problem, not create a new one. If you have to wait 3 seconds for the server to respond to the lights, then this scenario should be redesigned to local execution. Typical problems and solutions Despite the robustness of the ecosystem, users may face a number of common problems, most commonly "Device offline" or periodic loss of communication, often not due to a breakdown, but to a bad signal or a dead battery. If the sensor is far from the gateway, the signal may be lost through concrete walls. In this case, it helps to install a network-powered intermediate device (lamp, socket) that will strengthen the Zigbee network. Another problem is the "sticking" of statuses in the application. For example, the application shows that the light is turned off even though it is on. The solution lies in rebooting the gateway (turning off the socket for 10 seconds) or reconnecting the device, and it is also worth checking whether the Mi Home app or the gateway firmware has been updated, since after updates, you sometimes need to reauthorize. πΆ Weak signal: add repeater or move gateway closer. π Battery discharge: Replace the power cell even if the app shows 10%. π Conflict IP: Restart router if your Wi-Fi devices are no longer responding. π Server error: Check the status of Xiaomi servers, sometimes problems on the company's side. If the device has stopped responding to the reset buttons, try replacing the battery with a new one, even if the old one shows a normal charge. Under load (at the time of radio transmission), the voltage in the old battery can drop sharply, causing a malfunction of the microcontroller. Why does the motion sensor sometimes fail? Motion sensors have "dead time" (about 1 minute) after activation, so as not to send hundreds of notifications. They may not see the movement if it occurs perpendicular to the sensor, or if the human body temperature is equal to the ambient temperature (rarely, you can use the Internet without a global network in the summer, but you can use the network). Control via an application from the outside network is impossible without the Internet. What is the difference between Mi Home and Aqara Home? Mi Home is a universal application for the entire Xiaomi ecosystem. Aqara Home is an application for Aqara devices (sub-brand). Some Aqara devices are only visible in the native application and have more advanced functionality there, but can be added to Mi Home through a plugin. How to reset all the smart home settings? To completely reset, you need to remove the gateway from the application (holding the icon). This will untield all the devices connected to it, while the devices themselves will remain in memory, but they will have to add again through pairing.