DSC Alarm Integration - and Alarms in General

@sanity Not sure I placed it in the right place? Is this a good place? Can’t find line 648 Lol…

try:
# Note: I don’t currently care about the return value, fire and forget right now
requests.get(myURL)
print myURL
except:
print sys.exc_info()[0]

   server.shutdown(socket.SHUT_RDWR) 
   server.close() 
   sys.exit()

@dbmet No I screwed up the line number, put the single line print myURL right under line 409.
The rest of that code I posted is already in the alarmserver.py file, you just need the single print line.

Sorry about that…

@sanity Ok I got the url and also in the activity stream on the Smart things area for alarm panel I can see it getting stuff when zones up and close However None of the icons change…

@dbmet Ok so here are a few things to check, first look in alarmserver.cfg under the [alarmserver] section you MUST have your zones named for the zones that you want notifications on Smartthings for.

[alarmserver]
zone1=My Zone
zone5=Front door
zone12=And so on

Next the DSC Panel Device code MUST have matching zone numbers for each zone you are going to get notifications for.
So open your Panel device in Smartthings and look at the code, find the standardTile sections and make sure that the both parts of the tile name match your zone+numbers.

Example:

standardTile("zone12", "device.zone12", canChangeBackground: true, canChangeIcon: true) {

Then last but not least the details stanza must match all the defined zones.
So if you defined 3 zones 1, 5 and 12 as above then your details line would look like below.

details(["partition1", "zone1", "zone5", "zone12"])

Just got mine set back up last night and working great, although I am not using the branch. I find it much easier, and more in line with the existing code to just do something like this:

ZONEOPEN1 = url
ZONEOPEN2 = url
ZONEOPEN3 = url
etc

ZONECLOSE1 = url
ZONECLOSE2 = url
ZONECLOSE3 = url
etc

and in the code to utilize similar methods to what exists to bring in each url. Then, depending on the zone that was trigged, fire off the appropriate URL. It works great thus far, and it just took a few extra minutes to get the url for each. Nice thing is you do not need any custom devicetypes, just make regular motion or contact device types.

@ethomasii Where would I put this information if I wanted to try it this way?

im at work right now, but my hub just arrived… so i will be getting it setup tonight. If I have time, I will try to put it up on github. Thus far it has been working well for a few days now with no crashes.

Sounds good to me…

Never did get this to work. Got the zone names all fixed. Alarm server sends the right names. In the activity stream on smartthings app just shows as zonezone4 updating. Doesn’t match what alarmserver sends is the only thing I can figure out why the icons don’t update.

Yeah you must have something named wrong someplace as the event should just say zone4 not zonezone4.
You likely have the word zone in some extra place where it doesn’t need to be, most likely in your URL’s in AlarmServer since that’s where that data comes from. My URL’s simply include the zone number and never the name ‘zone’.

Below are some lines from my alarmserver.cfg file.

[alarmserver]
zone1=Front Door
zone2=Garage Entry Door
zone3=Garage Service Door
callbackurl_base=https://graph.api.smartthings.com/api/smartapps/installations
callbackurl_app_id=scrubbed_for_my_protection
callbackurl_access_token=scrubbed_for_my_protection
callbackurl_event_codes=601,602,609,610,650,651,652,654,656,657

Those are exactly what I have in mine? Weirdness. Alarm Server is sending what I put in the alarm server config…

So, I have never pushed anything to github… tried briefly and it didnt quite work out as expected :stuck_out_tongue:

I will try some this afternoon to push up my version.

Hmmm wonder if I will be able to use the motion detectors to turn my hue lights off and on once I get this working

Absolutely you can. I have it setup to do several neat things:

After 6AM when the motion sensor notices me, it turns off alarm stay and turns on a few lights.
After 10PM when the house has quieted down it automatically turns the alarm to stay mode if I haven’t already and also turns the lights off, closes the garage, etc.

In my basement, when I walk down the stairs the motion sensor catches me and turns on the family room lights.

If my wife and I are not home it automatically arms the alarm.

It also lets me know if any of the doors have been open longer than 5 minutes.

These are all things that are built right in to Smartthings, I am just able to use my alarm sensors in place of buying additional hardware.

My motion sensors are true “motion sensors” and my doors are setup as “contact sensors”. My arm/stay/disarm I setup as two different switches that the alarmserver tells Smartthings when the status changes, or I can change the status from Smartthings and it tells alarmserver to arm/disarm.

Had the Zone working yesterday and changed something and then it just stopped working… Lol Oh well I’ll keep plugging away…

Hey guys, i got my code pushed up to github @ https://github.com/ethomasii/alarmserver-smartthings

It has been working well for me for weeks. If you need any assistance let me know. I know that this is different that what others have pushed up, but it works for me… so I plan on keeping it.

Couple of things:

  • Removed https. This allows me to communicate to my alarmserver. It isn’t ideal, but I plan to add LAN communication from the smartthings hub eventually.
  • Have a couple of device types there. Alarm Stay and Alarm Away. I use those so that I can tell Smartthings that my alarm is in stay or away mode or disarmed. you need to use arm/disarm method calls for these, as the on/off is used from the smartthings UI to communicate back to alarmserver.

Anyway to find out what the endpoints are supposed to be for each zone… I got lost trying to figure it out…Lol

Also How did you make your motion zones be motion?

Also What do i need to change in the DSC Alarm Arm.groovy and DSC Alarm Stay.groovy

Shouldnt need to change a thing in the device types. Just set the preferences and you should be good to go. You will need the box running alarmserver open to the internet and then just point the device at it. I use dynamic dns to keep from using an ip.

And the endpoints you should just do with the OAuth tutorial. Make however many new devices in the IDE that you have. For example, I have 2 motion sensors and 5 doors, so i made 2 bogus motion sensors and 5 contact sensors. Then they will be available as an end point for you to control their status.

@dbmet Pull a fresh copy of dscPanelDeviceSmartthings.groovy from my Github repo, it has a fix that should make your panel work fine now. Sendevent was appending partition and zone to everything which it shouldn’t have been doing. @mattmartz I think found that issue and provided a fix in the forums that I forgot to include in the repo so it’s been included now. Anyway pull a new copy of the Panel device and try again.

Thanks.

-Kent

@sanity That was it. It’s working now.

Going to try to make seperate motion zones so that I can turn lights off if a zone opens. Not really sure how but gonna play with it…Lol

Thanks