Hi,
This is useful for profiles like : set phone to silent when you meet a context (wifi near, gsm, etc), disable silent if you have left the context for more than X minutes.
After having messed quite a bit, using long waits in exit tasks, which I quite dislike, I came up with the following template, which is very straight forward, lightweight battery-wise and works fine. It doesn't wait for a precise number of minutes, but rather a value that is in a bracket (3-5 minutes in example).
Even though this might seem an obvious way for lots of you, I figured I'd post it as it might help some, as with my own experience, I didn't find any precise information on the net (maybe I did bad google searches...)
Here is the 2 profiles it requires, I'll add a little description further down :
Profile: Near Work Test (191)
State: Variable Value [ Name:%Test Op:Matches Value:1 ]
Enter: Anon (192)
A1: Silent Mode [ Mode:Vibrate ]
A2: Variable Set [ Name:%Leavework To:0 Do Maths:Off Append:Off ]
Exit: Anon (193)
A1: Variable Set [ Name:%Leavework To:1 Do Maths:Off Append:Off ]
Profile: Leave Work Test (194)
State: Variable Value [ Name:%Leavework Op:Maths: Greater Than Value:0 ]
Time: Every 2m
Enter: Anon (195)
A1: Variable Add [ Name:%Leavework Value:1 Wrap Around:0 ]
A2: If [ %Leavework ~ 4 ]
A3: Variable Set [ Name:%Leavework To:0 Do Maths:Off Append:Off ]
A4: Silent Mode [ Mode:Off ]
A5: End If
Description :
State: Variable Value [ Name:%Test Op:Matches Value:1 ] ---> set this condition in 1st profile for what you want to test (I essentially use Cell Near in my profiles as they don't use up battery)
As to set the time you want to wait before performing exit task, you can change the Time : Every 2m increment, and play with the value of A2: If [ %Leavework ~ 4 ]
As said before, this example sets a delay that is somewhere between 3 and 5 minutes, depending when the profile is triggered. Setting Time : Every 3m would make the bracket 4-8 minutes for example.
I hope this solution can help some of you.
Mike