Keep Task alive unless conditions stop

50 views
Skip to first unread message

SimonS

unread,
Sep 26, 2016, 4:51:01 AM9/26/16
to Tasker
Hi

I have a SkyBell doorbell, which has 2 functions and each give me a different notification/"triggers" on my dashboard tablet in my house:
- there is motion outside
- doorbell button is pushed

Right now I use AutoNotification, which check the notification and opens the notifion which brings me into "Live view", to see who is standing outside or has pushed the bell.
After 20 seconds I use AutoInput to press a button on the screen called "Hand up".


What I want to achieve is this:
- If either "motion" is activated or "button is pushed", I want the notification activated to bring me into "live view"
- IF any of the 2 "triggers" are activated (more motion or button pushed (again)) reset counter to 0 (counting to 20 seconds)
- After 20 seconds with NO triggers activated, "Hang up".

Since in Tasker you cannot have a profile called "IF X OR Y", right, I have created 2 different profiles (one for each trigger), both activating the same task.
Right now I have set Collision Handling to "Abort Existing Task".
That DOES give another 20 seconds, BUT it also pushed the new notification, jumping into the "Live view", which is was already in, giving a little "hang up and begin again". 

I would prefer if one of the profiles were ALREADY active, it would just reset the 20 second timer to 0. And NOT press the notification button one more time.

I hope this makes sense, and I think it can be done, I'm just not sure how.

Thank in advance
 

Rich D

unread,
Sep 26, 2016, 5:41:17 AM9/26/16
to Tasker Google Groups Post

> I would prefer if one of the profiles were ALREADY active, it would just reset the 20 second timer to 0. And NOT press the notification button one more time.
>
> I hope this makes sense, and I think it can be done, I'm just not sure how.

do you have the 'always start new copy' 'not' selected in the launch app action? that should avoid the glitch.

otherwise..

It sounds like you would want to check and see if the ' live view' is still running and if so then do not restart it.  You can do this by making a profile with a context of 'Application / "app  name" and select the services option.  then within your task check to see if  that profile is active with a

IF %PACTIVE matches *,name of profile,*

the *,,* are important. see pattern matching in the guide.

Rich D

unread,
Sep 26, 2016, 6:24:10 AM9/26/16
to Tasker Google Groups Post

Tasker needs to be selected in your Android accessibility settings for the app context to work.

If you need more help please include all relevant exported task and profile  descriptions.

To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).

Rich D

unread,
Sep 26, 2016, 6:41:30 AM9/26/16
to Tasker Google Groups Post


On second thought...  it sounds like if live view is running then it is in the foreground. If this is the case then it will most likely have unique window value.

Enable tasker in your android accessibility settings and test the value of the variable %WIN when live view is running. You should be able to test for that value from within your task to see if it is running in the foreground.

SimonS

unread,
Sep 26, 2016, 3:56:28 PM9/26/16
to Tasker
Hi

I dont think I can use "always start new copy" as I'm not launching an app in Tasker. I'm pressing the notification I get, using Auto Notification, and that opens the app yes, but I dont think that gives me the possibility to use "always start new copy".

But I think something of what you wrote would work.
I'm not trying this

Task "Skybell Pushed" (is triggered by both the "motion"-profile and the "button pushed"-profile):
1. IF(%TRUN !~R *Skybell Pushed*){
  A. Flash text "In IF" (for testing)
  B. Then press the notification button
}
2. Wait 20 seconds
3. Hang Up

That would do the trick I believe, BUT I cannot get the "%TRUN !~R *Skybell Pushed*" to work.
As of now it enters the IF-statement every time I press the button.
I have tried both "Doesn't Match" and "Doesn't Match Regex", and from I read from guide using the *-asterix before and after should be sufficient.

Do I need to enabled/activate something in Tasker in order for variables like "%TRUN" to work?

Rich D

unread,
Sep 26, 2016, 4:56:09 PM9/26/16
to Tasker Google Groups Post


> I dont think I can use "always start new copy" as I'm not launching an app in Tasker. I'm pressing the notification I get, using Auto Notification, and that opens the app yes, but I dont think that gives me the possibility to use "always start new copy".

Correct, I should have seen that..

>
> But I think something of what you wrote would work.
> I'm not trying this
>
> Task "Skybell Pushed" (is triggered by both the "motion"-profile and the "button pushed"-profile):
> 1. IF(%TRUN !~R *Skybell Pushed*){
>   A. Flash text "In IF" (for testing)
>   B. Then press the notification button
> }
> 2. Wait 20 seconds
> 3. Hang Up
>
> That would do the trick I believe, BUT I cannot get the "%TRUN !~R *Skybell Pushed*" to work.

The way it is usually done is

%TRUN !~ *,Skybell Pushed,*

This will cover all the bases.

> As of now it enters the IF-statement every time I press the button.

> I have tried both "Doesn't Match" and "Doesn't Match Regex",

There is no need to use the regex for this.

and from I read from guide using the *-asterix before and after should be sufficient.

It should have without the regex.
You would have to post the exported task (as detailed above) for me to be able to tell why the IF action is failing.  It is usually a unseen white space.

>
> Do I need to enabled/activate something in Tasker in order for variables like "%TRUN" to work?
>

No. However %TRUN will not work for this.  %TRUN will always contain ,Skybell Pushed, because it is the same task that contains the action so it would have to be running.

I think your best option would be the %WIN approach.

Another way would be to make a timer variable. Something like this.

1.  If %TIMES > %Timer+300
2.      Turn on live view
3.          Variable set %Timer TO: %TIMES
4. End If

So it would only turn on live view once then it would wait 5 min before turning on again.

See user guide for %TIMES.

SimonS

unread,
Sep 29, 2016, 4:55:05 AM9/29/16
to Tasker
You were right, %WIN did the trick :)

Thank you very much for your help.
Reply all
Reply to author
Forward
0 new messages