How to set up triggers on Xiaomi phone: a complete guide with examples

Automating routine tasks on a smartphone saves time and makes it more comfortable to use the device. Xiaomi offers built-in tools for creating triggers - conditions under which the phone automatically performs a given action. For example, you can configure the inclusion of silent mode on a schedule, start music when connecting headphones or send SMS low-charge.

In this article, we will analyze all ways to configure triggers on Xiaomi (including models on the Internet). MIUI 14/15 From basic features to hidden features, you’ll learn how to work with the Automation app, use Google Assistant for voice commands, and even create action chains with third-party utilities. No water – only proven instructions with explanations for beginners and advanced users.

What are triggers and why you need them on Xiaomi

A trigger is an event or condition that triggers an automated action on a smartphone. In the context of Xiaomi, triggers are implemented through:

  • πŸ“± Built-in Automation application** (available on all devices with MIUI 12+ hyperos).
  • 🎀 Voice commands via Google Assistant or Alice (for owners) Redmi/POCO Russian-made).
  • βš™οΈ Third-party applications like MacroDroid or Tasker (for advanced scripts).

Examples of useful triggers:

  • πŸ”‡ Automatic sound shutdown in the geolocation office.
  • πŸ”‹ Power saving mode when the battery is below 20%.
  • 🎧 Running Spotify when connecting Bluetooth headphones.
  • πŸ“΅ Send a notification to relatives if the phone is discharged before 5%.

The main advantage of triggers on Xiaomi is that they work without root rights and do not require a permanent connection to the Internet (unlike cloud services like the Internet). IFTTT). But there are nuances:

⚠️ Note: On HyperOS devices (e.g. Xiaomi 14 or Redmi) K70) Automation menu moved to Settings β†’ Special facilities β†’ Automation. MIUI 13 and older way different: Settings β†’ Additionally. β†’ Automation.

πŸ“Š What triggers are you already using on your smartphone?
Scheduled shutdown
Automatic launch of applications
Low charge notifications
Geolocation scenarios
I haven't tried it yet.

Basic triggers: setup through the Automation app

Built-in Automation (or Automation in global firmware) allows you to create simple scripts without installing additional software. Consider a step-by-step instruction using the example of Redmi Note 12 with MIUI 14:

  1. Open the Settings. β†’ Additionally. β†’ Automation (or search by settings by entering AutomationΒ»).
  2. Click Add the rule (icon Β«+Β» top-right).
  3. Select a trigger from the proposed categories: ⏰ Time/Date – for schedule actions. πŸ“ Location - Geolocation scenarios. πŸ”‹ Battery Charge – Reaction to the Level of Charge. πŸ“Ά Network – triggers when connecting to Wi-Fi or mobile data.

Set an action that will be executed when the trigger is triggered (for example, Do Not Disturb Mode or Launch an application).

Keep the rule by giving it a clear name (e.g., β€œSilent Mode at Work”).

Example of setting up a trigger to automatically turn on Wi-Fi at home:

  1. Trigger: Location β†’ House (indicate address on map).
  2. Action: Turn on Wi-Fi.
  3. Add the condition only if the screen is unlocked (so as not to waste battery power).

β˜‘οΈ Checking before saving the trigger

Done: 0 / 4

Extended scenarios: Combining triggers and actions

Xiaomi may not have enough built-in functionality to create complex automations (such as action chains or multi-trigger conditions), and MacroDroid, a free, intuitive Tasker-like app, will help in such cases.

An example of a complex scenario: Smart alarm clock, if you don't turn off your alarm for 5 minutes, your phone will flash and turn on music at full volume.

  1. Install MacroDroid from Google Play.
  2. Create a new macro team (Add Macro).
  3. Add the trigger: Alarm β†’ The alarm went off.
  4. Add condition: Delay β†’ 5 minutes (unless the alarm is switched off).
  5. Set the action: πŸ”¦ Outbreak. β†’ Blink. 🎡 Media β†’ Play music (specify track). πŸ”Š Sound. β†’ Set the volume to 100%.

The advantages of MacroDroid over built-in automation:

