If statement alarm activation help!

Hey All,

So today’s task: Trying to do something like this which clearly isn’t working lol HELP!


// Alarm System Active Action
rule "rAlarmActivated"
when
    Item lMotion received update OPEN
else
    Item kMotion received update OPEN
else
    Item kDoor received update OPEN
then
    if (AlarmSysStatus.state == 0) {
        logInfo("Security", "SECURITY: Intrusion Detected!")
        Thread::sleep(5000)
        Siren1.sendCommand(ON)
        lWf.sendCommand(ON)
        lTv.sendCommand(ON)
        lDoor.sendCommand(ON)
        sendMail("alerts@cidcomm.com", "Garage Door Intrusion!", "Home Intrusion Detected!")
        }else{
        logInfo("Security", "LOG: Sensor State Change!")
end

Ok, think i got it. This seems to work perfectly…

// Alarm System Active Action
rule "rAlarmActivated"
when
    Item lMotion received update OPEN or
    Item kMotion received update OPEN or
    Item gIntDoor received update OPEN
then
    if (AlarmSysStatus.state == 0) {
        logInfo("Security", "SECURITY: Intrusion Detected!")
        Thread::sleep(5000)
        Siren1.sendCommand(ON)
        lWf.sendCommand(ON)
        lTv.sendCommand(ON)
        lDoor.sendCommand(ON)
        sendMail("alerts@cidcomm.com", "Garage Door Intrusion!", "Home Intrusion Detected!")
        }else{
        logInfo("Security", "LOG: Sensor State Change!")
end