[OBSOLETE] Smart Alarm is here

I am using HADashboard and have configured a button for “Arm Away”. The mode changes in HADashboard come with a countdown timer before it’s set, giving you time to either hit “Refresh” which cancels the timer or exit if you are changing to a mode that would arm your system. In my case the “Arm Away” button counts down and then changes mode to “Away”.
It’s a bit involved to setup, but their step-by-step instructions are good.

You convinced me. The exit delay is back in 2.2.0. Enjoy!

LOL I like putting theory to work. Thank you!

Hi Geko, I’m trying to use the Aeon 1 button or “Panic button” to work in your app as a remote:


I only want it to arm with a short press and panic with a long press. Can’t get the long press to work as it looks like you don’t support this yet. Is that something that’s doable?

Thanks much

You’re right, Smart Alarm does not handle button ‘held’ events. It’s certainly doable, but it’d require messing with the UI and I’m tied up with other projects at the moment.

Thanks. No rush, or never is fine too. Just thought I’d ask.

First off… absolutely love Smart Alarm.
I do have a feature request, though. How about flashing a light (once per second) during the entry and exit delay period. This would provide a nice visual affordance that the alarm has been armed will be set to sound at the end of x seconds. Mostly I see this as a backup in case a presence sensor fails… giving the person a hint that they need to find an alternative way to disarm. Might also be fun to have a speech-synth countdown sent to VLCThing…

1 Like

is there a simple way to switch the interior and exterior… my issue is i would like to make it so my motion sensors are on in night mode and off in away. seams backwards i know but for me it world be awesome.

Hi @geko,

First, very impressive work and thanks for your continued updates.

Second, a question…pressing a single button to disarm an “alarm system” seems fairly insecure, especially if I want to give it to more than one person. Is there a plan to be able to enter in a code or PIN into the the Minimote (or some other hardware)?


Minimote is treated the same way as a key fob in any alarm system. It’s meant to arm/disarm the alarm by pressing a single button and should only be given to someone who’s authorized to do so.

Another suggestion… Would it be possible to trigger an sound alarm via VLCThing instead of a siren?

Currently, Smart Alarm can “speak” a phrase when alarm is triggered. Playing alarm sound is doable with some code changes.


Any chance this will ever work with traditional home alarm monitoring companies?

The advantage of using SmartThings as an alarm system is that it’s fairly inexpensive to setup, easily expandable and there’s no service fee. If you’re going to pay for monitoring service, you’ll be better off with whatever alarm hardware your monitoring company offers. In many cases they will give it to you for free and recover its cost over your contract term.

Hey @geko,

I’m still having some issues with SmartAlarm and when my family comes home.

I’m using the app and arming when we leave in the morning by changing move to away. This happens just fine. I have the side door setup as an entry door, and running a 45 second delay on the alarm.

In the afternoon my son is usually the first one home and he unlocks the z-wave lock. I’m running another smartapp that changes mode to home when it sees a valid unlock code.

Looking in my logs, here’s what happened today:

2014-12-05 3:14:35.901 PM EST - Side Door Lock unlocked.
–> Hello home shows “I’m Back” at 3:14
–> Hello home shows “Welcome Home, I changed more from Away to Home.” at 3:14
2014-12-05 3:14:36.078 PM EST - Side Door was opened
–> Helle home shows: Alarm at Home! Side Door at 3:14
2014-12-05 3:14:36.530 PM EST - SmartAlarm sent BOTH command to Den Siren
–> Hello home shows: Home alarm is Disamred. at 3:14
2014-12-05 3:14:36.990 PM EST - SmartAlarm sent OFF command to Den Siren
–> Hello home shows: Home alarm is Armed Away. at 3:17

Obviously a little hard to piece everything together, but it appears that:

1: SmartAlarm is NOT waiting 45 seconds before setting off the alarm when the side door is opened.
2: SmartAlarm appears to see the mode change, and within a fraction of a second turns off the Siren after turning it on.
3. After three minutes, SmartAlarm “rearms” the system. I’m guessing this is standard procedure to reset the alarm status after an alarm event, but apparently the “disarm” is not properly shutting off the “rearm.”

I’m looking through the code to see if I can find where things might be going wrong, but frankly, I’m not following all of it. Looking at this section:

if (!state.alarm) {
    state.alarm = true
    if (zone.entrance && state.entryDelay) {
        // See Issue #1.
        myRunIn(state.entryDelay, activateAlarm)
    } else {

It seems to say that if the zone is an entrance zone, then run the actAlarm procedure after the number of seconds specified by entryDelay, correct? Presumably when the system is disarmed this “unschedules” that scheduling of the alarm?

I see this line earlier in the code:
state.entryDelay = settings.entryDelay ? settings.entryDelay.toInteger() : 0

This is where the state.entryDelay appears to be created, but I’m not sure what all it happening in this line. Can you explain what the different parts here are supposed to do?

1 Like

The entry and exit delays were working a couple of weeks ago. I have a feeling that SmartThings keeps fiddling with the platform on their side and I’m reluctant to spend a lot of time on it until the platform is more stable.

state.entryDelay = settings.entryDelay ? settings.entryDelay.toInteger() : 0

The above code ensures that settings.entryDelay is initialized. In the old version this var was boolean.

if (zone.entrance && state.entryDelay) {
    // See Issue #1.
    myRunIn(state.entryDelay, activateAlarm)
} else {

This code either schedules delayed execution of activateAlarm function if the zone is defined as ‘entrance’ and the entry delay is greater than zero or executes it immediately otherwise. The unschedule was necessary because of the existing bug in SmartThings runOnce API. It’s quite possible that the bug was fixed recently and this call is no longer necessary.

1 Like

I’ve been seeing this entry delay issue for a while too. Not sure when it started. I was just planning to start documenting it and report it but @chrisb has done a great job. Exactly what I am seeing. @Geko understood. Lots of general quirkiness in the platform lately.

I’m not using delays in my setup, so I haven’t noticed it. Will have a look over weekend.

I had an issue earlier this week where my wife issued a Hello, Home command then opened a non-entry door and Smart Alarm went off (which really sucked for me because I was enjoying a nice dream). In the logs it showed the mode switch to Home, the garage says that it is open, and then Smart Alarm triggering. My guess is that platform sluggishness caused the message from the door to get sent to Smart Alarm before the mode change.

That’s quite possible. I’ve seen events arriving out of order is the logs sometimes and I don’t think SmartThings make any guaranties about the order, which makes it kind of useless for real-time applications.