Platform information:
Hardware: Raspberry Pi 3 Model B Plus Rev 1.3
OS: Raspbian GNU/Linux 9 (stretch)
openHAB version: 2.5.0~S1496-1 (Build #1496)
Unknown reason for error message. I am periodically seeing the following error appear:
[ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'gPower Count': null
I believe that this is being generated from the following rule:
rule "gPower Count"
when
Item gPower received update
then
val numberOfDetectors = gPower.allMembers.size
var numberOfDetectorsON = gPower.allMembers.filter(s | s.state == ON).size
if(numberOfDetectorsON==null) { numberOfDetectorsON = 0 }
val outputString = numberOfDetectorsON.toString + " / " + numberOfDetectors.toString
//logInfo("systemInfo.rules","gPower: " + outputString)
postUpdate(PowerCount, outputString)
end
I have virtually identical rules for also counting (and displaying on HabPanel) the stats for the lights, motion sensors, etc and these do not produce the error (the only difference in the rules is the group that they reference so instead of gPower is would be gLights, gMotion, etc)
What I do not understand is what is causing this error, if I uncomment out my debug line to log the outputString variable to the log then the error message is never seen again??
Whilst this is more of an annoyance, as the rule is doing what I want, I would like to discover the underlying reason for the error and fix it - An error is only there is there is actually an error!!
Definition in items file is:
String MotionCount "Motion Count"
String LightCount "Light Count"
String PowerCount "Power Count"
Group:Switch:OR(ON, OFF) gLight "Lights" <light> (Home)
Group:Switch:OR(ON, OFF) gLightGF "Lights Ground Floor" <light> (Home)
Group:Switch:OR(ON, OFF) gLightFF "Lights First Floor" <light> (Home)
Group:Switch:OR(ON, OFF) gPower "Power Outlets" <poweroutlet> (Home)
Group:Switch:OR(ON, OFF) gPowerGF "Power Outlets Ground Floor" <poweroutlet> (Home)
Group:Switch:OR(ON, OFF) gPowerFF "Power Outlets First Floor" <poweroutlet> (Home)
Group:Switch:OR(ON, OFF) gMotion "Motion" <motion> (Home)