How to connect a humidity sensor to a Xiaomi humidifier

Integrating smart home devices into a single ecosystem allows for truly autonomous systems that do not require constant user intervention. One of the most popular scenarios is the automatic maintenance of indoor humidity, which is especially true during the heating season or in regions with a dry climate. To achieve this task, owners of Xiaomi equipment often use a bundle of air humidifier and a separate temperature and humidity sensor, which allows you to achieve high accuracy measurements.

Many modern humidifiers of the brand are already equipped with built-in hygrometers, but their readings are often inaccurate due to proximity to the source of steam or the design of the case. Using an external sensor located at the optimal point of the room allows the system to respond to real changes in the microclimate, rather than local readings at the device, this eliminates situations where the humidifier is working in vain or, conversely, does not cope with the dehumidification of the air in the entire room.

In this guide, we will discuss in detail the process of pairing equipment, configuring scenarios in the Mi Home application and creating a work logic that will maintain the perfect moisture balance. You will learn how to avoid common errors when setting thresholds and why the correct location of the sensor is critical for the correct operation of the entire system.

Equipment and preparation for setting up

Before you start setting up automation, make sure you have compatible devices connected to the same Wi-Fi network and tied to one in-app account.The main element is the humidifier itself, which must support remote management via a cloud service or local Bluetooth Mesh/Zigbee protocol. Without this feature, creating complex scripts will be impossible, since the device will not be able to receive commands from the sensor.

The second key component is the temperature and humidity sensor. In the Xiaomi ecosystem, the most popular Mijia models, which work on Zigbee or Bluetooth protocols. It is important that the gateway, if it is required for your type of sensor, is also added to the application and is in the stable communication zone. Check the battery charge in the sensor, as poor power can lead to data delays and malfunctions in the operation of automation.

Make sure the Mi Home app software is updated to the latest version available in the official store. Developers regularly release patches that improve scripting stability and add support for new devices. It is also recommended to restart the router and devices before setting up to eliminate possible network conflicts or hanging of communication modules.

⚠️ Warning: Make sure that the region in the Mi Home app settings matches the region your devices are configured to. If the humidifier is added to the China server and the sensor is added to the Russia/Europe server, they will not be able to communicate with each other in the same scenario.

For a comfortable setup, prepare your smartphone with Bluetooth enabled and geolocation. Geolocation is required for the application to find and initially pair new devices, especially if they use the Bluetooth Low Energy protocol. Lack of access to these features can lead to a device search error or inability to complete the addition process to the system.

Adding devices to the Mi Home ecosystem

The first step is to add all devices to the app if they have not been made before. Open Mi Home and click on the plus in the upper right corner of the screen. If your humidifier or sensor does not appear automatically, search by model name or scan QR-code specified on the body or in the instructions.

When you add Zigbee sensors, you may need to activate the interface mode on the gateway, usually by pressing a button at the gateway itself or through the device menu in the application. Once you activate the search mode, press the button on the sensor, the indicator should flash, signaling the beginning of the data transfer process and network binding.

For Bluetooth Mesh devices, the process is faster and doesn’t require a gateway if your smartphone supports this technology. Once you detect the device, follow the instructions on the screen, assign each gadget a clear name and choose the room in which it will be installed. The correct name, such as “Living Room Humidifier” and “Bedroom Sensor”, will greatly simplify further navigation and scripting.

☑️ Checking readiness for automation

Done: 0 / 1

Once you've added it successfully, check the health of each device separately. Turn on the humidifier manually through the app, check if the sensor readings are updated in real time. If the sensor data is not changing or is updated with a long delay, try moving the gateway closer or replacing the power cells.

Creating an automation scenario: step-by-step instructions

The logic of a smart home is based on scenarios that are a chain of actions: “If X happens, do Y.” In our case, the event will be a change in the humidity reading, and the action will be to turn on or off the humidifier. To create a scenario, go to the “Scenarios” tab (or “Automation”) in the bottom menu of the application and select creating new automation.

Click on "Add condition" and select your humidity sensor. In the trigger list, find the option "Humidity below/above a certain value." Here it is important to set precise thresholds. For example, if you are comfortable with 40-60%, you should set the switch on to drop below 40% and turn off when you reach 60%.

Then add an action. Select your humidifier and select "On" for the first condition and "Off" for the second condition, and the system will create two separate scenarios or one complex one, depending on the version of the interface.

📊 What is the communication protocol of your devices?
Wi-Fi:Bluetooth:Zigbee:I don't know

Once the conditions are set, the system will suggest saving the script. Give it a clear name, like "Auto-humidification," and activate the switch. Now, when the humidity drops below a predetermined threshold, the smart home will send a command to turn on, and when it reaches the norm, it will turn off the device. The test is performed by artificially changing the conditions, for example, blowing on the sensor or placing it next to the moisture source.

