Rule engine - system levels not working I think

  • Platform information:
    Docker
    • openHAB version: 5.3
  • Issue of the topic:

Hey everyone, I’ve been playing around with the system levels to start certain rules, and one very basic is to restart my zigbee controller after openHAB fully finishes starting up. I have copied the yaml to the code brackets below.

I also want to trigger a notification, however neither is the controller rebooted nor is the notification triggered / sent. I’m not exactly certain where it’s going wrong, and I’ve rebooted openHAB several times while looking at the logs and nothing pops up. So I figured I would ask the community before investing more time (and annoying my wife by preventing the rest of the automations from running).

Is anyone else using the system levels to start rules and are the working?


version: 1
rules:
  "8f05113853":
    label: Start up is done
    triggers:
      - id: "1"
        config:
          startlevel: 100
        type: StartLevel
    actions:
      - id: "2"
        config:
          command: "ON"
          itemName: Zigbee2MQTT_Bridge_Restart
        type: SendCommand
      - id: "3"
        config:
          message: OpenHAB is back online
        type: notification.SendBroadcastNotification

I’m using system levels for various tasks and they generally work fine.

The problem: Currently 100 is reached after everything is up and has been loaded without problems. So if there’s just one binding which fails 100 could never be reached although you’re system might work without problems.
That’s why I usually start my start level rules with system level 70 or 80 if possible.

There was a discussion about reasons why 100 might not be reached and whether the design should be changed somewhere here:
https://community.openhab.org/t/excessive-recompiling-on-almost-every-touch-of-item-and-sometimes-rules/169997/138?u=larsen

Ooh thank you that makes it super clear - I’ll rethink my approach then and keep an eye on that thread too.

And for a little more info about how you can determine what start level is reached you can set the logger openhab.event.StartlevelEvent to INFO and transitions to new start levels will be added to events.log. You can also see which start level OH reached from MainUI under Help & About → Technical Information → View Details → systemInfo:

runtimeInfo:
  version: 5.3.0.M2
  buildString: Milestone Build
locale: en-US
systemInfo:
  configFolder: /openhab/conf
  userdataFolder: /openhab/userdata
  logFolder: /openhab/userdata/logs
  javaVersion: 21.0.12.1
  javaVendor: Debian
  osName: Linux
  osVersion: 6.8.0-138-generic
  osArchitecture: amd64
  availableProcessors: 4
  freeMemory: 139874760
  totalMemory: 1394606080
  uptime: 48655
  startLevel: 70 <---------------------------------------------------------
addons:
  - automation-jsscripting
  - binding-amazonechocontrol
  - binding-astro
...

Thank you @rlkoshak ,
Between that information and reading the previously mentioned thread I now understand what prevents the start levels from reaching 100 and sorted the issue on my end :slight_smile: had a couple of things stuck when I removed a binding some time ago, hah!