FunctionXiaomi's built-in automationMacroDroid
Number of triggers in one rule1Unlimitedly.
Conditions (IF-THEN-ELSE)No.Yes.
Delays between actionsNo.Yes.
Background workYes.Yes (autostart permit required)
Support for pluginsNo.Yes (for example, to work with Home Assistant)

⚠️ Note: On Xiaomi with HyperOS for MacroDroid to work correctly, you need to manually add the application to the AutoRun list and Without battery restrictions (path: Settings: Settings β†’ Annexes β†’ Application management β†’ MacroDroid β†’ Permits).

πŸ’‘

If the trigger doesn't work, check if the system optimizes the background. β†’ Battery β†’ Optimize the battery and disable it for the application responsible for automation.

Geolocation Triggers: Location-Based Automation

Geolocation triggers are useful for automating actions based on your location, such as:

  • πŸ“± Automatic Wi-Fi connection at home/work.
  • πŸ”• Switching to vibration in the office.
  • πŸš— Starting the navigator (Google Maps or Yandex.Maps) when approaching the car.

How to configure a geo-trigger in the built-in application:

  1. Open Automation. β†’ Add a rule β†’ Location.
  2. Choose Entering the Zone or Exiting the Zone.
  3. Specify the address on the map (the radius of the zone can be adjusted from 100 to 2000 meters).
  4. Add an action (e.g., Turn on Bluetooth when you enter the Machine area).

Important nuances:

  • πŸ“ For precise geolocation operation, enable High Accuracy in Location Settings (Settings) β†’ Location β†’ Regime. β†’ High precision).
  • πŸ”‹ Geo triggers are using up the battery, so to reduce the consumption, increase the radius of the zone to 500.+ meters.
  • 🚫 In HyperOS, geolocation rules may not work in power saving mode. Turn off optimization for the Automation application.
Why does the geo-trigger work with a delay?
The smartphone does not update location constantly, but at intervals (usually every 5-15 minutes) to save charge. If you need instantaneous operation, use third-party applications like Tasker with the AutoLocation plugin, which allows you to adjust the frequency of the coordinate update.

Triggers by device status: battery, network, sensors

This category of triggers responds to the internal parameters of the smartphone: charge level, network connection, state of sensors, etc. Let’s consider the most useful scenarios:

1. Battery charge management

You can set it up:

  • πŸ”Œ Automatic Power Saving Mode at Charge below 15%.
  • πŸ“³ Sending. SMS Relative if the charge has dropped to 5% (requires MacroDroid).
  • πŸ”‹ Stop charging by 80% to keep the battery healthy (only works on devices with support for Adaptive Charging, for example, Xiaomi 13 Pro).

Example of configuration through built-in automation:

  1. Trigger: Battery charge β†’ Less than 15%.
  2. Action: Energy saving regime β†’ Turn on.

Reaction to device connection

Useful triggers:

  • 🎧 Running Spotify or Yandex Music when connecting Bluetooth headphones.
  • πŸ”Œ Enabling Quick Charging when connected to the charger (MacroDroid required).
  • πŸ“± Automatic synchronization of photos with Google Photos when connecting to home Wi-Fi.

On HyperOS devices, Bluetooth headphone triggers may not work due to system limitations.Solution: Use MacroDroid with Bluetooth Device Connected trigger and specify MAC-headphone.

3. Sensor triggers

Less obvious but useful scenarios:

  • 🌑️ Turning on the air conditioner via Mi Home if the temperature is above 25Β°C (requires a smart thermostat Xiaomi).
  • πŸ’‘ Automatic flashlight activation when shaking your phone (configured via MacroDroid with Shake trigger).
  • πŸ“± Switching to a dark topic after sunset (use the trigger Time of Day).

πŸ’‘

The triggers are the most reliable because they are independent of external factors (e.g. geolocation or networking) and they work instantly and do not consume the battery for background activity.

Voice triggers: control through Google Assistant and Alice

If you're more comfortable with your phone using your voice, you can configure triggers through virtual assistants. There are two options available on Xiaomi:

1. Google Assistant (for global firmware)

