I have had the same motion sensor rule in place for 8 or 9 months now. Saturday I had an issue with my esxi host and had to reboot everything.
have been having an issue with this rule. For some odd reason it’s ignoring my condition
if(numOn > 0)
seems like once it hits there, even though numOn = 0 it still goes right in. The Override doesn’t work either, it just turns them on off. So even when it shouldn’t (middle of the night) it still turns on. Not sure what happened. Anyone see anything glaring?
rule "Bedroom Motion Sensor"
when
Item BedroomMotionSensor changed
then
var Number hour = now.getHourOfDay
var triggeredTime = BedroomMotionSensor.lastUpdate()
var LightLevel = MasterBedRoomLightLevel.state as DecimalType
if(MasterBedroom_MotionSensorOverride.state == ON)
{
override = true
logError("Bedroom","Override is ACTIVE!")
}
else
{
override = false
logError("Bedroom","No Override")
}
//****************** IGNORES THIS *************
var Number numOn = gLivingRoomLights.members.filter(s | s.state == ON).size
// check to see if any lights are on in the living room.
logError("Bedroom","Bedroom Count"+numOn.toString)
// the above line writes "Bedroom Count0" to the log, so it's reporting 0
if(numOn > 0)
{
//check for override
if(!override)
{
//living room lights are still on
if((BedroomMotionSensor.state==ON) && ( LightLevel > 69))
{
gBedroomLights.send(ON)
logError("Bedroom","Bedroom Motion Detected - ON")
}
else
{
gBedroomLights.send(OFF)
logError("Bedroom","No Motion, turn the lights off")
}
}
}
end