Hi Oliver, i feel your pain, ive been scratching my head for a while myself and doing alot of testing to make sure that the rules i use work correctly. i can give you an example here of rules that work in my case:
I use Expire binding with items
My multisensor 6 has a motion timeout of 10sec
Switch Bad1VDTimer {expire="7m,command=OFF"}
Switch Bad1VDTimerNight {expire="3m,command=OFF"}
First rule is to allow me to have an override switch: here i take the zwave device and move it to an virtual device āIFā override is not ON
rule "Bad1MotionON"
when
Item Bad1Motion received update ON
then if(Bad1VDMotionOverride.state==OFF){Bad1VDMotion.sendCommand(ON)}end
rule "Bad1MotionOFF"
when
Item Bad1Motion received update OFF
then if(Bad1VDMotionOverride.state==OFF){Bad1VDMotion.sendCommand(OFF)}end
Here is the rule for motion on Daytime/NightTime
rule "MotionOn Daytime/NightTime"
when
Item Bad1VDMotion received update
then if ((Bad1VDMotion.state==ON) &&(GoodnightMode.state==OFF) && (CozyMode.state==OFF)&&(Bad1LightON.state==OFF)) {
sendCommand(Bad1Dim1,100)
sendCommand(Bad1VDSonos,ON)
sendCommand(Bad1LightON,ON)}
else if ((Bad1VDMotion.state==ON) && (GoodnightMode.state==ON)){
sendCommand(Bad1Dim1,10)
sendCommand(Bad1LightON,ON)}
else if ((Bad1VDMotion.state==ON)&&(CozyMode.state==ON)&&(GoodnightMode.state==OFF)){
sendCommand(Bad1Dim1,10)
sendCommand(Bad1VDSonos,ON)
sendCommand(Bad1LightON,ON)}
end
When motion off is received from Zwave device (virtual device) i starts the timer
rule "MotionOff"
when
Item Bad1VDMotion received update OFF
then sendCommand(Bad1VDTimer,ON) end
Here the timer runs out but will only turn off the light IF there is no motion
rule "LightOff"
when
Item Bad1VDTimer received update OFF
then if (Bad1VDMotion.state==OFF){
sendCommand(Bad1Dim1,0)
sendCommand(Bad1VDSonos,OFF)
sendCommand(Bad1LightON,OFF)}end
rule "LightOff Nighttime"
when Item Bad1VDTimerNight received update OFF
then if ((Bad1VDMotion.state==OFF)&&(Bad1VDTimer.state==OFF)){
sendCommand(Bad1Dim1,0)
sendCommand(Bad1VDSonos,OFF)
sendCommand(Bad1LightON,OFF)}end
rule "LightManualOff"
when
Item Bad1Dim1 received update 0
then
sendCommand(Bad1VDSonos,OFF)
sendCommand(Bad1LightON,OFF) end
The Bad1LightON switch is used to allow me to manually dim the light and not having it getting triggered back to the original setpoint the next time i trigger the motion sensor.
Hope this helps alittle
Regards Chris