[NEEDS UPDATING] DSC/Vista Alarm Smartapp and devices based on AlarmServer

@2l82try1,

Ok, you have to use GIT SHELL, which opens up windows power shell in the GITHUB directory. From there you can issue the GIT command.

For me, my GIT repository is in >my documents\GitHub\

@gabe973,
be careful with the password, it can’t be more than 6 characters, limitation on the Envisalink. Reset it to user for the time being until you get it up and running. Also, make sure you have the file named correctly. Go to windows folder option and clear the ‘Hide extensions for known file types’.

Thanks @SmartThang. I changed the password back to user. Got logged in OK and then started throwing errors. also, the config file still isn’t being accepted properly. The file name looks to be named correctly. I’ve pasted in what I’m getting in case that would help see what’s going on. It continues on further…but I cut it short.

DiskStation> python /usr/local/AlarmServer/alarmserver.py
Using configuration file alarmserver.cfg
Config option logurlrequests not set in [alarmserver] defaulting to: 'True'
Config option listentype not set in [alarmserver] defaulting to: 'tcp'
Config option listenport not set in [alarmserver] defaulting to: '8111'
Config option certfile not set in [alarmserver] defaulting to: 'server.crt'
Config option keyfile not set in [alarmserver] defaulting to: 'server.key'
Config option maxevents not set in [alarmserver] defaulting to: '10'
Config option maxallevents not set in [alarmserver] defaulting to: '100'
Config option host not set in [envisalink] defaulting to: 'envisalink'
Config option port not set in [envisalink] defaulting to: '4025'
Config option pass not set in [envisalink] defaulting to: 'user'
Config option pollinterval not set in [envisalink] defaulting to: '0'
Config option zonedumpinterval not set in [envisalink] defaulting to: '60'
Config option keypadupdateinterval not set in [envisalink] defaulting to: '60'
Config option commandtimeout not set in [envisalink] defaulting to: '30'
Config option kpeventtimeout not set in [envisalink] defaulting to: '45'
Config option alarmcode not set in [envisalink] defaulting to: '1111'
Config option logfile not set in [alarmserver] defaulting to: ''
Config option loglevel not set in [alarmserver] defaulting to: 'DEBUG'
Sun, 27 Sep 2015 19:37:29 INFO <root alarmserver <module>> Alarm Server Starting
Sun, 27 Sep 2015 19:37:29 INFO <root alarmserver <module>> Currently Supporting Envisalink 2DS/3 only
Sun, 27 Sep 2015 19:37:29 INFO <root alarmserver <module>> Tested on a Honeywell Vista 15p + EVL-3
Sun, 27 Sep 2015 19:37:29 INFO <twisted log emit> Starting factory <__main__.EnvisalinkClientFactory instance at 0xXXXXXXXX>
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver startedConnecting> Started to connect to Envisalink...
Sun, 27 Sep 2015 19:37:29 INFO <twisted log emit> Site starting on 8111
Sun, 27 Sep 2015 19:37:29 INFO <twisted log emit> Starting factory <twisted.web.server.Site instance at 0xXXXXXXXX>
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver buildProtocol> TCP connection estblished to 192.168.40.5:4025
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver buildProtocol> resetting connection delay
Sun, 27 Sep 2015 19:37:29 INFO <root alarmserver connectionMade> Connected to envisalink:4025
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver lineReceived> ----------------------------------------
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver lineReceived> RX < Login:
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver send_data> TX > user
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver lineReceived> ----------------------------------------
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver lineReceived> ----------------------------------------
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver lineReceived> RX < OK
Sun, 27 Sep 2015 19:37:29 INFO <root alarmserver handle_login_success> Password accepted, session created
Sun, 27 Sep 2015 19:37:29 DEBUG <root alarmserver lineReceived> ----------------------------------------
Sun, 27 Sep 2015 19:37:31 DEBUG <root alarmserver lineReceived> ----------------------------------------
Sun, 27 Sep 2015 19:37:31 DEBUG <root alarmserver lineReceived> RX < %00,01,0028,03,00,FAULT 03 SLIDINGDOOR          

  $
