Climate automation: connecting Xiaomi sensor to humidifier

Creating a perfect microclimate in the apartment has ceased to be the lot of science fiction and has become an affordable reality for owners of the Xiaomi ecosystem. However, many users buy a smart humidifier and a separate temperature sensor, unaware that these devices can work in conjunction, completely eliminating the need for manual control. Automation of processes allows you to maintain humidity at a given level without your participation, which is especially important in the heating season.

In this article, we're going to look at not just the pairing process, but the creation of complete logic chains that turn disparate gadgets into a single smart system, and you're going to learn how to get the humidifier to turn on only when the humidity drops below normal, and turn off when you reach optimal values, and it's not only comfortable, but also saves the device life and electricity.

To get started, youโ€™ll need a stable internet connection and an installed Mi Home app, which is the brain that processes sensor data and commands the actuators, and itโ€™s important to understand that direct Bluetooth or Zigbee communication between the sensor and the humidifier is often not happening โ€” all commands go through a cloud server or local hub.

Equipment and network requirements

Before you start setting up scenarios, you need to make sure that you have compatible devices. Xiaomiโ€™s ecosystem is vast and not all models can communicate with each other equally effectively, and the key element here is support for communication protocol and regional linking of accounts.

  • ๐Ÿ“ฑ Smartphone with Mi Home app installed and authorized account.
  • ๐ŸŒก๏ธ Temperature and humidity sensor (e.g. Mijia Bluetooth Thermometer 2 or Zigbee version).
  • ๐Ÿ’ง Air humidifier with Wi-Fi or gateway support (Series Smartmi, Deerma, Xiaomi).
  • ๐Ÿ“ก Gateway, if you use Zigbee protocol sensors.

Special attention should be paid to the region of the server. Often it happens that the sensor is released for the Chinese market and the humidifier is released for the global market, in which case both devices must be added to the application with a choice of the appropriate region, or (most often necessary) all devices must be tied to the server "China", since the automation functionality there is the most complete.

โš ๏ธ Note: Devices that work via Bluetooth (BLE), They require a Bluetooth-enabled gateway or a smartphone that's always nearby to send data to the cloud.

Also critical is a stable connection to 2.4GHz Wi-Fi network. Smart home devices rarely support the 5GHz band, and attempts to connect them to dual SSID can lead to errors.The communication protocol must be configured correctly so that delays between sensor reading and humidifier response are minimal.

๐Ÿ“Š What is the communication protocol of your devices?
Wi-Fi
Bluetooth
Zigbee
I don't know/I need to check.

Primary Device Configuration in the Mi Home App

The first step is to successfully add each device to the app individually, and you can't create a scenario if the "executor" or "condition" isn't already on the list of available devices, and the addition process is standard, but it has its own nuances for different types of connectivity.

The humidifier usually requires you to press the button combination (often the on button and the mode button) before the sound signal or the Wi-Fi indicator flashes ยซ+ยป, select the device from the list or scan QR-Enter your Wi-Fi password and wait for the configuration to complete.

With temperature sensors, the situation is simpler: in most models Xiaomi and Mijia, it is enough to remove the protective film from the battery. The device immediately goes into search mode. If the sensor uses the Bluetooth protocol, the phone will suggest connecting it itself, provided that GPS and Bluetooth are turned on. For Zigbee devices, the search mode on the gateway must first be activated.

โ˜‘๏ธ Checking readiness for automation

Done: 0 / 4

Make sure that the device names are clear to you. Rename them to Device Profile โ†’ Settings โ†’ Device Name. For example, call the sensor โ€œBedroom Sensorโ€ and the humidifier โ€œBedroom Humidifierโ€ to eliminate confusion when creating complex scenarios where there may be multiple identical devices in the system.

Creating a baseline automation scenario

The easiest and most effective way to link the sensor and the humidifier is to create a script in the Automation section (or Scenes in older versions of the app), and the logic here is "If โ†’ That," and we set the humidity condition and the action for the humidifier.

Go to the bottom menu of the app, select the Automation tab, and click Create. Select Device as the trigger(s), find your temperature and humidity sensor. Select Humidity from the list of conditions, and specify a threshold value, such as Lower 40%, which means that the scenario will start when the air becomes too dry.

Then you add an action. Click Add Action โ†’ Device โ†’ Select your humidifier. As a command, turn on. However, to keep the system running in cycles, you need the reverse scenario: "If the humidity is above 60% โ†’ Turn off the humidifier." Without the second condition, the humidifier will work continuously after the first start.

ParameterScreenplay โ€œInclusionโ€Scenario "Switch off"Recommended value
Trigger.Humidity < 40%Humidity > 60%40-60% (comfort)
Action.Turn onTurn it off.Auto/Turbo
PeriodAll day longAll day long00:00 - 23:59
The deviceHumidity sensorHumidity sensorLocation: Home

It is important to consider hysteresis (the difference between on and off) so that the humidifier does not "flash" back and forth at values of 39-40%.The difference of 5-10% between the trigger thresholds is the optimal setting for extending the life of the compressor or ultrasonic membrane.

