Scheduling of systemStart vs. Initialize

Bruce (@bravenel), is there a guaranteed scheduling order of a systemStart trigger relative to when a driver, having an Initialize capability, receives a call to its initialize() routine on reboot?

In other words, are all drivers guaranteed to have received their initialize() calls before a Rule 5.1 with a systemStart trigger starts executing?

Let's see how good I am at guessing this one. I'm going to guess no, and that if there is any order it may be based on app ID/device ID...

Understand that I am not asking about relative order that devices receive their initialize() calls. Instead, it’s whether all drivers receive their initialize() calls before a Rule Machine 5.1 app receives its systemStart trigger.

Yep. If I were implementing though, I might at system start be doing something like:

Select a.ID, d.ID from App a, Device d where intializeNotifyFlag = true

and then sending each a signal. Thus given that a RM app is just another app at this point of the process..

Pure speculation on my part (and just to stir the pot a little :sunglasses: ), but...

No, there is no guarantee of this.

2 Likes

Ok, thanks for the head’s up.

.... guess I'll need to troll somewhere else now :rofl:

2 Likes

Copy cat... :wink:

2 Likes

So, I'm thinking that maybe the first thing any Rule triggered by "systemStart" needs to do is a delay, just to make sure anything that Rule's going to play with is awake.

Mike, can you recommend a delay value for that? Are we talking 1 second, 5 seconds, or? Thanks!

1 Like

its going to depend on the number of devices that have the initialize capability, so you're going to have to try different values...

2 Likes

Download the Hubitat app