@geko,
I’m still running into some issues with SmartAlarm going off when it should be disarmed. I just updated to the newest version of your app yesterday reset everything, and armed it. Here’s the events from Hello Home as well as the Logs from the API area of my hub:
Log: 3:14:30 - Side door lock was unlocked with user code 1
Log: 3:14:31 - Side door sensor was opened
HH: 3:14 - Running “I’m Back!” because unlocked Side Door Lock
HH: 3:14 - "I’m Back"
HH: 3:14 - Welcome home! I changed mode from Away to Home as you requested
HH: 3:14 - Your Side door was opened
HH: 3:14 - Home alarm is Disarmed
Log: 3:14:32 - Smart Alarm send off command to Den Siren
Log: 3:14:32 - Smart Alarm send speak command to Ubi
Log: 3:14:39 - Side door was closed
HH: 3:16 - Alarm at Home! Side Door
Log: 3:16:07 - Smart Alarm send both command to Den Siren
HH: 3:18 Home alarm is Armed Away
HH: 3:19 Entrance Zones are armed
The Side door is listed as an entrance zone, which seems to be operating properly. I mean the alarm doesn’t go off until about 60 seconds after the event (which is the delay I have set). But even though Smart Alarm is showing that it’s disarmed both by what is says in HH as well as log events, the alarm is still going off.
This is purely a guess on my part here, but it’s the only thing that seems to make sense to me:
You have two procedures happening at roughly the same time:
The mode is changed to Home and the Door is opened. These things then happen:
Door is opened. We need to process this event and see if we need to sound the Alarm.
First step: Is this zone armed? Yes! Okay proceed to second step
Mode has changed. We need to process this event.
Second step: Are we already in an alarm state? No! Okay, proceed to third step
Mode is home: That means we disarm the alarm: "state.alarm = false"
Third step: change state.alarm = true. Proceed to fourth step
Fourth step: Wait 60 seconds cause this is an entrance zone, then activate the alarm!
Obviously the first thing the activateAlarm() procedure does is check if state.alarm = true. Change modes should set this to false and keep the activateAlarm procedure from doing anything else, but I’m guessing the mode change is happening a split second AFTER the zone event is checking to see if the system is armed but also a split second BEFORE the zone event sets the alarm.state to true.
Does this sound like a reason explanation for what I’m seeing? If so, I think the solution will be to “disarm” twice. Once immediately, then again maybe ten seconds later:
def onLocation(evt) {
TRACE("onLocation(${evt.value})")
String mode = evt.value
if (settings.awayModes?.contains(mode)) {
armAway()
} else if (settings.stayModes?.contains(mode)) {
armStay()
} else if (settings.disarmModes?.contains(mode)) {
disarm()
myRunIn(10, disarm)
}
}
I added the myRunIn(10,disarm) Am I correct in thinking that when my mode changes to home (a disarm mode) it will run the disarm procedure. Then wait ten seconds and run it again?