Monitoring if Variable gets changed

1,367 views
Skip to first unread message

Wes Stacey

unread,
Jan 18, 2013, 2:45:06 PM1/18/13
to tas...@googlegroups.com
I have several profiles that change my variable %CurrentLoc, and sometimes the variable may get set to the same value multiple times.

I want to be able to trigger off of when the variable changes value, I do not however want it to trigger whenever the variable gets set to the same value it already is, only when it gets set to something different.

So for example if %CurrentLoc is currently set to "Work" and a profile sets it to "Work" again i don't want it to trigger, but if it currently "Work" and gets set to "Car" i want it to trigger.

The Variable Set context seems to trigger on both cases, does anyone know a way to accomplish this?

TomL

unread,
Jan 18, 2013, 2:58:04 PM1/18/13
to tas...@googlegroups.com
On Friday, January 18, 2013 2:45:06 PM UTC-5, Wes Stacey wrote:
So for example if %CurrentLoc is currently set to "Work" and a profile sets it to "Work" again i don't want it to trigger, but if it currently "Work" and gets set to "Car" i want it to trigger.

The Variable Set context seems to trigger on both cases, does anyone know a way to accomplish this?

In any action that sets %CurrentLoc to "Work", tick the If box and specify "doesn't match" "Work".

Tom

Wes Stacey

unread,
Jan 18, 2013, 3:42:32 PM1/18/13
to tas...@googlegroups.com
Yeah i went through and did that already, basically removing the chance that it will be set to something that it already is.

Just wondering if there is a way to monitor for changes in variables and not just the fact that they were set.

TomL

unread,
Jan 18, 2013, 3:57:04 PM1/18/13
to tas...@googlegroups.com
Logically, if you can ensure that var sets only occur if and only if the new value is different from the old value, then monitoring context event var set is equivalent to monitoring for a change in var value.

I think.

Tom

Wes Stacey

unread,
Jan 18, 2013, 4:10:13 PM1/18/13
to tas...@googlegroups.com
True but but it does involve finding each and every time that the variable is set and adding the if statements.

Richard Davis

unread,
Jan 18, 2013, 4:46:14 PM1/18/13
to tas...@googlegroups.com

>
> The Variable Set context seems to trigger on both cases, does anyone know a way to accomplish this?

I don't know how complicated you want to get, but couldn't you just make a profile like this..

Context:  event / variable set %Currentloc.     Priority 10

Task:  If %Copy Does not match %Currentloc
           Variable set %Ignore=0
            Variable set %copy = %Currentloc
         
        Else

Variable set %Ignore = 1.   If %Copy Matches %Currentloc

Then you can use %Ignore In your contexts..

Rich....

Eric Mooney

unread,
Jun 11, 2016, 9:51:31 PM6/11/16
to Tasker
I found a way to do it. Condition - 'Variable changed' and value = '*' (without the quotes). This will catch the variable being set to anything.

Jens Hoofs

unread,
Nov 10, 2017, 6:07:14 AM11/10/17
to Tasker

Could yo uexplain it a little bit further?
Im trying to do something somehwat similar.

But i can not get it to only fire the task if the variable is not the same.

Op zondag 12 juni 2016 03:51:31 UTC+2 schreef Eric Mooney:
Reply all
Reply to author
Forward
0 new messages