1

How can I execute a tasker task only after a certain condition has been true for a certain time?

Normally a profile executes its task as soon as all conditions are met. I want to delay this activation, until the conditions have stayed true for some time.

E.g.

  • do something after the screen has been continuously off or on for 10 minutes
  • do something after wifi xy has not been near for 10 minutes
  • do something after cell towers x,y,z have not been near for 10 minutes.
0

A mix of Wait, Variable Search and If-Else should suffice here.

Tasker maintains a variable named Profiles Active, denoted by %PACTIVE.

Profiles Active (dynamic)
%PACTIVE
A comma-separated list of the currently active, named profiles in activation order. Duplicate names will appear on the list only once. The list always starts and ends with a comma to make matching easier, if it's not empty.

(Emphasis mine)

You can use Wait action to wait for N amount of time and then check whether your profile is active or not. If not active, exit out of the task, else, continue.

You may begin your task with these actions:

  1. Task → Wait → configure it
  2. Variables → Variable Set:

    • Name: %ActiveProfiles
    • To: %PACTIVE
  3. Variables → Variable Search Replace:

    • Variable: %ActiveProfiles
    • Search: ,PROFILE_NAME,
    • tick Ignore Case
    • Store Matches In: %CurrentProfile

    Replace PROFILE_NAME with the name of your profile. A profile's name must be setup manually.

  4. Task → If: %CurrentProfile1 Isn't Set
  5. Task → Stop

    Alternatively, put any action that notifies you that the profile deactivated in the mean time.

  6. Task → Else
  7. Setup the actions you want be executed if the profile remains active after N amount of time.
  • This approach has issues. The first issue is that I'm not making any checks on the fact that for the amount of time I'm waiting, the profile may have deactivated and activated multiple times. I'll see what I can do. – Firelord Feb 10 '16 at 23:15
  • For the obvious issue here: setup an Exit Task and stop the Enter Task from it. Problem solved. – Firelord Feb 10 '16 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.