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.
2 Answers
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
Sorry, but I think what you wrote above does what it's supposed to do only the first time, then it needs something to trigger it automatically like a builtin variable or so...in my opinion that doesn't work as intended...no offence :) Well, you will need something that will trigger the task for the first time, it's about the task that verifies what's the wificonnected's value. If it is "no", that means you don't have any SSIDs to connect to.You will add a wait task, let's say 2 minutes and net-wifi-off, because you will want to disable wifi if, after a specific period of time when your phone wasn't able to connect to any network. But, you will want something continuous, in loop so you will have to add a task/goto action, like this! Let's say you have this action: A1: task/wait-2 minutes A2: if %wifiConnected ~no then set WIFI off goto A2 This way you'll phone will scan for %wifiConnected's value, continuously. As an alternative, you may cancel that loop once your wifi has already set to off because you don't need that value anymore. I mean, your screen on-> task activated->elapsed 2 minutes-> no ssids to connect to-> wifi off Then, you manually or not necessarly turn your wifi back on, but the task won't be triggered anymore because the screen is already on, this is why you will have to use that goto action :) Or, you could go and disable/enable tasker such that your task( that checks for wifiConnected's value) being triggered again :)...hope that helped...my profile works like smooth :)

- 11
- 3