Get Alarm Status in SmartApp?

I’ve been updating the StatusThing Mac Status Bar app that Alex King wrote a while back to support door, window, and motion sensors:

I’d like to also add in support for Smart Home Monitor, but so far I’ve been able to find through digging through the forums is the ability to read the state of the monitor (home, away, etc), and not get the detection status of if (intruder detected, ok, etc). Does anyone know of the magic string to pass to ask whether the alarm has been triggered through a SmartApp so I can relay it? Thanks!

No… There is no published API for SHM.

IMHO, it is because SHM is a monetization channel for SmartThings (i.e., sales of professional monitoring, notify neighbors and similar services). It is also using various features / functions that are not available to general SmartApp programmers and releasing the SHM API might inadvertently reveal this.

That’s too bad… thanks for the help anyways…


1 Like

You could work around it by having SHM set up to send a notification to IFTTT, then using that incoming notification to turn on a virtual switch and showing the status of that virtual switch. It’s not ideal, but that should be doable.

I don’t have SHM set up but if it can be used to trigger a siren, you could also set up a virtual siren and show its on/off status. That way you wouldn’t need to go through IFTTT.

That’s a great idea! I’ll give it a try and report back.

1 Like

OK - this works! I set up a virtual siren, then tied that to SHM. The key is to set the timeout on that siren in SHM to something really big. By default it’s set to 5 minutes, which means that siren will only reflect the alarm state for 5 minutes after it is tripped. I don’t know what the valid range of values are for that timeout, but I set it to 100,000 minutes (just shy of 10 weeks), and it didn’t complain. I then tied that into the StatusThing SmartApp and the StatusThing OS X app, and it is now reflecting the alarm trigger status in my status bar!

I’m still working on it, but if anyone is interested I have it in a fork here: . The code for the updated SmartApp, the virtual siren, and the OS X code is in there.

I’ve added a few more features as well… here it is armed but not triggered. The % readouts are batteries. Any lights that are on, or sensors that are tripped will get a check mark next to them. Tap a light to turn it on or off. Tapping anything else doesn’t do anything.

And here it is triggered. Normally one of the sensors would be showing as triggered at this point, but I use a virtual contact sensor to trigger the alarm when I’m not at home for testing, and I don’t have that sensor tied into the display.


Great idea!