Sun, 27 Sep 2015 19:37:31 ERROR <twisted log emit> Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 215, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/usr/local/lib/python2.7/site-packages/twisted/protocols/basic.py", line 464, in dataReceived
self.lineReceived(line)
File "/usr/local/AlarmServer/alarmserver.py", line 327, in lineReceived
handlerFunc(data)
File "/usr/local/AlarmServer/alarmserver.py", line 372, in handle_keypad_update
ALARMSTATE['partition'][partitionNumber]['status'].update({'alarm': bool(flags.alarm), 'alarm_in_memory': bool

(flags.alarm_in_memory), 'armed_away': bool(flags.armed_away),
exceptions.KeyError: 1

Unhandled Error

Cd to the directory where alarmserver.py lives before you try and run it. It’s looking for the config file in your current directory I think.

Thx for the continued help. I was now able to install alarmserver and pip install requests. I’m at the part in the read me to test run alarmsever. I’m getting

Is not reconized as an internal or external command, operable program or batch file.

Thanks @sanity …that did it. I changed the conffile = ‘alarmserver.cfg’ line in the alarmserver.py file to contain the full path to the config file. Not sure if there’s a better way, but that looks to be working for now.

Finally got alarmserver to run. All events are showing up in real time and all seems fine so far. Next I want to edit the alarmsever.cfg file for my zone names. I took a look through it but can’t seem to find where the info goes. Any direction? Thx

It goes here:

## Zone names. Delete the zones you're not using to have them hidden.
## Add more zoneXX if you need more zones
## Note: For callbackURL setup only defined zones and paritions are sent callback data
zone1=Front or Garage Door
zone2=Backyard Door
zone3=Family Room Windows
zone4=Bedrooms Windows
zone5=Upstairs Windows
zone6=Master Windows

Those are my zones, just change that to match your zones.

Forgot to give an update last night. I was able to find that and got through the entire set up. I’m now having trouble with the very last step of the test url. I’m getting back “this request is not authorized by the specified access token”. I believe I don’t have the right app ID. I will need to get Json reader and double check. Thx

Finally got around to setting HoneyAlarmServer up with the new V2 hub (Vista 20P).

Everything works great but two questions.

  1. I can’t figure out how to arm/disarm through the app. (I’m assuming this can’t be done at this time securely?).

  2. I can’t figure out how to use the armed/disarmed state as a condition. Say I want to turn on lights when the alarm is disarmed between 7pm and 11pm? That is impossible correct?

Thanks for your help.

I managed to get it all working last night. I did have the wrong app I’d. When i went through the oauth setup I only selected one zone to test with, now I want to add the rest but don’t see how now. I made the additional devices and they showup on the app but never update. I’m assuming I’ll need to go through the oauth again?

Im new to this as most probably are. I’ve managed to get the Panel and Zones set up, but something is still not quite right.
Ive managed to get all the zones to show open/closed through the Smartthings app. However I cannot get my DSC Panel to change status in conjunction with the zones. Meaning it wont automatically goto Ready/Armed/Open Etc, unless i physically send the RESTAPI url with the appropriate code designating as such ‘650, 651’.
In addition, the Alarmserver, which i have running on my synology, only runs for a short period of time and eventually stops working, giving the following error over and over

2015-10-02 21:33:01 Incoming web connection from ('192.168.1.XXX', 63755) 2015-10-02 21:33:01 Web request: GET /api?{} 2015-10-02 21:33:06 Incoming web connection from ('192.168.1.XXX', 63756) 2015-10-02 21:33:06 Web request: GET /api?{} 2015-10-02 21:33:07 RX < 511 - Keypad Led Flash State - Partition 1 2015-10-02 21:33:07 Did a callback! 2015-10-02 21:33:07 RX < 849 - Verbose Trouble Status 2015-10-02 21:33:07 Did a callback! 2015-10-02 21:33:07 RX < 510 - Keypad Led State - Partition 1 2015-10-02 21:33:07 Did a callback! 2015-10-02 21:33:07 RX < 511 - Keypad Led Flash State - Partition 1 2015-10-02 21:33:07 Did a callback! error: uncaptured python exception, closing channel <__main__.EnvisalinkClient connected 192.168.1.XXX:4025 at 0xf6a5e6cc> (<type 'exceptions.ValueError'>:invalid literal for int() with base 10: 'TTP' [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7 /asyncore.py|handle_read_event|449] [/usr/lib/python2.7/asynchat.py|handle_read|165] [alarmserver.py|found_terminator|250] [alarmserver.py|handle_line|282]) 2015-10-01 17:17:00 Disconnected from 192.168.1.XXX:4025 2015-10-01 17:17:00 Connection failed, retrying in 10 seconds

XXX’s are intentionally placed. And the Trouble alarm is due to me having it disconnected from the phone line as I test it and avoid having the alarm call the monitoring company in case i messed something up.
I really have no idea what Im doing in regards to adding the RESTAPI command URLs into the alarmserver.cfg. I think i am using ethomasii’s build https://github.com/ethomasii/alarmserver-smartthings if that matters, as i was hoping to be able to Arm and Disarm via the Smartthings App.

Any help anyone can give in regards to how my alarmserver.cfg should be structured or what the reason for the error above is would be apprectiated!

Almost forgot, im running Alarmserver on my synology, using an envisalink 3, Smartthings v2 hub with a DSC Panel.
Thanks!

1 Like

@CarlosS

I wanted to have the alarm itself trigger things, for those in the family (kids) that will just disarm the alarm system when coming into the house…this would trigger lights to turn on etc.

I have not figured out how to make the alarm trigger phrases yet, but I was able to get the alarm system triggering events…

For example, when I open the door, the DSC goes into “Entry Delay” which immediately turns on some lights in the hall. As soon as the correct code is entered the mode is changed to “Home - Disarmed” which runs other automations such as turning on the SONOS etc.

I had to modify the AlarmServer code a little to pass the details for the 652 codes (Away,Stay,etc) but it seems to be working now.

I would like this to automatically set the new Smarthings Home Monitoring status, but have not figured that out yet either.

With regard to the buttons what goes in the -> “$ip:$port”, the envislink information?

I’m not sure where the buttons get the status information from?

Thanks for the help.

The ip is the address of your server and the port should be 8111 if you haven’t changed it to something else.

Thanks Jay, I’ll give it a shot.

Thanks Jeremy. I take it this will only work for DSC panels, not VISTA?

James–what did you end up doing? I’m in the same situation and after reading your post, I’m leaning towards spending a little more money on a DSC, while knowing I’ll probably need to spend another $160 (+the $100 DSC panel) on zone expanders to cover my 30+ hardwired sensors.

Although, question for the community–do the # of unique sensor slots available in Vista Panels even matter when being translated to the ST interface? i.e. does it just partition or group sensors down to 8 zones or something after going through the server, or if I have 30 wired sensors, will I really be able to name/see all of those in my ST App?

Thanks in advance.

I haven’t pulled the trigger yet, but in the end I’m probably going a route I wouldn’t recommend to anyone – unless they enjoy code :slight_smile: I’ll likely move to a new Vista IP model. In addition to my 30+ sensors, I currently have a bunch of relays, a wireless zone, key fobs, 2 entry panels, Honeywell smoke alarms, etc. So a move to a new platform would get a little involving.

But really, more than that I got sucked into seeing how SmartThings development works. I have a spare BeagleBone Black (Raspberry Pi like thing) that has a ton of GPIO pins which can monitor the zones. I did a simple test (in NodeJS) using a single zone and a couple resistors, monitoring the state. It worked very well, so I figured I’ll just make a little resistor board, connect to the zones directly and monitor the results (just like Alarm Server) integrating with SmartThings. So that’s my “plan” as it sits.

If I wasn’t into programming and wanted SmartThings integration (or just a better system :wink: ), I’d definitely look to DSC though.

I just like messing with projects like this, which is why my wife bought it for me. I was already planning to integrate our Vantage lighting system and Roomie (now Simple Control) setup. So it’s just another thing on the list.

1 Like

Yeah that is probably more than I have time for … This is just one of many ST’s integrations I’m in the middle of… :wink:

Thanks for the advice. It re-affirms my leaning towards DSC.

I was able to get this all working with a DSC panel, Envisalink3, and a RaspberryPi. I’m just fine tuning the RaspberryPi now to start the alarmserver on boot. I’m monitoring it to see if it’s crashing, if it does, I’ll set it to automatically restart or just reboot it on a set frequency.
If you have issues with any part of this I am happy to answer questions.
aflynnhpg