Examples of voice commands:

  • πŸ”¦ Β«Okay, Google, turn on the flashlight for 3 minutesΒ».
  • πŸ“΅ Β«Okay, Google, turn on flight modeΒ».
  • 🎡 Β«OK, Google, launch a playlist for training on SpotifyΒ».

How to set up:

  1. Make sure Google Assistant is activated (Long press home button" β†’ Settings β†’ Google Assistant).
  2. Open the Settings. β†’ Google β†’ Settings for Assistant β†’ routines.
  3. Create a new routine by specifying voice commands and actions.

2.Alice (for Russian firmware)

Examples of teams for Alice:

  • πŸ”‹ Β«Alice, turn on the power savingΒ».
  • πŸ“ Β«Alice, remind me to buy milk when I'm near the supermarketΒ»).
  • 🎧 Β«Alice, play music through Bluetooth headphonesΒ».

Limitations of voice triggers:

  • πŸ—£οΈ It only works when the screen is unlocked (for security reasons).
  • πŸ“Ά Requires Internet connection.
  • πŸ”‡ They can accidentally use similar phrases.

πŸ’‘

To make voice commands work faster, add Google Assistant or Alice to the list of apps without battery limitations (Settings) β†’ Battery β†’ Optimizing the battery).

Hidden Opportunities: Triggers for Advanced Users

If Xiaomi’s built-in tools aren’t enough, you can use them. ADB-So let's look at some examples of a team or a Tasker to create unique scenarios:

1. Automatic onset 5G when launching a specific application

If you want to have a mobile network 5G was only included for streaming (for example, on YouTube or TikTok), follow:

  1. Install Tasker and AutoInput plugin.
  2. Create a profile with the condition Application is launched β†’ YouTube.
  3. Add in the action. ADB Command β†’ shell settings put global preferred_network_mode 13 (where 13 β€” regime 5G SA/NSA).
  4. Add the task at the exit of the application: shell settings put global preferred_network_mode 9 (regime LTE/4G).

Scheduled blocking of applications

To limit access to social media during working hours:

  1. In MacroDroid, Create a Rule with Time Trigger β†’ 09:00–18:00.
  2. Add the action Blocking applications β†’ Select apps (e.g. Instagram, TikTok).
  3. Set a password to unlock (optional).

3. Automatic change of wallpaper by time of day

Use Tasker with the AutoWallpaper plugin:

  1. Create a profile with two contexts: Time β†’ 07:00-19:00 (day wallpaper). β†’ 19:00–07:00 (night wallpaper).

AutoWallpaper β†’ Set up wallpaper

To work with ADB-teams will need:

  1. Enable Debugging on USB (Settings β†’ The phone. β†’ Version. MIUI β†’ 7 times press to activate the developer mode, then Settings β†’ Additionally. β†’ For developers β†’ Debugging by USB).
  2. Connect your phone to your PC and execute the command: adb shell pm grant com.termux.api android.permission.WRITE_SECURE_SETTINGS (for applications like Termux, if you need permission to change system settings).

If geolocation is used, make sure High Precision Mode is enabled and the application is allowed to access the location.

πŸ”Ή Can I set up a trigger for an incoming call from a specific contact?
Yes, but only through third-party apps like MacroDroid: Add a trigger β†’ Incoming call from contact. Select contact from list. Set action (e.g. Play sound or Send SMS). In the built-in automation Xiaomi such a feature is not.
πŸ”Ή How to Turn Off All Triggers At Once?
There are two ways: Through Settings: Go to Automation, click on the three dots in the top right corner, and select Disable All Rules. ADB: Follow the command: adb shell pm disable-user com.miui.automation (to return - replace disable-user with enable).
πŸ”Ή Do triggers work in energy saving mode?
Partially. Xiaomi's built-in automation may not work if: Superpower Saving Mode is enabled. Automation is system optimized (check Settings). β†’ Battery β†’ Battery optimization. For reliable operation, disable battery optimization for applications responsible for triggers.
πŸ”Ή Can I export triggers to another Xiaomi phone?
Yes, but only if both devices are running the same firmware version (MIUI For this, open Automation and press three dots. β†’ Export/Import: Select the export rules (save to.automation file). Transfer the file to a second phone and import it through the same section. For MacroDroid, export is available via the menu β†’ Backup.