Where to look for smart scenarios for Xiaomi: official and hidden sources in 2026

Xiaomi’s smart scripts turn disparate devices into a single ecosystem that can automate routine tasks, from turning on lights on a schedule to complex chains of reactions to changing weather or your location. However, many users face the challenge of where to find ready-made scenarios, how to adapt them to their needs or create them from scratch? The official Mi Home app offers basic functionality, but not all the features are obvious there.

In this article, we’ll look at 5 proven sources of smart scripts for Xiaomi, from hidden partitions in branded apps to third-party platforms and enthusiast communities, how to find ready-made solutions for popular tasks (such as imitation of presence or automatic ventilation), where to download custom templates, and how to safely test scenarios before implementation.

1. Official Mi Home app: hidden sections and ready-made templates

To start with, the most obvious is the Mi Home app (renamed Xiaomi Home in some regions), which has a built-in script library, but it's often overlooked.

  1. Open the application and go to the Profile tab β†’ Smart home. β†’ Automation.
  2. Press. + Add β†’ Script.
  3. At the top of the screen, select the Template tab (it is easy to skip it, as the Empty script opens by default).

Here you'll find pre-configured scenarios for popular devices: Yeelight lamps, Mi Robot robot vacuum cleaners, motion sensors, etc. For example, the Night Mode pattern automatically turns off all the lamps and turns on the night light when you activate Do Not Disturb mode on your smartphone.

⚠️ Note: In the Russian and European versions of Mi Home, the number of templates may differ from the Chinese version. AI Speaker is only available to Chinese users.

If standard templates aren't enough, try combining devices manually, for example, you can create a script that:

  • 🌑️ Xiaomi Smartmi air humidifier turns on when Aqara sensor captures humidity below 40%.
  • πŸšͺ Sends a notification to your phone if the Mijia door sensor is triggered in your absence.
  • β˜€οΈ Closes the curtains of the Mi Smart Curtain when a certain light is reached (data from the Mi Light Sensor sensor).

For advanced users, Mi Home has a hidden Lab feature (not available in all regions) to activate it:

  1. Go to Profile. β†’ Settings β†’ Laboratory.
  2. Enable the option Developer Mode.
  3. Return to Automation and an additional tab will appear Advanced Scenarios with Extended Triggers (e.g. Weather Change or Geolocation).
πŸ“Š What kind of smart home ecosystem do you use?
Only Xiaomi.
Xiaomi + Other Brands
Home Assistant
Apple HomeKit
Google Home

2.The Mi Home app (Chinese version): advanced features

The Chinese version of Mi Home (available on the official website) offers 2-3 times more script templates than the global versions.

  • 🎡 Automatically turn on music on the Mi AI Speaker when you return home.
  • 🍳 Notification of the readiness of the dish in the multicooker Mi Smart Rice Cooker.
  • 🚿 Control of water consumption through the Mi Water Meter.

To use the Chinese version:

  1. Download. APK-File from app.mi.com (select the version for the ).
  2. Install the application (permission to install from unknown sources may be required).
  3. Register a new account with a Chinese phone number (or use virtual number services).

⚠️ Note: Devices linked to a Chinese account will not appear in the global version of Mi Home, and some devices (such as Mi Robot Vacuum Mop 2 Pro) in Chinese firmware support features not available in international versions.

The Chinese version has a unique section (Smart Scenes) where you can find multi-stage scripts.

Trigger: The motion sensor in the hallway is triggered after 20:00




Condition: No one is home (by geolocation of smartphones)




Action:




1. Turn on the light in the hallway (Fury 50%)




2. Send a notification to the phone with a photo from the camera Mi Home Security Camera




3. If the movement has not stopped within 5 minutes, turn on the siren

For convenience, you can use a real-time translator (e.g. Google Translate with overlaying through the camera), but be aware that some technical terms are not translated correctly.

πŸ’‘

If you already have devices linked to a global account, you can migrate them to the Chinese version through Device Migration in your profile settings, but this process is irreversible!

3. Home Assistant: Unlimited Script Options

If you don’t have enough of Mi Home, Home Assistant (HA) β€” It's an open platform that allows you to create scenarios of any complexity:

  • πŸ”— Integration of devices from different brands (not only Xiaomi).
  • πŸ“Š Visual Automation Editor (Node-RED).
  • πŸ› οΈ Support for Python scripts and YAML.

To connect Xiaomi devices to Home Assistant:

  1. Install Home Assistant on the right platform (Raspberry Pi, NAS, or even an old PC).
  2. Add Xiaomi Miio integration through Settings β†’ Devices and Services β†’ Add integration.
  3. Enter your Mi Home account token (it can be obtained via miot-spec.org).

Examples of scenarios that can be implemented in Home Assistant:

Trigger.ConditionsAction.Example of devices
The window opening sensor is activated.Temperature outside < 10Β°CSend a notification: β€œClose the window to avoid freezing!”Aqara Door Sensor, Mi Temperature Sensor
Level. COβ‚‚ > 1000 ppmSomeone at home (geolocation)Enable the supply ventilation and send a warningMi Air Quality Monitor, Smartmi Fan
Robot vacuum cleaner completes cleaningTime between 20:00 and 22:00Turn on the lights in the corridor for 10 minutesMi Robot Vacuum, Yeelight

