DSC Alarm Integration - and Alarms in General

@ethomasii just posted the special key i needed. let me build my system with his device-types and smartapp and post up a walkthrough later on.

really having a generic app for the api calls is great because you could control anything on your system with 1 app.

This looks like my Xmas present :slight_smile: I have had the Envisalink installed for a while but just didn’t have the time or patience to muddle my way through figuring out an install with arm/disarm.
Maybe I will finally be able to open the garage door without making the mad dash to the alarm panel before it goes off.

Jeremy,

Before I begin digging into the code. Where do the differences lie? Does the alarmserver.py script needs changing or something has to happen on the ST App as well? I am mainly talking about for arming and disarming.

Also, I am still having issues with the ARM/DISARM showing. My panel is disarmed and I see it in the activity that the panel is disarmed. However the icon still shows ARMED. Thats weird. Any idea why ?

Adwait

yea, kents code always shows armed by default, i’m not sure why.

heres what you can do until i can write up the whole process. download and set up ethomasii’s github for alarmserver. https://github.com/ethomasii/alarmserver-smartthings

  1. make sure you can reach your alarm server from publicip:httpsport, ie http://207.41.20.10:8111 and that it shows your alarm system.

  2. use ethomasii’s two switches for away/stay in device types and then devices.

2.5 create your own devicetypes for open/close contact sensors, or use the code from smartapp forum that was posted today by ethomas

  1. create a smartapp and register it with oauth following kents guide called restapisetup. if you look in smartapp forum you’ll see thomas posted his smartapp. when you do the oauth, make sure you choose auth both switches. if you created contact sensors, you can auth them also.

  2. once you can arm/disarm your system, you need to get the url’s for the zones to report back to ST. it will be appID, switchID, and arm/stay/disarm and your token code. the url will look like this

Alarm Stay and Alarm Away activation URLS. This is for two switches, one for stay/disarm and away/disarm. Use the devicetypes provided. Use “stay/away” as the command, not “on”. The smartthings UI uses “on” to send commands to alarmserver.

alarmaway=https://graph.api.smartthings.com/api/smartapps/installations/686fab7c-5954-49b4-ba99-b95e54c7f87e/switches/417ca1a4-28c2-4f09-968f-6db4e10b1a9d/away?access_token=977532c5-8c08-4ad2-859b-f9c969dd1906
alarmstay=https://graph.api.smartthings.com/api/smartapps/installations/686fab7c-5954-49b4-ba99-b95e54c7f87e/switches/bd1cf562-62ec-4b49-816c-5e8cad43d299/stay?access_token=977532c5-8c08-4ad2-859b-f9c969dd1906

Alarm Stay and Alarm Away disarm URLS. When we disarm, we tell both switches to disarm (because we do not track smartthings state). Use the devicetypes provided. Use “disarm” as the command, not “off”. The smartthings UI uses “off” to send commands to alarmserver.

alarmoff1=https://graph.api.smartthings.com/api/smartapps/installations/xxxxxxxxxappID/switches/xxxxxxxswitchID/disarm?access_token=xxxxxxxxxxtoken
alarmoff2=https://graph.api.smartthings.com/api/smartapps/installations/xxxxxxxxxappID/switches/xxxxxxxswitchID/disarm?access_token=xxxxxxxxxxtoken

what took me so long was first getting a smartapp that recognized my device-types (switches, contacts), then setting up oauth with it. once i completed that, use the url above or click on your actual devices to get the id’s. when you put them in the config.cfg and start alarmserver you’ll see it actually say callback to ST with the url you put in. then you can see it hit ST in the logs. i’ll start typing this all up better.

also the following edits need to be made to alarm arm, which i renamed and made alarm away, since the other was alarm stay.

command “alarm” should be command "away"
label: “Arm” should be label: "Away Arm"
log.debug “Executing ‘stay’” should be log.debug "Executing ‘away’"
log.debug “Executing ‘arm’” should be log.debug “Executing ‘away’”

Oh wait, I need a permanent IP to remote arm and disarm through ST ?

yes because remember its flow like this:

mobile app -> ST cloud -> your home router -> alarmserver -> evl-3 -> dsc

thats what took me the longest to understand about the whole project. https looks like its disabled on ethomasii’s code, so even though the config says httpsport its actually just http.

get a dynamic dns, point it to your home ip, and use a custom port for https. thats all i did.

I though we could somehow send from ST Cloud -> ST Hub -> Alarm Server -> EVL3? No ?

Not from what I understand so far. I don’t know how st is supposed to manage wifi devices.

I dont know if I am ready for all that, I think for now, I can arm and disarm through EVL3. At the end of the day thats a web request, may be I can figure out how to do that directly from a ST app.

I would love to get st to talk directly to evl3 but evl3 only allows 1 connection and drops after time. There is an android app called dscserver that I’d like to use instead of alarmserver maybe ethomasii could figure it out.

Here is another thing I figured out. May be Kent can explain further. So if you move the “Ready” state to the top of the list it will show it as “ready” by default instead of armed, but then when I have it armed, it goes red for 1 second and then goes back to ready. May be thats why he had it ARMED by default. Anyone have any idea with that ?

if you click on the device in IDE it should show you the current state like on/off or open/closed. see what it shows for dscpanel, maybe that is the issue.

If I go to the device under things and look at activity it shows me the device is armed, when I click back it shows the device red for 1 second and then goes green again. Very weird. I dont know the language Smart Things uses or else I would try to figure it out.

Yea that’s why I stopped using it after 1 night. I don’t think it breaks any automation just doesn’t seem to show the correct status.

I am sure there is someone here that knows

the problem is none of this is ready for the mainstream average user. i wanted something that was plug and play because i didnt have time to deal with all this, but here i am neck deep now.

@adwaitjoshi @isriam it doesn’t have to be that way, ST Hub can talk to devices on your internal network but only over HTTP. So there is NO requirement that you make your AlarmServer publicly available unless that’s how you want to set it up.

Also if you do have AlarmServer exposed to the internet then ST Cloud can talk directly to it over HTTPS, it’s only the hub that can’t do HTTPS internally on your network.

I would NEVER expose my AlarmServer setup to the internet and I certainly would never expose it via HTTP over the internet.

Hi Kent,

I will investigate how to do this internally. Are you able to tell us why does the panel state show what it shows? I also sent you a PM on it.

Adwait

I just replied to your PM, I don’t have any issues with the state of my panel device in the ST app, it works perfectly and always reflects the current state of my alarm panel. I think you and @isriam are using @ethomasii AlarmServer code which is not what I use so I don’t know what that code is doing for the panel states but the panel device I provided works fine with the original AlarmServer project (Juggie’s original version with my patches on the Smartthings branch) and HoneyAlarmServer which is a fork that supports the vista panels.