I’m currently working with OpenHAB 4.1 and trying to extend a DSL rule by calling another rule I created using the UI. Here’s what I have so far:
var Timer tTaste = null
rule “WohnenSchlafenTaster_long”
when
Item Taster_Wohnen_Schlafen_Eingang_Taster_Wohnen_Schlafen_Eingang changed
then
tTaste?.cancel
logInfo(“Taster WohnenSchlafen”, “0: Tastendruck erkannt”)
if(newState == ON) {
tTaste = createTimer(now.plusNanos(2000000000),[|
// 2000 Millisekunden
// Befehl: langer Tastendruck erkannt
logInfo(“Taster WohnenSchlafen”, “langer Tastendruck erkannt”)
StartRule.sendCommand(‘b802f75c90’)
])
} else {
logInfo(“Taster WohnenSchlafen”, “1: Tastendruck erkannt”)
if(!(tTaste.hasTerminated)) {
// Befehl: kurzer Tastendruck erkannt
logInfo(“Taster WohnenSchlafen”, “kurzer Tastendruck erkannt”)
KNX_Device_Aktor_A3_Licht_Wohnen_Wohnen_Licht_Durchgang.sendCommand(ON)
}
}
end
When I perform a long press, I encounter the following error:
[INFO ] [e.model.script.Taster WohnenSchlafen] - 1: Tastendruck erkannt
[ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘WohnenSchlafenTaster_long-1’ failed: cannot invoke method public boolean
Question: How can I successfully call another rule within my DSL script? The other rule I created using the UI doesn’t seem to be accessible. Any insights or suggestions would be greatly appreciated!