I tried removing that line as you suggested, then I noticed I got some errors in my log. I put the rule back to the way I had it and I got even more errors. Here they are:
2019-06-30 20:36:44.156 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'home.rules' has errors, therefore ignoring it: [37,17]: missing '}' at 'case'
[44,17]: mismatched input 'default' expecting 'end'
Is [37,17] the column then line? What exactly does this error mean, there should be a } in column 37? What does the next error mean? In case it helps, here is what I am currently using for my rule:
rule "Lock: Update lock states after alarm_raw event"
when
Member of gLockRaw received update
then
val actionItem = ScriptServiceUtil.getItemRegistry.getItem(triggeringItem.name.toString.replace("_Alarm_Raw",""))
logInfo("Rules", "Lock: Alarm events: {}=[{}]",actionItem.name,triggeringItem.state.toString)
val StringBuilder message = new StringBuilder(actionItem.name)
switch (transform("JSONPATH","$.type",triggeringItem.state.toString)) {
case "ACCESS_CONTROL" : {
switch (transform("JSONPATH", "$.event", triggeringItem.state.toString)) {
case "18", case "21", case "24" : {
actionItem.postUpdate(ON)
message.append(" updated to ON (locked)")
}
case "19", case "22" : {
actionItem.postUpdate(OFF)
message.append(" updated to OFF (unlocked)")
}
/* case "6" : {
actionItem.postUpdate(OFF)
message.append(" was unlocked with")
switch (transform("JSONPATH", "$.code", triggeringItem.state.toString)) {
case "1" : {
message.append(" Scott's code")
}
case "2" : {
message.append(" Lisa's code")
}
}
}
case "26", case "17", case "23" : {
actionItem.postUpdate(OFF)// jammed could mean unlocked, so I do this for safety... you may want to send an alert here too
message.append(" is jammed, so setting lock to OFF (unlocked)")
}
case "26", case "17", case "23" : {
message.append(" keypad is disabled due to too many failed codes")
}
default : {
message.append(" unknown door lock Event, ").append(triggeringItem.state.toString)
}
}
if (transform("JSONPATH", "$.event", triggeringItem.previousState(true).state.toString) == "26" && transform("JSONPATH", "$.event", triggeringItem.state.toString) != "26") {
message.append(" and is no longer jammed")
}
}
case "BURGLAR" : {
//gSiren.sendCommand(ON)
message.append(" has detected an intruder")
}
case "POWER_MANAGEMENT" : {
message.append(" received a Power Management alarm, ").append(triggeringItem.state.toString)
}*/
default : {
message.append(" received and unknown Type in alarmRawParser, ").append(triggeringItem.state.toString)
}
}
logInfo("Rules", "Lock: Alarm events: {}", message.toString)
end