Why you need to automatically turn off your smartphone and who will need it
Have you ever gone to bed with your phone in your hand and woke up in the morning with a battery dead and a dozen notifications? Or forgotten to turn off your gadget before an important meeting, causing it to run out at the most inopportune moment? Automatic shutdown of Xiaomi on a schedule solves these problems - and this is not the only scenario where the feature turns out to be useful.
Owners of Redmi, POCO and Black Shark smartphones often find that standard MIUI settings do not offer an obvious way to schedule a device shutdown, while this option saves battery power, prevents overheating at night, and even helps to maintain βdigital hygieneβ β for example, if you want to limit your time using your gadget before bedtime. In this article, we will discuss 5 working methods, including hidden shell functions and third-party tools with minimal risks.
Importantly, not all methods are equally secure. Some work at the system level and do not require superuser rights, others use automation with limited resolutions, we will note the pros and cons of each, and also tell you how to avoid common mistakes β for example, why the phone can not turn off when YouTube Music or Google Maps is working in the background.
Method 1: Built-in sleep mode (MIUI 14β15)
Starting with MIUI 14, Xiaomiβs firmware has a hidden tool for managing device time, Sleep Mode, which doesnβt turn the phone off completely, but puts it into a deep sleep state with all background processes switched off, which effectively simulates shutting down for most tasks. This method requires no root rights and works on 90% of current models, including the Redmi Note 12, POCO X5 and Xiaomi 13T.
How to turn on:
- π± Open the Settings. β Screen. β Sleep regimen.
- β° Set the beginning and end times for βsleepβ (e.g. 23:00 to 7:00).
- βοΈ Turn on the option to disable mobile data and Wi-Fi.
- π Activate the Do Not Disturb to block notifications.
Turn on Sleep Mode in Screen Settings
Set a start and end time
Turn off mobile internet and Wi-Fi during sleep
Activate the "Do Not Disturb" mode
Check for alarm clock exceptions (if necessary)
-->
Limitations of the method:
- β The phone does not turn off completely - it remains possible to receive calls (if not turn off). SIM-hand-write).
- β Some apps (like WhatsApp or Telegram) may ignore restrictions if they have permission to work in the background.
- β In the models with MIUI 13 and older, the path to settings may be different: try Settings β Always on screen and locking β Sleep regimen.
β οΈ Warning: If after activating "Sleep Mode" the phone discharges faster, check the list of applications with permission to Autorun in Settings β Annexes β Permits β Autostart. Turn off unnecessary programs.
Method 2: Automate with Google Assistant (without root)
If your Xiaomi runs Android 11 and later, you can use Google Assistant to create a shutdown routine.This method does not require installing additional apps and works even on blocked downloaders. The main advantage is flexibility: you can schedule a shutdown for specific days of the week or tie to an event (for example, connecting to a charging).
Instructions:
- Activate Google Assistant by saying βOK, Googleβ or holding the Home button.
- Say, "Create a routine to turn off the phone at 23:00."
- In the menu that opens, select Add Action β Device Management β Turn off your phone.
- Keep your routine and confirm your permits.
Important nuances:
- β It works on all models with Google Mobile Services (including Google Mobile Services). POCO F5 redmi K60).
- β It does not work if the phone is discharged to 5% or less.
- β Requires an active internet connection to synchronize routines.
Built-in MIUI function
Google Assistant
Third-party annexes
MacroDroid/Tasker
Another option
-->
| Method | Root is required. | It's offline. | Support for MIUI 12β15 |
|---|---|---|---|
| Sleep regimen | β No. | β Yes. | β 14β15 |
| Google Assistant | β No. | β No. | β 11β15 |
| MacroDroid | β No. | β Yes. | β 12β15 |
| ADB-team | β No. | β Yes. | β All versions. |
Method 3: MacroDroid (maximum flexibility)
For those who need advanced settings, such as turning off their phone when they are low-charged or after charging is complete, MacroDroid is a good option, allowing you to create root-free automatic scripts using built-in Android features, and Tasker has the advantage of a simpler interface and a free version with basic features.
Step-by-step:
- Install MacroDroid from Google Play.
- Create a new macro: Trigger β Time / Date β Time.
- Specify the time of shutdown (for example, 23:30).
- In the Actions section, select Power Management β Turn off the device.
- Save the macro and give the app permission for Special Access (in Android settings).
Additional opportunities:
- π Turn off when battery is 100% (useful for battery health).
- π΄ Shutting down when connecting to a specific Wi-Fi network (e.g., home).
- π Ignoring the rule on weekends.
β οΈ Note: Some Xiaomi models (e.g. Redmi) 10C) MacroDroid may not see the shutdown option due to manufacturer restrictions. In this case, use an alternative action: Launch the shell command with the su code. -c reboot -p (root).
How to get around the MIUI restrictions for MacroDroid?
Method 4: ADB-shutdown
This is a solution for advanced users who are not afraid to work with Android Debug Bridge (ADB), which does not require root rights, but involves connecting the phone to the computer for initial setup, and then turning off automatically on a schedule, even if the phone is not connected to the PC.
Instructions:
- Download Platform Tools on PC.
- Turn on USB Debugging on your phone: Settings β About Phone β MIUI version (click 7 times to become a developer), then Settings β Additional β Developers β Debugging over USB.
- Connect your phone to your PC and perform at the terminal: adb shell dumpsys deviceidle force-idle adb shell am broadcast -a android.intent.action.ACTION_SHUTDOWN
- To schedule a shutdown for a specific time, use Tasker or Automate with the action Execute the shell command and paste the code from item 3.
Advantages of the method:
- β It works on all versions. MIUI, including the old ones (e.g. Redmi 5 Plus on the MIUI 10).
- β No additional applications (except for the ADB PC-only).
- β You can combine with other commands (for example, pre-close all applications).
π‘
If, after the execution, ADB-commands the phone restarts instead of turning off, add su before it -c (requires root) or use an alternative command: adb shell input keyevent 26 (power-button simulation).
Method 5: Physical button + smart alarm (for models without software)
If your Xiaomi is running on custom firmware or you have a Black Shark with stripped down functionality, you can do without software solutions. This will require a smart socket (for example, Xiaomi Mi Smart Plug) and a standard alarm app.
How to set up:
- π Connect the phone charger to a smart outlet.
- β±οΈ In the socket app (Mi Home) create a rule: Turn off power at 23:00.
- π± Set your phone alarm at 22:55 with a reminder to βSwitch off your phoneΒ».
- π When the power outlet shuts down, the phone will run out and turn off after 10-15 minutes (unless connected to another source).
Pros and cons:
| β It works on any model, even without it. MIUI. | β Requires the purchase of a smart socket (~1 500 β½). |
|---|---|
| β It doesn't load the phone system. | β The phone won't shut down instantly. |
| β It can be combined with other smart devices (e.g., turn on a night light). | β It wonβt work if the phone isnβt charging. |
Common Mistakes and How to Avoid Them
Even after setting it right, turning it off automatically may not work, and here are 5 of the most common causes and ways to fix them:
1.Background apps block shutdown
Some programs (e.g. Google Maps in navigation mode or Zoom during a conference) ignore the system commands.
- π Before going to bed, manually close all active apps through the recent.
- π§ In Battery Settings, Turn Off Optimization for Critical Applications.
2. Incorrect time settings
If the phone is switched to another time zone or if Automatic Date and Time is on, the schedule may be confused.
- β° Settings β System system β Date and time β Time zone.
- π Turn off automatic synchronization if you live in a region with a winter/summer time switch.
3. MIUI restrictions for third-party applications
The MIUI shell aggressively closes the background processes, so that MacroDroid or Tasker work stably:
- π Add the app to Battery Exclusions (Settings) β Battery β Optimizing the battery).
- π± Enable Auto Start and Work Permit in the background for it.
β οΈ Attention: POCO F4 GT And other Xiaomi gaming smartphones can be activated Game Turbo mode, which blocks automation. β Special facilities β Game Turbo.
4. Conflict with the Developer Regime
If you've previously enabled USB debugging or other options for developers, they may interfere with the shutdown.
- π§ Settings β Additionally. β For developers β Do not turn off the screen (should be turned off).
- π Turn off the debugging. USB, if you don't use ADB.
Hardware restrictions
On some models (for example, Xiaomi 12S Ultra), the shutdown function is locked at the kernel level, in which case only:
- π§ Installation of custom recaveri (TWRP) and modified core firmware.
- π± Using a physical power button (see Method 5).
π‘
Before setting up the auto-off, turn everything off. VPN-Applications and antiviruses (such as Avast or Kaspersky) often block system commands, perceiving them as a potential threat.