openHAB 4.0 Milestone discussion

Now I’m on M5 and the “first-time-execute-rule-bug” is still present. Same behaviour as describend in my last post.

For me it doesn’t worked in 3551

I really don’t know any further, what I could do to bring the AVM Things online…

Same problem with avm for me after updating to #3551

I brought the AVM Things online in Snapshot 3551:

And all channels are there:

I also get Item change states in event.log

That’s what I have done.
I delete all of the AVM Things and recreated them. (They have be shown newly in Inbox)
Deleting just one and creating it new, doesn’t fix the issue.
I had really to delete them all.

Have a look on my comment…
MAybe this also works for you?

The last issues for me are with Amazon Echo Control and Kodi Binding:

2023-07-20 18:14:20.988 [WARN ] [core.thing.internal.ThingManagerImpl] - Channel types or config descriptions for thing 'amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX' are missing in the respective registry for more than 120s. In case it does not happen immediately after an upgrade, it should be fixed in the binding.
2023-07-20 18:14:20.999 [WARN ] [core.thing.internal.ThingManagerImpl] - Failed to normalize configuration for thing 'amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX': {thing/channel=Type description amazonechocontrol:lastSpokenText for amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX:lastSpokenText not found, although we checked the presence before.}
2023-07-20 18:14:21.025 [WARN ] [core.thing.internal.ThingManagerImpl] - Channel types or config descriptions for thing 'amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX' are missing in the respective registry for more than 120s. In case it does not happen immediately after an upgrade, it should be fixed in the binding.
2023-07-20 18:14:21.038 [WARN ] [core.thing.internal.ThingManagerImpl] - Failed to normalize configuration for thing 'amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX': {thing/channel=Type description amazonechocontrol:lastSpokenText for amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX:lastSpokenText not found, although we checked the presence before.}
2023-07-20 18:14:21.065 [WARN ] [core.thing.internal.ThingManagerImpl] - Channel types or config descriptions for thing 'amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX' are missing in the respective registry for more than 120s. In case it does not happen immediately after an upgrade, it should be fixed in the binding.
2023-07-20 18:14:21.077 [WARN ] [core.thing.internal.ThingManagerImpl] - Failed to normalize configuration for thing 'amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX': {thing/channel=Type description amazonechocontrol:lastSpokenText for amazonechocontrol:echo:XXXXXXXXXXXXXX:XXXXXXXXXXXXXX:lastSpokenText not found, although we checked the presence before.}
2023-07-20 18:14:21.100 [WARN ] [core.thing.internal.ThingManagerImpl] - Channel types or config descriptions for thing 'kodi:kodi:9849245e' are missing in the respective registry for more than 120s. In case it does not happen immediately after an upgrade, it should be fixed in the binding.
2023-07-20 18:14:21.103 [WARN ] [core.thing.internal.ThingManagerImpl] - Failed to normalize configuration for thing 'kodi:kodi:9849245e': {thing/channel=Type description kodi:volume for kodi:kodi:9849245e:volume not found, although we checked the presence before.}

lastSpokenText channel does not exist. Try to recreate your thing.

I recreated Amazon Echo control Things and also Kodi Things. This fixed the issue…

After the recreation of all Things including Bridge everything is okay

2 Likes

I’m not sure if this is a regression in 4.0, but I never saw this behavior before and it’s driving me nuts trying to pinpoint the cause.

Given this channel type:

items/repro.items:

Number:Time Repro_Direct                    <time> {channel="miele:washingmachine:home:washingmachine:elapsed"}
Number:Time Repro_Label   "Label"           <time> {channel="miele:washingmachine:home:washingmachine:elapsed"}
Number:Time Repro_Pattern "Pattern [%1$tR]" <time> {channel="miele:washingmachine:home:washingmachine:elapsed"}

sitemaps/repro.sitemap:

sitemap repro label="Repro" {
    Text item=Repro_Direct
    Text item=Repro_Label
    Text item=Repro_Pattern
    Text item=Repro_Direct label="Override [%1$tR]"
}

I get this result in the Android app (version 3.7.0):

The first two versions which are based on the state pattern from the channel description has an additional space: “00_:00”. The last two versions which overrides the pattern by the exact same pattern either in the item or directly in the sitemap don’t suffer from this issue.

What am I missing here?

I’ve updated the values from the console. e.g.:

openhab:update Repro_Direct "0 min"

and it doesn’t seem data related.

Same result with Basic UI ?

Yes:

