I migrated from OH 4.1.x to 4.2.0. Platform Windows 11.
I have defined rule on “the system has reached start level 100” - start up complete. On the prevoius version of OH everything worked fine, but currently in OH 4.2.0 this script is not started. Why?
What I’m doing wrong?
Could you hel me?
configuration: {}
triggers:
- id: "1"
configuration:
startlevel: 100
type: core.SystemStartlevelTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
type: application/vnd.openhab.dsl.rule
script: >+
// RUN THIS SCRIPT ON SERVER START
//set UPS status to 1 - normal
UPS_UPSCH00.sendCommand(1)
// re-initialize time of all switches
var vtCurrentTime = now.toLocalDateTime().toString();
SwitchAsia01_SwitchAsia01Timer.sendCommand(vtCurrentTime);
etc etc
Probably the system isn’t reaching startLevel 100. If you have Things that are not ONLINE you won’t reach runlevel 100.
There are all sorts of ways you can determine the startLevel. One of the easier ways is to go to Help & About → View Details and startLevel will be among the information shown.
Other options are to create a rule that triggers at each level or enabling runlevel logging to events.log by setting the level of openhab.event.StartlevelEvent to INFO.
Hmmm, that is right! As I see start level is still on 70%, probably OH is waiting on the Xiaomi color buld which is rarely on at summer.
The question is why 4.1.x didn’t wait for that (to be all things online), my configuration is still the same, but it worked on 4.1.x and don’t works on 4.2.0
I can’t say because I think it’s always been the case that all Thing need to be ONLINE to advance to startLevel 100. But there have been bugs fixed and tweaks made to startup. Perhaps it only accudentally worked previously and now it’s working correctly.