Search code examples
wifitasker

Use Tasker to disable WiFi if not connected


I want to use Tasker to turn WiFi OFF IF it is not connected to my home network. How can I do that with a variable? Thanks.


Solution

  • Is there any particular reason you need to use variable for that? This can be easily achieved without variables.

    step 1

    set a profile with a State -> Net -> Wifi connected

    in a task add action set variable name it wifiConnected and set it to "yes" or "true" or whatever you want, but keep in mind that variable name must contain at least one capital letter, to be public (be visible in all tasks)

    step 2

    set a second profile with a State -> Net -> Wifi connected but this time select option invert (so the profile will become active, when wifi disconnected)

    in a task use set variable and set it's value to "no" or "false" or whatever you want

    step 3

    create profile with a state -> variables -> variable value

    in the left field type in variable name wifiConnected

    in the right one type "no" or "false" or whatever you set it to on disconnecting

    as a task for this profile use net -> WiFi -> Off

    that's about it.

    I'd really suggest you on reading some more about Tasker and how it works, as such things are the very basics

    //edit

    to do the same without setting variable, just do a profile from step 2, but instead of setting variable, use task from step 3, to disable wifi