Fine adjustment of thresholds and time intervals

Choosing the right thresholds is key to a comfortable microclimate and durability of equipment. Too narrow a range, such as turning on at 49% and turning off at 51%, will cause the humidifier to operate in a constant start-stop mode, which wears out the compressor or ultrasonic membrane, and also creates unnecessary noise in the room.

The optimal range is 5-10 percent. For example, turning on at 45% and turning off at 55-60%. Also, consider the inertia of the process: the air in the room does not humidify instantly. Between the change in the sensor readings and the actual change in the air condition, the time required for the flow to circulate passes.

In some advanced scenarios, you can add a temporary delay, such as "if the humidity is below 40% for 10 minutes, turn on the humidifier." This will avoid false positives during short-term jumps in performance, for example, when you opened a window or entered a room with wet clothes.

ParameterRecommended valueDescription of the impact
Lower threshold40-45%Point of initiation of the instrument
Upper threshold55-60%Device-off point
Delay (optional)5-15 minutesFalse positive filter
Mode of workAuto/quietPreferred mode for the night

Use hysteresis for system stability. It's a technical term for the dependence of the state of the system on its prehistory. In the context of a humidifier, it's the difference between the humidity level to turn on and off, which prevents the contacts from rattling and switching modes frequently.

Location of the sensor: impact on measurement accuracy

The location of the sensor is critical to the efficiency of the entire system, and it is absolutely not possible to place the sensor directly next to the vapor exit from the humidifier, in which case the sensor will quickly capture 100% humidity and turn off the device, although the rest of the room will remain dry.

The optimal distance from the humidifier should be at least 1-2 meters, and avoid placing the sensor in direct sunlight, near heating batteries, windows or doors where drafts are possible, these factors distort not only the humidity reading, but also the temperature, which can disrupt the work of associated scenarios.

💡

Place the sensor at a height of 1-1.5 meters from the floor – this is the level of human breathing, where the measurements will be most relevant to assess comfort.

If you have multiple rooms in your home, it makes sense to use average readings or to adjust the scenario to the driest room. However, standard Mi Home tools allow you to tie one condition to a single device. Complex zoning systems may require the use of third-party platforms such as Home Assistant, but for most users, it is enough to install one high-quality sensor in the center of the living area correctly.

Advanced capabilities and integration with voice assistants

Xiaomi’s ecosystem allows you to integrate scripts with voice assistants such as Aliice (for Chinese devices) or Google Assistant/Yandex Alice (with appropriate integrations and skills), which allows you to voice request the current status: “Alice, what humidity is in the bedroom?” or force you to change modes of operation.

You also need to pay attention to the notification function, and in the scenario settings, you can add "Send Notification to Phone" action, which is useful for monitoring: you'll know if the humidity has dropped to a critical level or if the device unexpectedly shuts down, which is especially important for families with young children or people with respiratory diseases.

⚠️ Attention: When using ultrasonic humidifiers with hard water, regularly clean the sensor of white plaque. Plaque can block the sensitive element, which will cause the readings to be underestimated, and the system will work incorrectly.

For statisticians, the sensor data can be exported or visualized using additional plugins. Analyzing the weekly humidity chart will help you understand how efficient your ventilation system is and whether you need to increase the power of the humidifier or, conversely, more often ventilate the room.

What to do if the script doesn’t work?
Check if the internet is on on the router as cloud scenarios require communication with the server. Make sure the phone and devices have the right time and time zone. Try to delete and recreate the script, sometimes the app cache causes logic errors.> Frequently Asked Questions (FAQ) Can you use a sensor from another manufacturer with a Xiaomi humidifier? Yes, it is possible, but only if both devices are added to the same ecosystem (for example, through integration in the Home Assistant or if the sensor manufacturer supports the Mi Home application). Native means create a script between devices of different brands in the Mi Home application. Why is it impossible to use the Frequently Asked questions (FAQ) Why does not use the sensor in the upper 70%, although you are not allowed to switch on the humidity in the upper condition? Also check if the humidifier itself has its own Auto mode, which can conflict with the external scenario. Make sure the sensor is not covered with dust. How often do you need to change the batteries in the sensor when you are active? When used in automation scenarios, the sensor sends data only when you change the metrics or on request, so standard AAA batteries usually last for 6-12 months. The discharge indicator will appear in the application in advance. Does automation work without the Internet? Local scenarios (if they are supported by the gateway and the firmware version) can work without access to the global network, but only Fi within the local network, however, most scenarios require stable Wi-based server processing.