Rule trigger when system started - meaning?

Dear all

In the last days I implemented a simple rule which is not exactly behaving as I think it should be.

  • Platform information:

    • Hardware: MacMini
    • OS: Debian 9
    • Java Runtime Environment: oracle java 1.8
    • openHAB version: 2.5 M1
  • Issue of the topic: What is the meaning of When system started?

    Rule “Startup”
    When system started
    Then
    SendMail(…)
    End

From my understanding this should only run, on a fresh startup of OH as a system.
But in fact it is also triggered when I change an items file.
I agree that this is also some kind of a refresh, but it is not a startup as such.
My goal is to set some item status at startup which are not triggered by persistence - restoreOnStartup

I would appreciate if one of you could correct me in my understanding.

Cheers
Stefan

The trigger name is misleading but behaves as expected. I don’t know the deeper mechanics of OH so can’t give you a better explanation but this has been discussed before. Maybe search gives you results or someone wiser than me tells us the reason.

My workaround is to have a boolean value “systemRunning” which changes to true after first run of my startup rule which in turn is triggered by System Started.

2 Likes

System started is behaving as described in the docs.

System started is triggered upon openHAB startup, after the rule file containing the System started trigger is modified, or after item(s) are modified in a .items file.

Then you want to have this Rule run whenever you change your .items files because when your .items files are loaded they get initialized to NULL, then restoreOnStartup runs, meaning that the Items you want to initialize in this Rule won’t have their proper state.

1 Like