[SOLVED] Rule for when an item receives a command that does not match a string

Hey Guys,

I am wondering if there is any syntax/script to basically do the following:

rule "PinPad Wrong"

   when

    Item PinPad_String received command <THAT IS NOT> 1234

   then

    //do something

end

rule "PinPad Off"

   when

    Item PinPad_String received command 1234

   then

    playSound("beep.wav")

    sendCommand(Alarm_Switch,OFF)

end
rule "PinPad Off"
when
    Item PinPad_String received command
then
    if (receivedCommand == "1234") {
        playSound("beep.wav")
        sendCommand(Alarm_Switch,OFF)
    } else {
        // do something
    }
end
2 Likes

Thank you kindly :slight_smile: