Xiaomiβs humidifiers are among the most popular devices in the smart home ecosystem, thanks to a combination of affordable prices, accurate operation and extensive automation capabilities. However, many users are limited to manual control, without even knowing that the device is able to maintain an optimal microclimate without constant monitoring. Setting up scenarios allows you to connect the humidifier with other sensors (for example, hygrometers or thermostats), run it on a schedule or when indoor conditions change.
In this article, weβll explore all the ways to create scenarios for Xiaomi humidifiers, from simple rules in the Mi Home app to complex logic through Home Assistant or Yandex Alice. Youβll learn how to set up automatic on-setting at low humidity, synchronize with air conditioning or heater, and avoid errors that make scenarios fail.
What Xiaomi Humidifier Models Support Scenarios
Not all Xiaomi devices integrate equally well into the smart home system, and scripting depends on the model, firmware version, and Mi Home regional server.
- πΉ Full support for automation: Xiaomi Smartmi Air Humidifier 2/3, Xiaomi Mi Air Humidifier Pro, Xiaomi Deerma Humidifier JSQ. These models have built-in humidity sensors and support all types of scenarios in the Mi Home.
- πΈ Limited support: Xiaomi Viomi Air Humidifier (requires manual addition to Home Assistant), Xiaomi Zhimi Air Humidifier CA1 (It only works with a Chinese server).
- πΆ No Script Support: Budget Models Without Wi-Fi (Xiaomi) CJXJSQ) Xiaomi Mi Air Humidifier 1 without firmware updates).
To check your modelβs compatibility, open the Mi Home app, go to Profile β Settings β Region and make sure you choose a China server (for most models) or Europe/Russia server (for global versions).If your model doesnβt show up in the supported list, try changing the region or updating the firmware through Mi Home β Device β Three Dots β Software Update.
β οΈ Note: Xiaomi Humidizers purchased in China may not work with European Mi Home servers due to manufacturer restrictions, in which case, Home Assistant or alternative firmware will be required to customize scripts.
Preparing for customization: what to do before creating scenarios
Before you start automation, make sure that the device is properly connected to the network and synchronized with the application.
Update the device to the latest version
Connect the humidifier to a 2.4GHz Wi-Fi network (5GHz not supported)
Make sure there is enough water in the tank (some scenarios donβt work when the tank is low)
Check the calibration of the built-in humidity sensor (compare readings with an external hygrometer)
Turn off the energy-saving mode on the router (it can break the connection to the device)-->
So, you pay special attention to calibrating the humidity sensor, and in cheap Xiaomi models, it can be overvalued or undervalued, to check the accuracy of the humidity sensor.
- Place the humidifier next to an external hygrometer (e.g., Xiaomi Mijia Bluetooth Temperature and Humidity Sensor).
- Run the test: in Mi Home go to Device β Settings β Sensor calibration.
- If the difference is greater than 5%, manually calibrate the sensor through Additional settings β Adjust readings.
It is also recommended to attach the device to the room in Mi Home, which will allow you to create scenarios with reference to a specific room (for example, turn on the humidifier in the bedroom only at night).
- Open the map of the house in Mi Home.
- Drag the moisturizer icon to the desired room.
- Save the changes.
Creating a baseline scenario in the Mi Home app
The easiest way to automate the humidifier is to use the built-in script builder in the Mi Home, which allows you to link the device to other sensors or set a schedule without programming. Let's take a step-by-step look at how to set up automatic on at low humidity:
- Open the Mi Home app and go to Scripts β Create a script.
- Select the script type: Automatic (to react to events) or Manual (to run on a button).
Add in the action.
- π§ Select your humidifier from the list of devices.
- Set the mode: Turn on or set the humidity level to 50%.
- Save the script and give it a name, like βDay hydration.β
For a more flexible setup, you can add several conditions, for example, to turn on the humidifier only if:
- π Time from 22:00 to 07:00 (night mode).
- π No one is home (according to the Mi Home geozone).
- π‘οΈ The temperature in the room is above 20Β°C (to avoid condensation).
| Type of script | Example of use | Essential devices |
|---|---|---|
| By humidity. | Turn on the humidifier at humidity < 40% | Humidifier + humidity sensor |
| Scheduled. | Work from 20:00 to 08:00 daily | Just a moisturiser. |
| Geo-fence. | Turn off the humidifier when everyone is out of the house | Moisturizer + smartphone with Mi Home |
| Temperature. | Include only if temperature > 18Β°C | Humidifier + temperature sensor |
β οΈ Note: Mi Home has a limit on the number of active scripts to no more than 20. If the limit is reached, delete the unnecessary rules or move them to Home Assistant.
Advanced Scenarios: Connecting with Other Devices
The basic rules in Mi Home cover only the simplest tasks. For complex automation (for example, synchronizing the humidifier with an air conditioner or heater), you will need to use third-party platforms:
- π Home Assistant: Allows you to create scenarios with multiple conditions, cycles and delays. Supports all Xiaomi models through Xiaomi Miio integration.
- π€ Yandex Alice: Comfortable for voice control and simple rules (e.g., "Alice, turn on the humidifier for 1 hourΒ»).
- π Node-RED: Visual editor for creating complex logical chains (e.g., if humidity is present) < 30% And temperature > 25Β°C, then turn on the humidifier for 30 minutesΒ»).
Consider an example of setting up in Home Assistant for automatic microclimate control:
- Install Xiaomi Miio integration through Settings β Devices and Services β Add Integration.
- Get your humidifier token with the help of miio-cli utility or Miot Spec service.
- Create automation in Settings β Automation β Create:
Alias: "Smart microclimate in the bedroom"
trigger:
- platform: numeric_state
entity_id: sensor.bedroom_humidity
below: 40
condition:
- condition: time
after:"22:00:00"
before:"07:00:00"
action:
- service: humidifier.set_mode
target:
entity_id: humidifier.bedroom_humidifier
data:
mode:"auto"
target_humidity: 50This scenario would include a humidifier in the bedroom at night if the humidity dropped below 40% and maintain it at 50%.
condition:
- condition: state
entity_id: climate.bedroom_ac
state:"cool"π‘
If the humidifier is often turned on for no reason, check the location of the humidity sensor. It should not be near steam sources (kitchen, bathroom) or on a draft.
Mistakes and Problems: Why Scenarios Don't Work
Even well-tuned scenarios can fail, and here are the most common reasons and ways to address them:
| Problem. | Possible cause | Decision |
|---|---|---|
| The script doesn't work. | The device is offline. | Check Wi-Fi connection, reboot router |
| The humidifier is turned on too often | Wrong humidity threshold | Increase hysteresis (the difference between switching on/off) |
| The script is running with a delay | Mi Home server is overloaded | Use local scripts in Home Assistant |
| The device is not displayed in the list | Incompatible Region in Mi Home | Change your server to China or update your firmware |
If the humidifier does not respond to commands from the script, check:
- Internet availability (the device must be online).
- Permissions in Mi Home: Go to Profile β Settings β Notifications and enable Automation.
- Device Logs: In Home Assistant, open Developer Tools β Logs and find Miio-related errors.
What to do if the humidifier is not calibrated?
Optimization of water and electricity consumption
Automating your humidifier not only increases comfort, it also helps you save resources, and here are some tips on how to reduce your water and energy consumption without compromising your climate:
- π§ Use hysteresis: set the difference between on and off thresholds at least 5%. For example, turn on at 40%, turn off at 45.
- β³ Limit your running time: In the scenario add the condition Maximum duration: 2 hours to avoid overhydration.
- πΏ Sync with plants: If there are flowers in the room that require high humidity, create a separate scenario with priority for them.
- βοΈ Take into account the time of day: at night, humidity naturally rises, so you can reduce the target threshold from 50% to 45%.
For maximum savings, link the humidifier to the window opening sensor. If the window is open, the humidity in the room drops quickly, and the device will work idle. To avoid this, add a condition to the scenario:
condition:
- condition: state
entity_id: binary_sensor.window_contact
state: "off" #Window closedπ‘
The use of distilled or filtered water reduces scale formation and prolongs the life of the humidifier, as well as reduces the electricity consumption for heating.
Integration with voice assistants (Alice, Google Assistant, Siri)
You can control the humidifier not only through the app, but also through your voice, and you need to connect it to one of the voice assistants, and let's look at Alice's Yandex.
- Open the Yandex app and go to Devices β Add the device.
- Choose Xiaomi and log in through your Mi Home account.
- After synchronization, tell Alice: "Switch on the humidifier for 1 hour"; "Set the humidity in the bedroom at 50%"; "Switch off the humidifier when the humidity reaches 45%."
Google Assistant or Siri will require you to connect Mi Home via Google Home or Apple HomeKit, respectively. Note that not all Xiaomi models support HomeKit β this may require middleware like Home Assistant or HomeBridge.
β οΈ Attention: Voice commands have a delay of 1-3 seconds due to cloud processing. For critical tasks (for example, emergency shutdown), use local scenarios.