Connecting Xiaomi Temperature Sensor to Zigbee Gateway: Complete Guide

A full-fledged smart home system is impossible without accurate indoor climate data. Xiaomi’s Zigbee-based temperature and humidity sensors are some of the most popular solutions on the market because of their autonomy and affordable price, but unlike Wi-Fi devices, they cannot operate on their own and require a central network coordinator, a gateway.

Integrating these sensors into your ecosystem may seem challenging at first glance, but in fact, Zigbee is designed to make it easier to build extensive, low-power networks, and pairing them together to ensure that the data is transmitted consistently and automation is triggered instantly, which is critical to keeping your home or apartment comfortable.

In this article, we will take a look at all the steps of connection, from hardware preparation to the intricacies of setting scenarios in the Mi Home app. You will learn how to avoid typical pairing errors, why the distance between devices plays a key role, and how to make your system work like a Swiss watch.

Preparation of equipment and selection of a compatible gateway

The first and most important step is to check the compatibility of your hardware. Not all Xiaomi gateways support temperature and humidity sensors, especially if it comes to different generations of devices. You need to make sure you have a gateway that supports Zigbee 3.0 or earlier versions, such as Zigbee 1.2, depending on the sensor model.

Note the model of your sensor. The most common versions of Xiaomi Mi Temperature and Humidity Sensor are round-display versions or newer rectangular models. A round-sensor often requires a Zigbee-enabled gateway to work, while some Wi-Fi versions can run autonomously but lack the benefits of a mesh network. Make sure the sensor has a fresh CR2032 battery installed, as low voltage can prevent successful pairing.

It is also critical that the gateway itself be connected to the internet and added to the Mi Home app before setting up peripherals.Without active communication with Xiaomi's cloud server, adding new gadgets will be impossible. Check if the gateway lights blue or green, which signals the normal state of the network.

  • πŸ“± Make sure your smartphone has a Mi Home app with a region that matches your account.
  • πŸ”‹ Check for protective film on the sensor battery contacts before installation.
  • πŸ“‘ Place the gateway and sensor at a distance of no more 1-2 Meters apart during the interconnection procedure.
  • πŸ”„ Update the gateway firmware to the latest version through the device menu in the app.

⚠️ Note: If you use a gateway from the Aqara ecosystem, make sure that Xiaomi's sensor also supports this standard.Some older sensor models may not be defined by new Aqara gateways due to differences in encryption protocols.

After the equipment is ready, you need to program the environment. Open the Mi Home app and go to your gateway profile. Here you will see a list of connected devices. If the list is empty or contains only the gateway itself, then the system is ready to receive new signals. Don't ignore this step, because adding devices to a crowded network can sometimes lead to addressing conflicts.

The process of pairing the sensor with the Zigbee gateway

The process of connecting the temperature and humidity sensor to the gateway takes only a few seconds, if you follow the right algorithm, the main task is to put the sensor in the network search mode, after which the gateway will detect it itself and prompt you to complete the setup. To activate the pairing mode on the sensor housing there is a hidden button.

Find a small circular recess on the back of the device, which is the reset and plug button, you'll need a thin object, like a paper clip or a toothpick, to press it, and don't use sharp metal objects with excessive force, so as not to damage the mechanism of the button or the body.

The algorithm is simple: press and hold the button for 5-7 seconds, and you will see the sensor screen flash blue (or a communication icon, depending on the model), which means that the device broadcasts a signal of readiness for connection, at the same time in the Mi Home application should appear a pop-up with a suggestion to add a new device.

β˜‘οΈ Pre-conjugation check

Done: 0 / 4

If you don't detect automatically, you can try adding the device manually. In the app, click on the plus in the upper right corner, select the Sensor category and find your model in the list. The app will go into search mode and start scanning the ether. At this point, press the button on the sensor again with a short press (1 second) so that it sends a trial data packet.

Successful connectivity is confirmed by the gateway's audible signal and the sensor icon appearing in the list of devices in the application. The system automatically assigns a name to the device that you can change later. It's important not to move the sensor to another room immediately after you connect, give it time to stabilize the connection and transmit the first packets of temperature data.

Data display setting and calibration

Once you've successfully added a device to the network, you'll have a wide range of settings. The standard interface shows the current temperature and humidity, but for a deeper analysis, you'll need to learn more. In the device's menu, you can set up units of measurement (Celsius or Fahrenheit) and the time display format.

One useful feature is the ability to calibrate readings. Although Xiaomi sensors are highly accurate, in some cases there may be a slight error. In the settings of the device, you can find the item "Correction" or "Offset", where you can manually add or reduce a few degrees or percent of humidity, based on the readings of the reference device.

Also worth paying attention to is the frequency of data updates. Zigbee saves battery power by sending data only when the data changes or on schedule. In standard settings, the sensor updates information when the temperature changes by 0.5 degrees or humidity changes by 3%. You can change these thresholds if you need more detailed statistics, but this will lead to faster battery discharge.

ParameterStandard valueRecommended valueImpact on the battery
Frequency of updateChanges in indicatorsEvery 10 minutes.Average.
Temperature threshold0.5 Β°C0.3 Β°CHigh.
Humidity threshold3%2%High.
Sleep regimenIncludedIncludedLow.

For data scientists, there's a history that can be made, and it can store graphs of temperature and humidity over the course of a day, a week or a month, and it can track the dynamics of the microclimate and detect patterns, like rising humidity at night or a sharp drop in temperature when aired.

πŸ’‘

For the most accurate statistics, place the sensor away from direct heat sources, windows and drafts, and the optimal height of the installation is 1.5 meters from the floor in the center of the room.

Creating automation and work scenarios

