when
Item Outdoor_Lux changed
then
if (Outdoor_Lux.state < 200){
LivingSideLightRM.sendCommand(ON)
FamilySideLight.sendCommand(ON)
}
end
rule “Turn Sidelight Off_LUX”
when
Item Outdoor_Lux changed
then
if (Outdoor_Lux.state > 350){
LivingSideLightRM.sendCommand(OFF)
FamilySideLight.sendCommand(OFF)
}
end
But it is flooding the events log with commands to turn the lights off when they are already off and also when already on its trying to send on commands.
is there any way to tame it down with the switch requests by saying if its already on do not send another request?
Creating a group for the Lights and Adding the Light switch state removes the switch requests.
rule "Turn Sidelight On_LUX"
when
Item Outdoor_Lux changed
then
if (GroundLights.state == OFF && Outdoor_Lux.state < 346 ){
GroundLights.sendCommand(ON)
}
end
rule "Turn Sidelight Off_LUX"
when
Item Outdoor_Lux changed
then
if (GroundLights.state == ON && Outdoor_Lux.state > 360){
GroundLights.sendCommand(OFF)
}
end
I now have the problem that after the lux value is below 346, if i turn the lights off the lights with come on again at the next LUX value update.
As ive got a cron timer to turn all lights off at 2330 Is there a way to tell the ‘ON’ Rule to only operate between the hours of 0700 and 2330? Example bellow (TIME CRON line 5), but doesnt like it
Will if(now.getHourOfDay() >= 7 && now.getHourOfDay() < 9){ suffice??
rule “Turn Sidelight On_LUX”
when
Item Outdoor_Lux changed
then
if (GroundLights.state == OFF && Outdoor_Lux.state < 80 && Time cron < “0 30 23 ? * *”){
GroundLights.sendCommand(ON)
sendBroadcastNotification(“Side Lights ON”)
}
end
rule “Turn Sidelight Off_LUX”
when
Item Outdoor_Lux changed
then
if (GroundLights.state == ON && Outdoor_Lux.state > 110){
GroundLights.sendCommand(OFF)
sendBroadcastNotification(“Side Lights OFF”)
}
end