For those who do not want to understand YAML, Home Assistant has a visual automation editor:

  1. Go to Settings. β†’ Automation and scenes.
  2. Click Create Automation and select Visual Editor.
  3. Drag blocks of triggers, conditions, and actions (like a constructor).

⚠️ Note: When using Home Assistant, Xiaomi devices can consume more power, as the platform polls them more often than the native app. To save battery on sensors, set up the poll interval in the configuration file.

Install Home Assistant on Raspberry Pi 4 or NAS|Get Mi Home Token via miot-spec.org|Add integration Xiaomi Miio|Set up geolocation through the Home Assistant Companion app|Create a backup of the configuration-->

4.Communities and forums: where to download ready-made scenarios

If you don't want to reinvent the wheel, you can use the scripts from other users.

Official Xiaomi (Mi Community) Forum

On the c.mi.com forum, there is a Smart Home section where users share their settings.

  • πŸŒ™ Presence Scenario (Accidentally Turning on Lights and TV in Your Absence).
  • πŸš— Automatic opening of the garage door when you enter the house (using geolocation and Mi Smart Door Lock).
  • 🌱 Auto-watering plants according to the soil moisture sensor.

To find relevant topics, use a keyword search:

  • Smart scenario (for Chinese section)
  • Mi Home automation.
  • Home Assistant + Xiaomi.

GitHub: repositories with templates

There are dozens of repositories on GitHub with ready-made scripts for Xiaomi and Home Assistant.

  • πŸ“ com.xiaomi-miio – a collection of automations for Mi Home devices.
  • πŸ“ Home Assistant Official Documentation – Examples of Configurations.
  • πŸ“ xiaomi_vacuum_map_parser β€” Advanced scenarios for robot vacuum cleaners.

To use the template from GitHub:

  1. Download the file.yaml or.json.
  2. Import it to Home Assistant via Settings β†’ Automation β†’ Imports.
  3. Adapt device names (entity_id) your configuration.

Telegram chats and VKontakte groups

In Russian-speaking communities, localized scenarios are often shared.

  • πŸ“Œ Xiaomi Smart Home (Telegram).
  • πŸ“Œ Smart home Xiaomi (Vkontakte).
  • πŸ“Œ Home Assistant in Russian.

The advantage of chat rooms is that they can help you set up quickly, like asking for:

  • πŸ”§ Help with the integration of Xiaomi and Google Assistant.
  • πŸ“₯ Ready-made scenario for Mi Air Purifier control according to Mi Weather Station.
  • πŸ› οΈ Tips for eliminating device connection errors.

⚠️ Warning: Before using someone else's scripts, check them on a test device. Some automations may contain errors (e.g., endless loops) that will overload the system.

How to check the security scenario?
1. Review the code for suspicious commands (e.g., sending data to external servers). 2. Run the script in simulation mode (available in Home Assistant). 3. Limit automation rights (e.g., deny access to personal data). 4. Use a separate Mi Home account for testing.

5. Third-party platforms: IFTTT, Google Home, Apple HomeKit

If you’re not just using Xiaomi devices, you can connect them to other ecosystems through a new network. IFTTT or-app.

5.1. IFTTT (If This Then That)

IFTTT It allows you to create simple if-then scenarios, for example:

  • πŸ“§ If an email with the theme β€œDelivery” came to the mail, turn on the Yeelight smart lamp in green.
  • πŸ“… If the Google Calendar has a Cleanup event, run the robot vacuum cleaner Mi Robot.
  • 🌦️ If weather forecaster predicts rain, close smart curtains Mi Smart Curtain.

To connect Xiaomi to IFTTT:

  1. Register at iftt.com.
  2. Activate Xiaomi Mi Home in My Services.
  3. Connect your Mi Home account.
  4. Create a new applet (Create) β†’ If This Then That).

Limitations IFTTT:

  • ❌ Maximum 3 applets in the free version.
  • ❌ Delay of implementation up to 15 minutes.
  • ❌ No support for difficult conditions (only if - ifΒ»).

5.2 Google Home and Apple HomeKit

Xiaomi devices can be connected to Google Home or HomeKit via bridges (such as Home Assistant or HomeBridge).

  • πŸ—£οΈ Manage devices with voice via Google Assistant or Siri.
  • πŸ”„ Create scripts with other brands (e.g. Philips Hue) + Xiaomi).
  • πŸ“± Use geolocation through Apple Home for automation.

To connect to HomeKit:

  1. Install HomeBridge on Raspberry Pi or NAS.
  2. Add the homebridge-mi-home plugin.
  3. Enter the token from Mi Home (similar to Home Assistant).
  4. Scan it. QR-code in the Apple Home app.

⚠️ Note: Not all Xiaomi devices are officially supported in HomeKit. for example, robot vacuum cleaners and some sensors may not work smoothly.

πŸ’‘