The key value of a smart home is not just monitoring, but auto-response to changes in the environment, and the temperature and humidity sensor acts as a trigger, a signal source that triggers the action chain of other devices, and scenarios allow you to create truly comfortable conditions without your involvement.

Consider a classic winter use case: you can set a scenario: "If the temperature has dropped below 20Β°C, turn on the smart socket with the heater." To do this, select "When the sensor temperature...", specify a threshold value and add "Enable the device".

In summer, the reverse is true for humidity, where you can start the dehumidifier above 60 percent or you can turn on the air conditioner in dehumidification mode, and you can also link the sensor to a smart humidifier, where when the humidity drops below 40 percent, the humidifier automatically starts working, maintaining the optimal microclimate.

  • 🌑️ Automatic activation of the air conditioner when exceeding temperature 25Β°C.
  • πŸ’§ Starting the air humidifier if the humidity drops below 35%.
  • πŸͺŸ Send a notification to the phone in case of a sharp drop in temperature (signal about opening a window in winter).
  • πŸ”” Sound alert through the gateway at critical values of the microclimate.

It's important to remember the delays and the execution conditions. You can set time limits in the scenario settings, such as activating the heating only at night or only when no one is home (using geolocation), which saves energy and avoids situations where the equipment is wasted.

⚠️ Note: When creating scenarios with air conditioners or heaters, be sure to use hysteresis (the difference in on and off temperatures). For example, turn on the heating at 19°C, turn it off at 21.°C so devices don't click back and forth every minute.

Zigbee network expansion and the role of repeaters

One of the key features of Zigbee is the ability to build a mesh network, where each device with constant power acts as a repeater, which means that the signal from the sensor can be transmitted not directly to the gateway, but through other devices, which greatly increases the coverage radius and stability of communication.

The battery-powered temperature sensor itself is a sleeper device that can't relay the signal, but if you plug a smart socket, relay, or Zigbee lamp into the system, they'll take on the function of signal amplifiers, and by placing these devices strategically around the apartment, you can extend the Zigbee network to even the most remote rooms.

How does Zigbee Mesh Network work?
There are three types of devices in the Zigbee network: coordinator (gateway), routers (device with constant power), and end devices (battery sensors), and routers take the signal from the end devices and transmit it further, creating a mesh structure where failure of one node does not destroy the entire network.

If you notice that the sensor is periodically losing communication or the data is updated with a great delay, this is a sure sign of a weak signal, in which case you do not need to buy an additional gateway. You just need to install a smart Zigbee outlet in the corridor between the sensor room and the main gateway, this action often solves 90% of the problems with the connection stability.

When planning your network, consider physical obstacles. Thick concrete walls, mirrors, and metal structures can shield the signal. Try to have repeaters in line of sight or across a single wall from the end sensors. Zigbee operates at 2.4 GHz, which is also used by Wi-Fi routers, so interference is possible.

πŸ“Š What is your main Zigbee gateway?
Xiaomi Multimode Gateway
Aqara Hub M2
Aqara Hub M1S
Another brand

Diagnostics of problems and error solving

Despite the reliability of the system, sometimes there are malfunctions. The most common problem is that the sensor is not added to the application. If the indicator flashes, but the gateway does not see the device, try to bring the sensor as close as possible to the gateway (literally 10-20 cm). Sometimes at the maximum distance the signal is only enough for blinking, but not for handshake procedures.

Another common situation is that the sensor is displayed as "offline" or the data is not updated for a long time. First of all, check the battery power. Even if the indicator is on, the voltage may not be enough for stable radio communication. Replace the battery with a new one, preferably from a well-known brand (Duracell, Panasonic), since cheap counterparts often have lower capacity.

If the battery replacement didn't work, do a full reset, press the button 10 seconds before the reset icon appears, or until the indicator flashes 5 times. Then remove the device from the application (if there is one), and try to add again. Sometimes it helps to flash the gateway itself or temporarily shut down the Wi-Fi router during pairing to eliminate interference.

Sensor reset sequence:


1. Remove the battery.




2 Press and hold the reset button.




3. Insert the battery without releasing the button.




4 Hold the button for another 5 seconds after the indication appears.




5. Release the button and (wait) 10 seconds.

In rare cases, the problem is overflowing the gateway memory: If the maximum number of devices connected to the gateway (usually 32 or 64 depending on the model), new ones may not be added. Check the list of connected devices and remove unnecessary or long-unused gadgets.

πŸ’‘

95% of connection problems are solved either by replacing the battery with a quality one, or by bringing the sensor close to the gateway at the time of pairing.

Frequently Asked Questions (FAQ)

Can Xiaomi Sensor Connect to Aqara Gateway?
In most cases, yes, ecosystems are compatible, as they use the standard Zigbee protocol. However, to ensure stable operation and access to all features (for example, local scenarios without the Internet), it is better to use devices of the same brand.
How often should I change the battery in the sensor?
At standard settings and normal temperature, a single CR2032 battery lasts for 1-2 years. If the sensor is installed in a cold room (for example, on a balcony in winter) or in an area with a very poor signal, the service life can be reduced to 6-8 months due to increased energy consumption for signal transmission.
Does the sensor work without the internet?
The sensor itself measures the temperature without the Internet. However, for initial setup and addition to the gateway, the Internet is mandatory. Once setup, if the Internet goes down, local scenarios (tied to the gateway) can continue to work, but you will not be able to receive notifications on the phone and see the history in the application.
Why does the sensor show the wrong temperature?
The sensor measures the temperature of its own body. If it's installed next to the heaters, in the direct sun or in a draft, the readings will be distorted. Give it time (about 30-60 minutes) after installation to align the temperature with the environment.