I want my display brightness only to rise if not connected to any Wifi network (doesn't mean Wifi has to be turned off) but I can't figure out how exactly the Wifi variables work. The official documentation is very general and technical.

Edit: The problem is that my Wifi is instable which means Android doesn't have Wifi for about 2-3 seconds and then catches it back. So I added a 5 seconds Wait Action so that my display brightness doesn't change every 15 minutes but it happens anyway, only now 5 seconds later.

I think to finally make it work a "If variable" is necessary.

enter image description here

1 Answer 1


You're going about this the wrong way.

Go to Profiles → (New profile) → State → Net → Wifi Connected. Leave SSID blank and tick "Invert". Link this profile to a task which changes brightness.

Edit - Okay, I think I've found the solution. In the task which changes brightness, do this:

  1. Wait for 5 seconds
  2. if %WIFII (matches regex) \bSCAN\b
    • (Increase brightness)

Explanation: The %WIFII (WiFi info) variable not only gives the name of the WiFi that you are connected to, but also miscellanous information such as Mac and IP address and contains the phrase ">>> CONNECTED <<<". If you are not connected to any particular WiFi, it lists all of the WiFis available along with the phrase ">>> SCAN <<<".

The above task basically

  1. Waits for 5 seconds (adjust accordingly!)
  2. Checks if the %WIFII variable contains the word "SCAN" by means of a regular expression
    • If it contains "SCAN" it means that the device is NOT connected to a specific WiFi (if was connected, it would have the word "CONNECTED" in it).
  3. Increases brightness accordingly

Note: Might cause problems if there are WiFis with the word "SCAN" in them! You can always change the if condition to something else such as if %WIFII (doesn't match regex) \bCONNECTION\b, or make it more specific for the phrase ">>> SCAN <<<" (I'm still new to regular expressions so I've no idea how to do it).

  • I already did that. I updated the question.
    – Clacers
    Jul 11, 2017 at 14:22
  • @Yethat So basically you want the brightness to increase if you are outside, however not when you're inside but disconnected to the unstable WiFi? I think I have a solution, I'll update the answer soon.
    – SSS
    Jul 11, 2017 at 14:58
  • @SSS Precisely!
    – Clacers
    Jul 11, 2017 at 15:19
  • Thank you very much! It works like a charm! And thanks for the good explanation!
    – Clacers
    Jul 11, 2017 at 16:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .