Checking for openHAB updates - simple rule

Tags: #<Tag:0x00007fe053e668e8> #<Tag:0x00007fe053e667a8> #<Tag:0x00007fe053e66668>

(Kim Skatun) #22

Is it possible to also check if a binding has been updated? Both verified , on the market place and on github?

(Rich Koshak) #23

The version number of all the official bindings will move forward with the relase version number of the core. The only way to know what changes are included in a given release number is to watch the merged PRs on github. I don’t know how versioning is managed on the IoT marketplace.

(Vincent Regaud) #27

Have you tried the code on post #15

(Hallo Ween) #28
2018-05-28 11:07:20.736 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule 'rule 2: Check for openHAB distro updates': For input string: "Release Build"

I geht this error.

Any idea what i have to change in my rule?

rule "rule 2: Check for openHAB distro updates"
    Time is midnight or
    Item OH_CheckForUpdates received command ON or
    System started
    var String cloudbeesUrl = "[number]"
    var String currentBuildString = executeCommandLine("/etc/openhab2/scripts/", 2000)
    var response = sendHttpGetRequest(cloudbeesUrl)
    var lastBuildNumber = transform("JSONPATH", "$.lastSuccessfulBuild.number", response)
    if (Integer.parseInt(currentBuildString) < Integer.parseInt(lastBuildNumber)) {
            OH_Status.postUpdate("neues Update vorhanden: #" + lastBuildNumber)
            // Do something with that information
    else {
            OH_Status.postUpdate("kein Update verfügbar")

(Hallo Ween) #29

I have identified this part of my rule, which is causing the error:
(rest of the rule is running without errors)

if (Integer.parseInt(currentBuildString) < Integer.parseInt(lastBuildNumber)) {
            OH_Status.postUpdate("neues Update vorhanden: #" + lastBuildNumber)

And this:

2018-05-28 11:44:05.674 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'currentBuild' on rule file 'oh_update.rules' cannot be initialized with value 'org.eclipse.xtext.xbase.impl.XConstructorCallImplCustom@51a0072b (invalidFeatureIssueCode: null, validFeature: false, explicitConstructorCall: true, anonymousClassConstructorCall: false)': For input string: "Release Build"
sed -n 's/build-no\s*: //p' /var/lib/openhab2/etc/ | cut -d '#' -f 2

(Kuba Wolanin) #30

currentBuildString contains “Release Build” and thus it cannot be parsed into Integer.
You need to make sure contains any number before you proceed with comparing it with lastBuildNumber:

if (currentBuildString.matches(".*\\d+.*") && Integer.parseInt(currentBuildString) < Integer.parseInt(lastBuildNumber)) {

Didn’t test it!

(Hallo Ween) #31

But what has changed since the last few weeks? I was on a snapshot maybe 2 weegs ago and all worked, today i made an update and now it doen´t work anymore…

This is the

openHAB Distribution Version Information
build-no        : Release Build
online-repo     :

Repository        Version
openhab-distro  : 2.3.0
smarthome       : 0.10.0.oh230
openhab-core    : 2.3.0
openhab1-addons : 1.12.0
openhab2-addons : 2.3.0
karaf           : 4.1.5

So when the release 2.3 is out and the new 2.4 snapshots are running, it will probably work again without any changes?

(Vincent Regaud) #32

In the last couple of weeks there was some release candidates for 2.3 being published and that maybe what “broke” it. My guess is that it should get back to normal after the first 2.4 snapshot is released

(Ben Clark) #33

Which has already happened :wink:

(Hallo Ween) #34

But it´s not online yet… :blush:

(Vincent Regaud) #35

Yes it is, I just have updated to openHAB 2.4.0 Build #1292

(Hallo Ween) #36

Ok, i can see it now. I made a snapshot update about 2 hours ago and in this version i couldn´t see, which build it was. I only could se release build…

Now i made another apt-get update / upgrade and there is a new update again… Now i can see #1292 in paper UI and in the versions-file too.

(Thomas Bail) #37

I am just building up the snapshot rules new and have some questions. From the properties file i could get the installed buzild and the distro. From cloudbees i get the latest build (json). Now my question: Is it possible to get the distro online?


(Thomas Bail) #38

Has someone recognized that the build number from cloudbees has not changed since #1392?

So the rules are more or lesse useless.


(Mark) #39

The location has changed. It now is at

(Thomas Bail) #40

I will check that - Now it is working again.


(Frank Delure) #41

My rule worked fine the last couple of months. Since a few days I receive the following error:

2019-02-10 21:30:31.653 [ERROR] [ntime.internal.engine.RuleEngineImpl] 
- Error during the execution of startup rule 'Check for openHAB distro updates': For input string: "

Anybody an idea?

(Kuba Wolanin) #42

I’ve just updated the post with the proper REST API endpoint:[number]

(Thomas Bail) #43

I guess the brackets should be replaced by %5B and %5D in the URL

(Frank Delure) #44

My fault was: I had to reinstall all bindings because of the snapshot bug in #1518 and forgot to re-install the JSONPath Transformation. I am very sorry - thanks @kubawolanin for your kind help.