Page 1 of 1

no varriable ?

Posted: 25 Nov 2014 11:22
by tonycstech
Is there a simple way to toggle or write string to a varriable with action and then see if its true or false ?

There are ton of init vars but none of them seem to be basic true or false vars.

Please help.
I need my flow to stop flowing all the time repeating same actions.

For example i want to create var for being home. When am home, i want the flow to trigger hilome actions once instead of all day long.
I do it all under periodic location update for all locations in one flow

Re: no varriable ?

Posted: 25 Nov 2014 14:09
by Bushmills
use action "Script":

global_foo = true; // assign flag to variable
global_foo = not global_foo; // toggle flag

see in variables list, or display as screen message, notification, use speech output or any of many widget generators with tasker support, or the Automagic built-in widget creator, or use in another action or condition.

In a condition, you'd use Expression, and simply put name of variable there.
You don't need the leading "global_" in variable name if you don't intend to reference it from outside the flow.
I do it all under periodic location update for all locations in one flow
hmm .. why periodic? triggering an event when entering/leaving a geofence has as additional benefit that the flow is only executed when location change happens, rather than needing a Rube Goldberg scheme to prevent execution of a periodically triggered flow when no event worth triggering for occured.
It may help to know that a trigger exists for detecting a change to a variable.

Home detection I find to work more reliably when checking whether the device has or is connected to an access point with a specific SSID.

Re: no varriable ?

Posted: 26 Nov 2014 03:20
by tonycstech
Why not periodic ? How else app would know that location changed unless i make it check it every x minutes ?
I dont want to use data or wifi, they are better but i dont have data and wifi at my work place gets out of range when i go from one room to another so its useless.

I use cdma cell to check for my location. Do u have a better idea of the way for app to know where am at ?

Re: no varriable ?

Posted: 26 Nov 2014 11:23
by Bushmills
"How else app would know that location changed unless i make it check it every x minutes ?" ... how else would you know that somebody comes to visit you than going to the front door every minute and looking if somebody is there? Or - smart people have a signalling device, called "door bell". Automagic has the equivalent of a door bell too, but you seem to say "I don't believe in door bells"