The rules do run now, but I notice that they don’t care about some item states in the if call
Below rule does what it has to do, but it doesn’t care about the state of both LPhal items.
If LPhalbeneden is ON and/or LPhalboven is ON the rule still executes
rule “Turn on stair leds for 45 seconds when motion is detected”
when
Item DetectornachthalTripped changed from CLOSED to OPEN or
Item DetectorInkomTripped changed from CLOSED to OPEN
then
var ReentrantLock lock = new ReentrantLock()
var Timer waitFor = null
lock.lock()
try {
if ((DayorNightStatus.state.toString()==“0”) && (SystemStarting.state == OFF) && (LPledtrap.state != ON) && (LPhalboven.state != ON) && (LPhalbeneden.state != ON)) {
logDebug(“scene”, "LPledtrap = " + LPledtrap.state.toString() + " & LPhalboven = " + LPhalboven.state.toString() + " & LPhalbeneden = " + LPhalbeneden.state.toString())
logDebug(“scene”, “Rule Turn on stair leds for 45 seconds when motion is detected started”)
if (waitFor!=null) {
logDebug(“scene”,“Timer waitTime cancelled”)
waitFor.cancel()
}
BP_hal_trap_aan.sendCommand(ON)
logDebug(“scene”, “Turn on leds trap when motion is detected”)
waitFor = createTimer(now.plusSeconds(45)) [|
BP_hal_trap_uit.sendCommand(ON)
logDebug(“scene”, “Automatically turn off leds trap after 45 seconds”)
logDebug(“scene”, "LPledtrap = " + LPledtrap.state.toString() + " & LPhalboven = " + LPhalboven.state.toString() + " & LPhalbeneden = " + LPhalbeneden.state.toString())logDebug(“scene”, “Rule Turn on stair leds for 45 seconds when motion is detected ended”) ]
}
} finally{
lock.unlock()
}
end
Since I am on the snapshot version, feeback of Nikobus buttons is now not working anymore (it did work with beta5, but there the rules at startup have issues )