Starting a new thread for the DSC alarm stuff in particular anything related to the current DSC Smartapp and the AlarmServer software that runs it behind the scenes.
Current status is: Full support for zone and partition status(s) Current setup difficulty: medium to difficult depending on your knowledge of Python and computers
Required components:
DSC or Ademco/Vista alarm panel
Envisalink 2 or 3 connected to your panel
A server or computer to run the Python code on 24/7
Some technical skills
Smartthings IDE/Developer account (free to anyone)
Upcoming features include:
Automatic creation of zones and partition devices.
Easier setup (where possible)
Arm/Disarm panel
Code and documentation locations:
Smartthings App and custom Device types (along with setup info) can be found here
Many, MANY thanks to everyone who helped get all this going and have contributed patches, bug testing and new features! If you like reading you can visit the now very long original thread that started all this which is linked below.
Thanks and please post your questions/problems/successes/failures here!
@sanity So i am new to ST but i am pretty quick on uptake of most computer stuff. First, thanks for your work on this and thanks to anyone else who contributed. I have a few questions that maybe you can answer. I have a ADT (Vista 20p) I own and I already dispatched them and took control of the system. I have Envisalink up and running (full reports, arm/disarm, etc.) through there server. My next step it to try the ST integration you worked on. So here are my questions to understand this better:
Can you explain the need for the computer? Is this taking the place of Envisalink servers or is it piggy backing on them.
Do you think this will be come a ST integration? It seem complex which is an issue i would think. How long till integration if you think it will happen?
Is there a step by step to set up the to this? I did the Nest integration and seem to working well but this seem more complicated.
The Envisalink doesnât have a way to directly send events to ST so the computer is used to run an application that talks to the Envisalink TPI interface and then send them along to ST.
I doubt it. Itâs too complex/error prone right now and there are only a few ways we can make it less so.
Trying this out tonight. Thanks to all who have contributed.
One suggestion (so far) on the kholloway/smartthings-dsc-alarm github instructions. Those of us on CentOS would use âpip-python install requestsâ instead of âpip install requests.â
Following the instructions as written on the smartthings-dsc-alarm github README, running alarmserver.py just gives me:
[root@mugello AlarmServer]# ./alarmserver.py
File "./alarmserver.py", line 73
class AlarmServerConfig():
^
SyntaxError: invalid syntax
Thereâs no mention in the instructions how to reference the config file when running alarmserver.py
Renaming alarmserver-example.cfg to alarmserver.cfg (which was my guess of what the default config file should be) didnât do anything to change the result.
Also, Iâm not a programmer⌠but Iâm comfortable editing config files and scripts. But where I really shine is documentation and how-tos, so once I get this figured out, Iâll be happy to write ân00b friendlyâ instructions to getting this working.
@SteveJenkins copy the example config file to alarmserver.cfg and modify it as needed. You need to also generate a SSL cert per the instructions on the AlarmServer page. You donât need to run the AlarmServer.py as root also just FYI. Itâs probably better to just run it as a normal user with no privileges. Iâm not sure why you would get that error on line 73 though⌠Try starting it with the command line below and see what happens.
python alarmserver.py
The AlarmServer project assumes a working knowledge of Python and Python modules which many people unfamiliar with Python would not have. The docs could certainly be cleaned up and simplified.
@SteveJenkins I use RedHat distros all the time and have never seen that pip-python thing, good to know! If pip isnât available I usually just type âeasy_install pipâ to get it installed then âpip install whatever moduleâ.
Still same issues. The AlarmServer files came with default key and crt files, but I went ahead and generated a new set myself (generating keys is not new to me⌠Iâm the packager for OpenDKIM for Fedora/EPEL).
But still getting the same errors, whether or not I run it direct from the command line or with the python command.
Anything else I should be checking? Does Python version matter (running 2.4.3)?
To reply to my own question, I think Python version does matter. I just installed Python 2.6 and tried it with that:
/usr/bin/python26 alarmserver.py
Traceback (most recent call last):
File âalarmserver.pyâ, line 19, in
import requests
ImportError: No module named requests
Now it seems to be complaining that I donât have the requests module handy. Still hackingâŚ
Did easy_install requests ⌠hoping it would be as simple as that. Nope.
# easy_install requests
Searching for requests
Reading http://cheeseshop.python.org/pypi/requests/
Reading http://python-requests.org
Reading http://cheeseshop.python.org/pypi/requests/2.3.0
Best match: requests 2.3.0
Downloading https://pypi.python.org/packages/source/r/requests/requests-2.3.0.tar.gz#md5=7449ffdc8ec9ac37bbcd286003c80f00
Processing requests-2.3.0.tar.gz
Running requests-2.3.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LOWH_z/requests-2.3.0/egg-dist-tmp-nG10gO
Traceback (most recent call last):
File "/usr/bin/easy_install", line 7, in ?
sys.exit(
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1670, in main
with_ei_usage(lambda:
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1659, in with_ei_usage
return f()
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1674, in
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 211, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 446, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 471, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 655, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 930, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 919, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.4/site-packages/setuptools/sandbox.py", line 26, in run_setup
DirectorySandbox(setup_dir).run(
File "/usr/lib/python2.4/site-packages/setuptools/sandbox.py", line 63, in run
return func()
File "/usr/lib/python2.4/site-packages/setuptools/sandbox.py", line 29, in
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 30
with open('README.rst') as f:
^
SyntaxError: invalid syntax
@SteveJenkins so yes Python version matters, you likely need 2.6 or higher to run the AlarmServer program. Also you are running âeasy_installâ but that will install the module into your default 2.4 python version. See if you have a âeasy_install2.6â instead, same with pip if you are using that. The default pip will be tied to the system 2.4 Python, see if you have a pip2.6 instead.
Also edit the alarmserver.py file and change the first line to look like below (or change further to match your exact python executable).
#!/usr/bin/env python26
Once you do that you can then run it again with the ./alarmserver.py syntax.
@sanity Back in n00b mode, but this will all be helpful for docs.
Your github instructions say:
âIn the Web IDE for Smartthings create a new device type for each of the above devices and paste in the code for each device from the corresponding groovy files in the repo.â
But if I go to https://graph.api.smartthings.com/ide/device/create, thereâs nowhere to paste in anything. I first clicked the two capabilities that I saw in your code (Polling and Refresh) and then the Create button.
I now realize I could have just hit the Create button and pasted everything, but since this is my first custom device type creation, you get the benefit of a completely fresh set of eyes.
@SteveJenkins excellent feedback, Smartthings has changed the device create screen a few times since I wrote that doc, now itâs all self contained which is much nicer. Glad to see you got the Python part of it working with AlarmServer, hopefully the rest is easy!
Thanks to everyone who has worked on this. I tried to get this running last week, but gave up pretty quickly, so I look forward to the detailed writeup. My suggestion - if possible - would be to write it for someone with ZERO programming experience - starting with where to download Python and how to make the code run 24/7. I think I at least did that part correctly, but wasnât 100% sure I wasnât on some fake site that was really going to install a virus. Thanks.
@jimmythemoose Getting Python setup for your OS can be difficult but itâs very OS specific. https://www.python.org has all the software you should need to get a base Python install going (look in the download tab).
Many OSâs (OS X, Linux, many Unix distros) already include a working python but some of them have a Python that is too old. I will go over the docs again and see if I canât clean them up a bit but I canât include directions for every OS. I run Mac OS X and 2 flavors of Linux (Ubuntu and RedHat) so I can include directions for those.
@sanity Of course - youâre never going to be able to support EVERY host OS.
I run CentOS 6 boxes mainly in production, but I have an OLD CentOS 5 box in the basement of the house that Iâve used to run a few home automation scripts, so thatâs why I was so gung-ho to get it working there. And because stuff starts breaking on CentOS 5 if you start messing with the packaged Python, I had to be careful.
Anyway⌠Iâm REALLY close to getting it working⌠I can feel it. But Iâm gonna get fresh eyes on it tomorrow, and maybe go through all the steps again. I can see the finish line. Thanks for your excellent help!