Check pattern item metadata, it should apply.
Might be related to UoM OH4 changes (introduction of unit metadata, check that one on the item out, too)
But working with Number:Time has always been highly complex and full of surprises.

I had a thought that it might be related to localization because I didn’t check that previously, and found inconsistent default translation - fixed here:

I then also tried with the pattern “%1$tH:%1$tM” in my item definition, and this introduces the problem. I think this pattern used to display “00:00” rather than “00 :00”.

Hi,

I get the following error, when this rule file is parsed. It was working in Openhab 3.4.4. Error occurs in 4.0.0 M5:
Error:

 Script execution of rule with UID 'System-1' failed: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.BooleanExtensions.operator_equals(boolean,boolean) on instance: null in System

Rule Code:

// Boolsche Variable zum unterscheiden ob das System neu gestartet oder Items reloaded wurden
var Boolean SystemGestartet = false

rule "Bei Systemstart"
when
    System started
then
    //logInfo("System.rules", "System Start Rule wird durchlaufen. Wert Variable " + SystemGestartet)
    if ( (SystemGestartet == false) ){
        // Hilfsvariable auf true setzen. Somit wird dieser IF Zweig nur beim Systemstart durchlaufen
        SystemGestartet = true
        createTimer(now.plusSeconds(30), [|
            logInfo("System.rules", "Das Openhab System wurde gestartet")
        ])
        // Systeminitalisierung zeitverzögert starten
        createTimer(now.plusSeconds(240), [|
            sendCommand(i_System_Init, ON)
            logInfo("System.rules", "Systeminitialiserung nach Neustart Openhab durchgeführt")
        ])
    } else if ( (SystemGestartet == true) ) {
        logInfo("System.rules", "Items wurden neu geladen")
    }
end

Looks like the “Rule Trigger” System started isn’t working.

If I change the rule to

// Boolsche Variable zum unterscheiden ob das System neu gestartet oder Items reloaded wurden
var Boolean SystemGestartet = false

rule "Bei Systemstart"
when
    //System started
    Item i_Testswitch changed from OFF to ON
then
    logInfo("System.rules", "System Start Rule wird durchlaufen. Wert Variable " + SystemGestartet)
    
    if ( (SystemGestartet == false) ){
        // Hilfsvariable auf true setzen. Somit wird dieser IF Zweig nur beim Systemstart durchlaufen
        SystemGestartet = true
        createTimer(now.plusSeconds(30), [|
            logInfo("System.rules", "Das Openhab System wurde gestartet")
        ])
        // Systeminitalisierung zeitverzögert starten
        createTimer(now.plusSeconds(240), [|
            sendCommand(i_System_Init, ON)
            logInfo("System.rules", "Systeminitialiserung nach Neustart Openhab durchgeführt")
        ])
    } 
    else if ( (SystemGestartet == true) ) {
        logInfo("System.rules", "Items wurden neu geladen")
    }
    
end

it works!

I also tried, but this also fails:

when
    System reached start level 100
then

I guess the “System started” Trigger has changed from OH 3.4.4 to OH 4.0.0M5?

Check on which startlevel you are:

{
  "systemInfo": {
    "configFolder": "/etc/openhab",
    "userdataFolder": "/var/lib/openhab",
    "logFolder": "/var/log/openhab",
    "javaVersion": "17.0.7",
    "javaVendor": "Raspbian",
    "osName": "Linux",
    "osVersion": "6.1.21-v8+",
    "osArchitecture": "arm",
    "availableProcessors": 4,
    "freeMemory": 102176664,
    "totalMemory": 946147328,
    "startLevel": 100
  }
}

I am using level 50 which works without any issues:

rule "System start"
when
	System reached start level 50
then
...
	logInfo("EXTRA", "System started rule ausgeführt")
...
end

2023-07-21 08:27:35.291 [INFO ] [org.openhab.core.model.script.EXTRA ] - System started rule ausgeführt

Further testing, all starting level triggers seem to be okay:

rule "System start 100"
when
	System reached start level 100
then
    logInfo("EXTRA", "System started rule Level 100 ausgeführt")
end

rule "System start"
when
    System started
then
    logInfo("EXTRA", "System started rule ausgeführt")
end
2023-07-21 17:31:23.625 [INFO ] [org.openhab.core.model.script.EXTRA ] - System started rule ausgeführt
2023-07-21 17:31:28.963 [INFO ] [org.openhab.core.model.script.EXTRA ] - System started rule Level 100 ausgeführt