Can I automatically turn off WIFI completely whenever not connected to a network on Android 10+
With methods described below, when the phone disconnect from your wifi network, wifi will be immediately switched off. Also they don't require the Location Services to be on.
A. Xposed Edge
Open Xposed Edge, go to More triggers &gt; Wifi Disconncted &gt; Wifi &gt; Turn off.
B. Macrodroid

Open Macrodroid, click Add Macro.
Click the + on the right of Trigger. Click Connectivity &gt; Wifi State Change &gt; Disconnected from network. Click OK. Select your network(s).
Click the + on the right of Actions. Click Connectivity &gt; Wifi Configure &gt; Disable Wifi. Click Ok
Give your macro a name. Press back, save the macro. The macro will look like this:


C. Automate

Open Automate, click the + at the bottom of the screen to add a new flow.
Click +, Connectivity &gt; Wifi enable?. Click the Wifi enable? block, set Options to Immediately. Click Save.
Click +, Connectivity &gt; Wifi network connected?. Click Wifi network connected? block, Don't click on pick the network, but enter the network name (SSID) manually. Set Options to Immediately. Click Save.
Click +, Date &amp; time &gt; Delay. Click on the Delay block, set the duration to 3s. Click Save.
Click +, Connectivity &gt; Wifi set state. Click on the Wifi set state block, select Off. Note that this block is not officially supported for Android 10+ and might not work.
Link the block has shown on the image below. Press back. Give your flow a name. Press Start to start the flow.


D. Ping your home router
You can use a script in combination with the app mentioned to ping your home router. When the pings are successful, the phone wifi stays on. When they are unsuccessful, disable you phone wifi.