• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help How to make sure my "Device boot" Profile activates as very first

ligchris

Lurker
Jun 16, 2016
5
3
Hi, one of my profiles must be the very first to be activated (it initializes a set of variables).
Its context therefore is the Device Boot event. I also have set the profile's priority to 50.

Still, one of my other profiles always is activated before the "Device Boot" profile. "Device Boot" is not one of this profile's contexts, and it priority is the default.

I think that - when I was reading tutorials about Tasker - I somewhere have read about this issue and how to solve it - I thought back then that I would remember this when I would need it.
Guess what, I forgot... And I can't find the topic anymore...

Who can help?

Chris
 
Last edited:
How about ...

Profile: Atest
Event: Device Boot
Enter: Anon
A1: Flash [ Text:A done Long:Off ]
A2: Variable Set [ Name:%Adone To:yes Do Maths:Off Append:Off ]

Profile: Btest
Event: Variable Set [ Variable:%Adone Value:yes User Variables Only:Off ]
Enter: Anon
A1: Variable Clear [ Name:%Adone Pattern Matching:Off ]
A2: Flash [ Text:B done Long:Off ]

... Thom
 
Last edited:
  • Like
Reactions: electricpete
Upvote 0
My task already was similar to the above:
Profile: Initialize variables (48)
Priority: 50
Event: Device Boot
Enter: Anon (43)
A1: Variable Set [ Name:%VarToInitialize To:0 Do Maths:Off Append:Off ]

So I don't really see how the above suggestion could solve my problem. :)

In the meanwhile, however, I have found a Tasker Event that (according to its help page) guarantees to trigger its profile before any other profile is triggered, i.e. Monitor Start.
Changing my profile to use Monitor Start as its Context solved my problem. :)
 
  • Like
Reactions: electricpete
Upvote 0
Changing my profile to use Monitor Start as its Context solved my problem.

Yes you could change the Device Boot in my example to MonitorStart and that will also work.

My point to you for your consideration is that starting is generally not the issue. The issue usually is that you want something to be completed before starting something else.

Starting two tasks with either of these triggers will just get you running two simultaneous tasks.

My sample shows how to signal the completion of the first task to start of other tasks.

... Thom
 
Upvote 0
Thank you for your support, Thom!

I already have quite a few profiles, some of which trigger each other in different ways - some triggers use the pattern as used in your example.

But for this particular situation (initializing a set of variables) I wanted to avoid other profiles depending on a variable being set, because that would mean that quite some profiles would need to check that a variable was set.

Cheers.
 
Upvote 0
There is a Profile/Task that you want to initialize some variables before anything else happens.

You can adjust the priorities of everything
or
Instead of being triggered by Device Boot all the others (Btest) are triggered by a new variable that is set in the first task (Atest) after all the variables in that task have been initialized.

Profile: Atest
Event: Device Boot
Enter: Anon
A1: Flash [ Text:Atest Start Long:Off ]
A2: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A3: Flash [ Text:Atest Done Long:Off ]
A4: Variable Set [ Name:%Adone To:yes Do Maths:Off Append:Off ]

Profile: Btest
Event: Variable Set [ Variable:%Adone Value:yes User Variables Only:Off ]
Enter: Anon
A1: Flash [ Text:Btest Done Long:Off

Your initialization code would replace A2 in Atest.

If you use Device Boot it will be triggered once after you reload the system.
If you use MonitorStart it will be triggered after you reload the system and if Tasker crashes after that and is restarted it will be triggered again.

... Thom
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones