SimpliSafe Alarm Integration (cloud to cloud)


4/8/2021

  • This app is no longer being supported or updated. It may continue to work, however no improvements or code changes will be made. No further support will be provided for this integration.

10 Likes

You’d need to write a custom device handler with three tiles for “Home”, “Away” and “Off” commands and a tile to show alarm status. The device handler would issue HTTP requests to the web service when you tap a command tile and update status tile when it receives a reply. Pretty basic stuff. Read the docs and start coding. :smile:

I am very interested this also. I am extremely disappointed in the fact SimpliSafe shows no interest in tying into any sort of home automation such as IFTTT. ADT is going to be integrating with IFTTT soon and that will really put the pressure on them to.

Yup, understand that part but I’m more so having trouble keeping the session alive during the login. I first need to call a login page and pass my credentials. I then need to make a second call to actually do something. The problem is from my first login call to my second action call, I loose the cookie/session/authentication.

def params = [
    uri: "https://simplisafe.com/mobile/login/",
    body: [name: "REMOVED", pass: "REMOVED", device_name: "SmartThings_API", device_uuid: "REMOVED", version: "1200", no_persist: "1", XDEBUG_SESSION_START: "session_name"]
]   

httpPost(params) {response -> 
    data.auth = response.data
    log.debug data.auth
    

}

Then I try to call this but it doesn’t work:

def params = [
    uri: "https://simplisafe.com/mobile/REMOVED/sid/REMOVED/set-state/",
    body: [state: "home", mobile: "1", no_persist: "1", XDEBUG_SESSION_START: "session_name"]
]   

httpPost(params) {response -> 
    data.auth = response.data
    log.debug data.auth
    

}
1 Like

Not sure this will help you, but this person got it working with Java:

This in python and specifically mentions avoiding the login cookie timeout:

I started on an integration (and in parallel learning some groovy to mess with SimpliSafe) - https://github.com/bobcat0070/simplisafe-smartthings

Just load it up as a new Device Type and set your SimpliSafe Username / Password on a new Device.

Its currently hard-coded to only support one location (the first one returned) and currently displays the SimpliSafe alarm status as a tile.

I’ll be implementing support to change status (off/away/home) when I get a chance. I still have to figure out if there is a trimode capability or if it will have to be a switch with a cobbled together On state for Armed/Home. Any advice certainly welcome.

2 Likes

Awesome!!! I got it up and running and so far is reading my status fine. How often does it poll for status? I setup pollster to pole every minute for now.

Also, it would be cool if we can get notifications when there is a status change (home, away or off).

Can’t wait for the status changes being performed from ST!

@fgorodishter
This is exactly what I was trying to figure out how to do. Excellent work! Thank you so much for your effort :smile:

Happy to hear its working for you :slight_smile:

It is currently exposing the Poll capability and in turn SmartThings calls poll() every 10 or so minutes. It is certainly not consistent and I may add a scheduled Poll call in there.

I hadn’t heard of Pollster before, but definitely looks to solve some of this inconsistency and should work with this integration without problems. Thanks for the tip.

Thank you for this device type! I have started working on my Smart App to set my “Hello, Home” based on my alarm’s state. I’m having a little trouble, though. Can anyone please take a look at my code and see what I’ve missed? The app simply doesn’t do anything. I’ve gone through several iterations of the code without luck.

preferences {
section(“Monitor this alarm”)
{
input “Alarm”, “capability.alarm”, title: “Which?”, multiple: false
}
}

def installed()
{
subscribe(Alarm, “alarmMode”, alarmHandler)
}

def updated()
{
unsubscribe()
subscribe(Alarm, “alarmMode”, alarmHandler)
}

def alarmHandler(evt)
{
def currentState = Alarm.alarmMode

If(evt.value == "Off")
{
	location.helloHome.execute("I'm Back!")
    log.debug("Alarm is off.")
}
Else
{
	If(evt.value == "Away")
    {
    	location.helloHome.execute("Good Bye!")
        log.debug("Alarm is Armed; Away.")
    }
    Else
    {
    	location.helloHome.execute("Good Night!")
        log.debug("Alarm is Armed; Home")
    }
}

}

@robert_solimine
While I haven’t tried it for myself yet, there’s two things I see that you will want to look into.

One of my gripes with SmartThings so far (only had it for 1 week) is the restrictive and inconsistent capabilities matrix when it comes to these more edge cases like integration with SimpliSafe. The capability.alarm (while I have not yet really implemented it in my integration), doesn’t directly do what what we will need since its focused on the modes of a Siren/Strobe rather than an external alarm with Off/Home/Away attributes - https://graph.api.smartthings.com/ide/doc/capabilities
It seems like I can give it the attributes I want, and just keep empty the 3/4 required commands since they make no sense in this context.

All that being said, you are currently subscribing to changes in “alarmMode” (which I likely incorrectly named) whereas the dictated attribute name is alarm", so maybe no event would come through for custom attributes? You can try changing the name of the attribute to alarm and report back and/or a pull request if that fixes it.

While it doesn’t seem well documented (only talked about here: http://docs.smartthings.com/en/latest/smartapp-developers-guide/example-bon-voyage.html?highlight=setlocationmode), there is a function called setLocationMode that you should call to actually do the Mode change.

Hope that helps.

See I envision using the integration to arm and disarm SimpliSafe based on my ST Home/Away status and mode changes. For example:

  1. When the house is in Away Mode in ST: Enable Away Mode in SS.
  2. When I put the house into Sleep mode every night in ST: Enable Home Mode in SS
  3. When I get up each morning according to ST, Disable the alarm in SS.

With those 3 rules, I would never need to manually enable and disable my alarm, I would imagine this would be possible, right? Eventually, I would like to also re-use some of my ST sensors also to trigger SS alarm modes, so I can save on costs of hardware and aesthetics as I hate seeing multiple sensors on each door.

You will be able to do those 3 mode rules in a SmartApp once we get the next bit of functionality implemented. You will also be able to have ST sensors driving SS state (off/home/away).

That being said, since there isn’t a known public accessible API for SimpliSafe to trigger the alarm itself, I don’t know of a way you would be able to not have the SS door/motion/glass-break sensors driving the alarming functionality.

Thanks! Being how unstable ST has been since its inception, I’d rather rely on SimpliSafe to handle alarm triggers. For now I’d be happy with my 3 use cases. Let me know when you need me to test!

Ah! You were correct! I modified the device type from alarmMode to “alarm” and the SmartApp now receives the subscribed events. I am now getting errors in my simulation. I will debug a bit later.

error groovy.lang.MissingMethodException: No signature of method: script14286817495671448426773.If() is applicable for argument types: (java.lang.Boolean, script14286817495671448426773$_alarmHandler_closure2) values: [false, script14286817495671448426773$_alarmHandler_closure2@227099f7]
Possible solutions: now(), url(), run(), any(), find(), is(java.lang.Object) @ line 50

My thinking is that I don’t want my alarm connected to the Internet. I don’t feel the IoT is mature enough to allow control of my alarm to an API. This is part of the reason I purchased SimpliSafe. I love the idea of directing ST based on my alarm state, though. I love the device type that reads the state but does nothing more.

Hey Felix how do I load up those files that you linked to as a new Device?

In the IDE, Go to Device Types and add Felix’s code. Then you go Devices, add a new device and use the new device type you just created.

Thanks for the quick reply Mbhforum… but where do I enter my username and password for simplisafe?
In the code or in the app once it detects its it and I add it?

Once the Device shows up in your “Things”, you will see a Preferences button where you enter in your credentials.