Hi All,
I have a number of lights controller under motion that work really well.
I am having a party this weekend I’m thinking instead of motion turning lights on and off I think I’d like to have all motion switched off and just manual control of the lights.
Can anyone confirm if this is the right way to do this?
I’ve defined a group called
'gMotionSensors'
and placed all my Motion Sensoring channels into this from the various ZWave Motion sensors. I’ve defined a group called gAllDimmers and placed all my dimmers into the group so I can send a command of 5% to them all.
Here is my items:
/*Group Definitions for Switches*/
Group:Switch:SUM gAllLights "All Lights" [ "Lighting" ]
Group:Dimmer:SUM gAllDimmers "All Dimmers" [ "Lighting" }
Proxy Item:
Switch Motion_PartyMode "Proxy to Disable/Enable Motion Sensing for All Motion Sensors"
Rule:
rule "Disable All Motion Sensoring for Party"
when
Item Motion_PartyMode received command ON
then
gMotionSensors.sendCommand(OFF) // Disable all motion sensors from turning ON
gAllDimmers.sendCommand(5) // Turn All Lights on with Dimming set to 5%
logInfo("All Motion Sensors", "All Motion Sensors off Due to Party Mode"
end
rule "ReEnable All Motion Sensoring"
when
Item Motion_PartyMode received command OFF
then
gMotionSensors.sendCommand(ON) // Disable all motion sensors from turning ON
gAllDimmers.sendCommand(0) // Turn All Lights on with Dimming set to 0%
logInfo("All Motion Sensors", "All Motion Sensors off Due to Party Mode")
Echo_Living_Room_TTS.sendCommand('Party Mode Disabled. All Motion Sensors ON. All Lights turned off')
end
In your “disable” rule:
You are sending an OFF command to the gMotionSensors Group. This means that all members of the Group will receive an OFF command.
This will not disable the Motion Sensors. It will just change their state to OFF at that moment. The next time they detect motion, they will send a status update (ON) to OH2 and your motion detection rule will fire.
You can’t really disable a Motion Sensor like this.
What you can do is go into your motion detection rule and add a check for the state of the Motion_PartyMode Item. If this is ON, do not execute the motion detection rule logic that turn on/off the lights.
For example:
rule "FE01_ON" // FibEye01 motion detection turns ON Staircase LEDs when dark and Party Mode is OFF
when
Item FibEye01_Movement changed from OFF to ON
then
if (FibEye01_Lux.state < 80 && Motion_PartyMode.state==OFF) {
...
Your gAllDimmers.sendCommand(5) will work fine as you have it in your Party rule.
Your rule title should be something like: rule "Enable Party Mode !!! Hurrah !
rule "FibaroEye1 motion detection turns ON Living Room Lights when Lux is less than 20, with a 2 Minute Inactivity Timer"
when
Item FibaroEye1Motion changed to ON
then
if(FibaroEye1Motion_Armed.state == ON && Motion_PartyMode.state !== ON){
var int Dim = 0
try {Dim = Integer::parseInt(LivingRoomDim1.state.toString)} catch (Exception e) {}
if (FibaroEye1Lux.state < 20 && Dim < 31) {
if (Eye1_Timer !== null) {
LivingRoomDim1.sendCommand("5")
logInfo("FibaroEye1Motion","Living Room Motion Timer rescheduled for " + Eye1_TimeOut + " minutes")
Eye1_Timer.reschedule(now.plusMinutes(Eye1_TimeOut))
} else {
logInfo("FibaroEye1Motion", "Living Room Motion Detected! Turning ON Living Room Lights")
LivingRoomDim1.sendCommand("5")
logInfo("FibaroEye1Motion","Living Room Timer created with " + Eye1_TimeOut + " minutes")
Eye1_Timer = createTimer(now.plusMinutes(Eye1_TimeOut))
[ |
if (FibaroEye1Motion.state == ON) {
logInfo("FibaroEye1Motion","Living Room Motion triggered, but rescheduled again for " + Eye1_TimeOut + " minutes")
Eye1_Timer.reschedule(now.plusMinutes(Eye1_TimeOut))
} else {
logInfo("FibaroEye1Motion", "Living Room, No Motion Detected! Turning OFF Living Room Lights")
LivingRoomSw1.sendCommand("OFF")
Eye1_Timer = null
}
]
}
}
}
end
With:
rule "Disable All Motion Sensoring for Party"
when
Item Motion_PartyMode received command ON
then
gAllDimmers.sendCommand(5) // Turn All Lights on with Dimming set to 5%
logInfo("All Motion Sensors", "All Motion Sensors off Due to Party Mode")
Echo_Living_Room_TTS.sendCommand('Party Mode Activated. All Motion Sensors Off. Lights set to five percent')
end
rule "ReEnable All Motion Sensoring"
when
Item Motion_PartyMode received command OFF
then
gAllDimmers.sendCommand(0) // Turn All Lights on with Dimming set to 0%
logInfo("All Motion Sensors", "All Motion Sensors off Due to Party Mode")
Echo_Living_Room_TTS.sendCommand('Party Mode Disabled. All Motion Sensors ON. All Lights turned off')
end
Your Disable All Motion Sensoring for Party and ReEnable All Motion Sensoring rules log the same message. This will be confusing when you check your log files
I would simply replace both log messages with the messages that you send to the Echo_Living_Room_TTS item because it gives more insight in what all happens due to the state change.