I just started playing with rules, and my first one is intended to turn the lights out if no motion is detected for five minutes. I have an error in the logs I can make no sense of
Running openHAB 2.2.0 Build #1133; this is the error:
2017-12-13 01:58:02.248 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Office Motion Detected': An error occurred during the script execution: Couldn't invoke 'assignValueTo' for feature JvmVoid: (eProxyURI: office.rules#|::0.2.0.2.0.4::0::/1)
It’s being triggered by this block in the rule:
timer = createTimer(now.plusMinutes(5)) [|
logInfo("Office motion not detected; lights out")
//sendCommand(Office_Lights, OFF)
]
Here’s the complete rule file:
var occupiedTimer = null
rule "Office Motion Detected"
when
Channel "dlinksmarthome:DCH-S150:6c7220c50bc1:motion" triggered
then
logInfo("OFFICE_MOTION", "Office motion detected")
//postUpdate(OfficeOccupancyLastUpdated, new DateTime())
logInfo("OFFICE_MOTION", "Office motion detected -- occupancy updated")
if (occupiedTimer !== null) {
logDebug("OFFICE_MOTION", "Office motion detected -- timer cleared")
occupiedTimer.cancel
}
logInfo("OFFICE_MOTION", "Office motion detected -- reset timer")
timer = createTimer(now.plusMinutes(5)) [|
logInfo("Office motion not detected; lights out")
//sendCommand(Office_Lights, OFF)
]
end
Any help appreciated…