Third-party platforms (IFTTT, Google Home is easy to use for simple scripting, but has speed and flexibility limitations.

Advanced methods: API, scripts and firmware

If you need unique scenarios that are not in standard applications, you can use:

6.1. Mi Home Open API

Xiaomi offers open source API It's a device control tool:

  • πŸ“Š Get data from sensors in real time.
  • πŸ”§ Manage devices through HTTP-Query or Python script.
  • πŸ€– Integrate Xiaomi with other services (e.g. Telegram bots).

Example of Python script to enable Yeelight lamp:

from miio import ChuangmiPlug





plug = ChuangmiPlug(ip="192.168.1.100", token="YOUR_TOKEN")




plug.on # Turn on the lamp

To get a token for API:

  1. Install the Mi Home Token Extractor app.
  2. Sign in to your Mi Home account.
  3. Copy the device token from the application log.

Castom firmware for devices

Some Xiaomi devices (such as robot vacuum cleaners or smart sockets) can be flashed with alternative software for advanced features.

  • πŸ€– Valetudo – firmware for robot vacuum cleaners (removes cloud dependency).
  • ⚑ OpenMiHome – an open protocol for interacting with devices.

Warning:

⚠️ Attention: Custom firmware is warranty-free and can cause permanent damage to the device!

6.3 Telegram bots for management

You can create your own Telegram-bot that will manage Xiaomi devices through the API. Example of teams:

  • /light_on β€” light up.
  • /status β€” temperature and humidity.
  • /vacum_start β€” vacuum-drive.

This will require:

  1. Create a bot through @BotFather.
  2. Write a script in Python using the python-telegram-bot and miio libraries.
  3. Run a script on a server or Raspberry Pi.
Example of code for Telegram bot
```python from telegram.ext import Updater, CommandHandler from miio import Yeelight def light_on(update, context): bulb = Yeelight("192.168.1.100","YOUR_TOKEN") bulb.on update.message.reply_text("The lamp is on!) updater = Updater("YOUR_TELEGRAM_TOKEN") updater.dispatcher.add_handler(CommandHandler("light_on", light_on)) updater.start_polling ```

7.How to test scenarios before implementation

Before you start a battle scenario, you have to test it, and here's a checklist to check it out.

Check the logic of the triggers (for example, the motion sensor is triggered?)|Ensure that conditions are met (e.g. geolocation works)|Testing actions on one device|Check the script at different times of the day|Set up error notifications-->

Testing tools:

  • πŸ“ Home Assistant Logs: Go to Settings β†’ System system β†’ Logs to see mistakes.
  • πŸ” Mi Home Debug Mode: Enable the app settings (About the program) β†’ Press 5 times on the version).
  • πŸ› οΈ Postman: For testing API-device-question.

Examples of common mistakes and their solutions:

Mistake.Possible causeDecision
Script not runningIncorrect trigger (for example, sensor is not on the network)Check the device connection in Mi Home
Delay in implementation > 1 minute.Xiaomi's cloud problemsUse local management (Home Assistant)
The device does not respond to the commandOutdated firmwareUpdate the device in Mi Home

For complex scenarios, it is recommended to use the simulation mode in Home Assistant:

  1. Create a script in Settings β†’ Automation.
  2. Enable the option Testing Mode.
  3. Run the script manually and check the logs.

FAQ: Frequent questions about Xiaomi smart scenarios

Can you create a scenario that works without the internet?
Yes, but with the caveats: Mi Home only has the simplest automations (e.g., switching on the lamp on a schedule) and Home Assistant allows you to configure full local scenarios if the devices are connected to the same network. Zigbee-enabled devices (such as Aqara) run locally via the hub. For full autonomy, use Home Assistant with Mosquitto MQTT.
Why is the script in Mi Home working with a delay?
Delays are caused by: Mi Home Cloud Architecture (teams go to Xiaomi server first, then return to the device); poor Internet connection; server congestion (especially during prime time); Solutions: Use Home Assistant for local management; Set up Zigbee devices via Aqara or Sonoff hub; Check the device's response rate in debug mode.
How to transfer scripts when changing your phone or Mi Account?
Portability: Mi Home: Make a backup to Profile β†’ Settings β†’ Backup. Restore on a new device. Home Assistant: Copy the config folder to a new server. IFTTT: Sign in with the same account – applets will be saved automatically. ⚠️ When changing your Mi Home account, devices will have to be re-tied manually!
Can you control Xiaomi scripts from a computer?
Yes, there are several ways: Home Assistant Web Interface: Available on-premises IP-address (e.g, http://192.168.1.100:8123). Mi Home for Windows: No official software, but you can use Mi Home Token Extractor to manage via API. Termux + Python: You can run Termux on Android and manage devices through scripts.
Which Xiaomi devices are best suited for scripting?
Top.-5 Devices for automation: Xiaomi Mi Smart Home Gateway is a hub for connecting sensors Zigbee. Aqara Temperature & Humidity Sensor – accurate data for climate scenarios. LED Bulb - supports color and brightness change. Mi Robot Vacuum-Mop 2 Pro β€” integrates with maps of premises. Mi Smart Plug β€” managing household appliances on a schedule. For complex scenarios, it is recommended to combine devices with Zigbee support (less delays) and Wi-Fi (more funk).