SimpliSafe DTH

I have a SimpliSafe security system and I was using the DTH with some automations to arm/disarm the security system. The code attached was written by Toby and Scott over on the SmartThings community.

The DTH connects and gets status updates on the alarm. When I try to set the alarm to either home/away/off, I get this error:

Alarm SET to OFF Error: groovy.lang.MissingMethodException: No signature of method: dev1519955406307370838064.httpPost() is applicable for argument types: (java.util.LinkedHashMap) values: [[uri:https://api.simplisafe.com/v1/subscriptions/XXXXXX/state?state=off, …]].

Does anyone have an idea what might cause the MissingMethodException error?

1 Like

I’ve had the same httpPost error on my attempt to bring over Sinope thermostat api from smartthings and haven’t received any suggestions so I hope you have better luck… Maybe I can get my answer from yours.

Thank you. The other issue I think I’m going to face is how to access things like the alarm state (away/home/off) in Rule Machine. I can make the custom commands, but those are actions after a trigger or condition set. I need to make those states triggers.

Looks like httpPost requires the closure at the end of the statement (even if you don’t need the response).
If you add {resp -> } at the end of lines 88, 97, and 106 the errors should go away.

1 Like

YEAH!!!!! It works and there's no errors!! Thank you so much!!! Here's what I put in:

httpPost([ uri: getAPIUrl("alarmAway"), headers: state.auth.respAuthHeader, contentType: "application/json; charset=utf-8" ]){resp ->}

One last (I'm pretty sure) question. How does the "presence" work in the code? Right now it's showing "null" in the device page:

I'm of the opinion that the only way I can get this working as a trigger for Rule Machine is to make use of the presence.

Nice! Good to hear it’s working!

Presence is set based on the alarm state: ‘present’ for OFF/Home, ‘not present’ for Away. Looks like it’s set whenever the state changes or is polled every 5 minutes. I tested the code section manually and it seems to be working correctly/no errors. ST documentation says a null value means ‘not present’ but in your screenshot the status is off so it should actually be present. Might be helpful to add some extra logging around that section to see the values.
Line 213:

//Set presence
def alarm_state = device.currentValue("alarm")
log.debug "presence alarm_state: ${alarm_state}"
def alarm_presence = ['OFF':'present', 'HOME':'present', 'AWAY':'not present']
def presence_value = alarm_presence.getAt(alarm_state)
log.debug "presence value: ${presence_value}"
sendEvent(name: 'presence', value: alarm_presence.getAt(alarm_state))
1 Like

That makes sense. I posted a question about adding a “capability” called alarm in another thread so it may appear to be a duplicate posting. That said, the response was similar to yours. I will put your code in and see how the response and interaction with the triggers are.

And, thank you @mattw. I’ll take all the advice I can get :slight_smile:

@homeauto2112 have you Incorporated your changes into your dth. Just getting around to my simplisafe. Everything working as expected? Are you on SS2 or SS3?

It's been working pretty much rock solid since March. I created the custom commands for away/home/off and I've had no issues.

Awesome. I took some time to play with it tonight. In ST, they had a companion smart app to go a long with it. But looking closer, it seems we can just interact with it directly. In my case with webCoRE. Above you comment on custom commands.

In most cases, in my pistons I was monitoring state of it and then taking action - works fantastic. However I got to a piston where I wanted to arm it, in this case to Away. Seems like I can do that based on this screen shot:

The first command available is a custom one, and is suggestive of arming it into away status. I am guessing 'device Turn off' will disarm. This piston is harder to test. However how to I set up an option to arm it to Home?

The custom commands I spoke of are inside of RM. I had to create three custom commands in RM for "off"/"home"/"away" to allow rule manager to execute them. I have a few rules for SimpliSafe which include arming the "home" when I push a lutron pico button, or arming the "away" when I leave the house (also locks the door and has Alexa tell me all the windows and doors are closed).

1 Like

I figured the custom commands were in RM, I've build a few custom commands elsewhere already. And I can work with that, however I am not sure how to build them. When I go into RM to create a custom command, the first thing you need to do is select a capability. I guess my first question is which capability to pick, that will include the Simplisafe device (using your custom DTH).

Nvmd, I found it!

I have been chatting with Hubitat over a lot of noise in my logs that were degrading performance. Specifically something that was not 'the app not to be named'. :slight_smile:

The review has so far pointed to this driver.

Details:
User Logs:

|2018-11-28 09:22:12.030|INFO |dev|321|Simplisafe|Checking to see if time has expired....|
|---|---|---|
|2018-11-28 09:22:12.261|INFO |dev|321|Simplisafe|Executing Login...|
|2018-11-28 09:22:13.806|INFO |dev|321|Simplisafe|Executing polling...|
|2018-11-28 09:22:14.085|INFO |dev|321|Simplisafe|Alarm State1: AWAY|
|2018-11-28 09:22:14.086|INFO |dev|321|Simplisafe|Messages: []|
|2018-11-28 09:22:14.364|INFO |dev|321|Simplisafe|Events: System Armed (away mode): ...

Platform logs (from HE):
2018-11-28 09:22:12.260 [QuartzScheduler_Worker-1] WARN org.apache.http.client.protocol.ResponseProcessCookies - Invalid cookie header: "Set-Cookie: [[REDACTED]]; Expires=Wed, 05 Dec 2018 14:22:12 GMT; Path=/". Invalid 'expires' attribute: Wed, 05 Dec 2018 14:22:12 GMT
2018-11-28 09:22:13.614 [QuartzScheduler_Worker-1] WARN org.apache.http.client.protocol.ResponseProcessCookies - Invalid cookie header: "Set-Cookie: [[REDACTED]]; Expires=Wed, 05 Dec 2018 14:22:12 GMT; Path=/". Invalid 'expires' attribute: Wed, 05 Dec 2018 14:22:12 GMT
2018-11-28 09:22:13.806 [QuartzScheduler_Worker-1] WARN

Could someone recommend how to, or someone update the driver to, add some debug lines to help us see what is happening? Looks like around the 'check to see if time expired' area - something around like 275 (check time) or lines 223 (logging in).

I can ask this request, but I would have no idea where / what to add into the driver. :slight_smile:

Separately, I reviewed this entire thread again, and see an old, but unaddressed question about using Simplisafe driver status as trigger (as oppose to something used to take action upon).

I got it working great with the WATO apps: [RELEASE] WATO - When any Attribute Then this cmd Otherwise that cmd

1 Like

Any instructions to install this? I’m a newbie and would love to bring in my SimpliSafe alarm system with rules.

2 Likes

Did anyone get this working with Hubitat?

1 Like

Yes, I use it, it creates a lot of log traffic, especially if you are monitoring motion sensors, and you need to poll the alarm much more frequently than the 5-minutes in the driver to make it practical. I'm polling once a minute right now. There was a concern voiced about SS noticing and taking action against the device doing the polling, but I'm not sure what they could / would do

Can you elaborate a bit on how you got it setup? I got my Hubitat setup yesterday, and I got my Philips Hue Hub and lights added in, and now want to try and get our SimpliSafe system integrated, but unfortunately, I can't find really any actual documentation on how to start.

I will try, but I'm rather new at this too. There is an option on the Hubitat menu (left hand side of the screen towards the bottom) for "Driver Code". Select "New Driver" and paste the code from Github above into that window, and save it.

From there, move to the Devices menu, and select "Add Virtual Device". Name it what you will, label it what you will. The Device type will be simplisafe (it will be in the user section at the bottom of the list). Save the new device, then edit it and enter your credentials.

1 Like