As I often forget to turn off Wi-Fi when leaving home, I found this method to solve the problem.
First, we need to prepare according to different device types.
For Xiaomi, Redmi, Black Shark, and POCO phone users
First, lock and allow IFTTT to self-start and set the power-saving policy to unrestricted from the recent apps. Skip this section if not applicable.
Press and hold the IFTTT preview icon to bring up the menu below.
Next, confirm that there is a small lock next to IFTTT, open the app details, allow self-start, and set the power-saving policy to unrestricted to avoid being killed in the background.
For Android 6.0 to 8.0
(Except for Xiaomi, Redmi, Black Shark, and POCO phone users)
After installation, go to System Settings > Battery (or Power).
Depending on the operating system, there may be different ways to operate. For Google phone, click the three dots in the upper right corner first, and then click Optimize battery usage.
Then find IFTTT in the menu and choose not to optimize to avoid abnormal function caused by the background process being unable to run.
For Android 9.0 to 10.0
(Except for Xiaomi, Redmi, Black Shark, and POCO phone users)
Please go to System Settings > App and notification > Special app access. Depending on the operating system, there may be different ways to operate. For Google phone, click Special app access first.
Then click Optimize battery usage.
After finding IFTTT, choose not to optimize.
Prepare work is completed.
Let’s start setting up on the next page! Don’t miss it ~
Before using, you need to register or log in to IFTTT (ifttt.com).
Next, it will recommend an IFTTT example, click X to skip.
Next, please open the IFTTT app.
Next, please log in to the account used at the beginning of this article.
Click Got it and Get More.
Next, click Create.
First click “This” and select Android Device.
Next, select the option circled below.
Next, enter the Wi-Fi name to trigger.
Then click “That”, also select Android Device, and then select Turn off WiFi.
After confirming that there is no error, please click Finish. The author recommends turning on the “Receive notifications when this runs” switch, so that IFTTT will remind you when Wi-Fi is turned off.
If location information is required, please allow it, otherwise it will not work properly.
Connected means it has been turned on.
The effect is demonstrated below.
Every time Xiaomi, Redmi, Black Shark, and POCO phones run, they will pop up and ask for permission. We can choose permission management from the app details.
Then find “Open WLAN” and set it to always allow.
Here we are done! If a notification pops up when setting up the Applet, you will have the effect shown in the figure below~
Why not use Location to create an Applet?
Because as long as any Applet uses the Location service, IFTTT will always access the location information, consume power, and many brands of phones will turn off the location function when entering power-saving mode, so it cannot work properly.
As long as any Applet uses the Location service, IFTTT will always use the location information.