What is hysteresis in a smart home?
Hysteresis is a delay or difference in values to prevent a device from switching state frequently, for example, if you turn on the humidifier at 40% and turn off at 41%, it will turn on and off every minute, a difference of 5-10% stabilizes the system.

Advanced settings and time intervals

Basic scenarios are good, but life makes adjustments. You don't need the same humidity during the day when you're not home and at night when you're asleep. Mi Home allows you to add the time and state of other devices to the automation chain.

You can modify the scenario by adding a "Time Only" condition, such as setting up a humidity level of 50-60% from 22:00 to 07:00, and in the afternoon, from 09:00 to 18:00 when no one is in the apartment, set a minimum threshold of 30% or turn off the automation altogether, which will prevent water and electricity from overrun.

An even more complex but useful scenario is integration with a door opening sensor, and the logic might be, "If humidity < 40% And the window is closed โ†’ Turn on the humidifier," which would prevent the humidifier from going outside through the open window, which is especially true in winter.

โš ๏ธ Note: When creating complex chains with the condition "andยป (AND), If one of the devices is offline or transmits incorrect data, the scenario may not work.

Also worth considering is the use of Do Not Disturb mode, which can be set to prevent the humidifier launch notifications from coming to the phone at night, or to allow the humidifier to go into silent night mode when the script is activated after 23:00.

๐Ÿ’ก

Use Turbo mode in the on scenario if you need to quickly raise the humidity after ventilation, then switch to normal mode after 30 minutes using the in-app timer.

Possible problems and ways to solve them

Despite the apparent simplicity, users often face situations where automation doesn't work, and the most common reason is data desynchronization. 10-15 minutes to save battery power, and the humidifier simply "does not know" about the changing conditions.

The second problem is regional constraints, where if you move or change region in an app, devices may become unavailable to create new scenarios, and this is where you can create a Family in the Mi Home app and add devices from different regions to the same group, although this doesn't work for all models.

  • ๐Ÿ”„ Reaction delay: Check the sensor survey interval. For Bluetooth sensors, it can be big. Solution: buy a sensor with Wi-Fi or Zigbee, they respond faster.
  • ๐Ÿ“ถ Loss of communication: Make sure the humidifier doesn't go into deep sleep.Some models turn off the Wi-Fi module after a certain downtime.
  • ๐Ÿ”‹ Battery discharge: Weak charge in sensor can lead to rare data packets being sent.Replace battery CR2032.

If a script is created but not executed, try removing it and re-create it by carefully checking each condition, sometimes by rebooting the app itself or re-linking your Mi Home account.

๐Ÿ’ก

The stability of automation depends on the quality of Wi-Fi coverage at the installation site of the devices and the type of communication protocol sensor (Zigbee/Wi-Fi is more reliable than Bluetooth).

Alternative management methods through third-party platforms

For advanced users who lack the functionality of a standard application, there are alternatives: integration with smart home systems of the level of Home Assistant, HomeKit (through plugins) or Yandex.Smart home opens new horizons.

For example, you can create a scenario in Home Assistant that takes into account the weather forecast outside the window, and if it's raining outside and the humidity is high, the system will adjust the target values for the apartment itself, even if the inside is dry due to the heating, a level of intelligent control that is not available in a standard application.

And voice assistants are also popular, and by setting up a bundle in Mi Home, you can voice through Alice or Siri to request current humidity or force humidification, even when you're out of the house, if the ecosystems are connected.

How to integrate Xiaomi into HomeKit?
Integration of Xiaomi devices into Apple HomeKit will require a gateway with HomeKit support (such as Aqara Hub) or the use of a Raspberry Pi-based software gateway with a homebridge-mi-air-purifier plugin installed (which also works for humidifiers), which will allow you to control the humidifier through the Home app on the iPhone.
Does automation work without the internet?
Standard cloud automation Mi Home requires the Internet. However, if you have a local server (Home Assistant) or Aqara gateway with configured local automation, scripts can be executed on the local network even when the Internet is off.
Why does the sensor show incorrect humidity?
Temperature and humidity sensors have a margin of error, and placing the sensor next to the window, battery or humidifier itself distorts the readings. Place the sensor at least 1 meter away from the heat and steam sources, at an altitude of 1-1.5 meters from the floor to get real climate data in the respiratory zone.
Can I use multiple sensors for a single humidifier?
Yes, you can choose the "OR" condition in the script, for example, "If the Bedroom Sensor is the one that's in the room." < 40% OR Living room sensor < 40% โ†’ But it makes sense to tie a particular humidifier to a sensor in the same room, so that you don't moisturize the whole apartment evenly, but locally improve the climate.
What is the humidity range considered normal?
The 40-60% range is considered comfortable for humans; the humidity below 30% is drying; above 70%, there is a risk of mold formation and dust mites reproduction; set target values in scenarios within 45-55% for optimal balance.