I get info line for every createTimer usage in .rules:
2022-11-22 07:53:51.409 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'windowOpen.rules', using it anyway:
The method createTimer(ZonedDateTime, Procedure0) from the type ScriptExecution refers to the missing type Object
I think the problem is, that the SNAPSHOT releases of openHAB try to install the latest addons SNAPSHOT from JFrog (or wherever those artifacts are).
As the error messages says, it is trying to install the JS Scripting bundle that was built on 2022-11-22. Means, it tries to install a JS Scripting add-on version that was built after your installed openhab SNAPSHOT was, and the version it tries to install requires a change that is not in your installed SNAPSHOT.
You can get the JS Scripting version you need by installing the same version of the openhab-addons package as your installed openhab is, but the keep in mind that you have to upgrade both in the future.
FYI: The change that is required by the latest version of the JS Scripting Add-On is the change that leads to the problems with Timer and createTimer.
Thank You pointing me to add-ons, the complete install (apt list --installed) was missing. Looks like openhab installed needed add-ons on startup from repository ?
rule "scr"
when
Time cron "0 43 18 * * ?"
then
createTimer(now.plusSeconds(15), [ |
//Do the timer stuff
logWarn("scrrule", "Timer")
])
logWarn("scrrule", "rule")
end
Maybe it was my screwed installation missing add-ons, that caused this wired info messages too ? Thank You for support. I’ll try to upgrade to one of the next builds.
I have the same exact problem since the latest snapshot. On top of it global timer variables are not recognized breaking the rule execution.
Here is an example:
var Timer testTimer = null
rule "Test Timer"
when
Time cron "0 */1 * * * ?"
then
if (testTimer !== null) {
testTimer.cancel
testTimer = null
} else {
testTimer = createTimer(now.plusSeconds(30)) [|
logInfo("TestTimer", "timer triggered")
]
}
end
2022-11-22 12:55:45.071 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'test.rules', using it anyway:
The field Tmp_testRules.testTimer refers to the missing type Object
The field Tmp_testRules.testTimer refers to the missing type Object
The field Tmp_testRules.testTimer refers to the missing type Object
The field Tmp_testRules.testTimer refers to the missing type Object
The method createTimer(ZonedDateTime, Procedure0) from the type ScriptExecution refers to the missing type Object
2022-11-22 12:56:00.131 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'test-2' failed: Unknown variable or command '!=='; line 24, column 7, length 18 in test
2022-11-22 12:57:00.130 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'test-2' failed: Unknown variable or command '!=='; line 24, column 7, length 18 in test