Skip to content

Instantly share code, notes, and snippets.

@QCCowboy
Last active January 23, 2017 01:06
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save QCCowboy/df3689f4c85f909cb819 to your computer and use it in GitHub Desktop.
Save QCCowboy/df3689f4c85f909cb819 to your computer and use it in GitHub Desktop.
TC Contact Sensor Smart Things Read Me
How to install the Total Connect Contact Zone.
There are several steps to be able to install this, however once complete you will be able to load a contact zone that is connected to total connect into Smart Things to be able to install it as a contact device.
Step 1 – Understand which zones will correspond to the appropriate row with the Web call to Total Connect.
1. Create a new Device Handler that will get you the information you need from Total Connect (name it something you will remember)
2. Copy the code from here: https://gist.github.com/QCCowboy/b71b90bbd02238069161
3. After the device handler is created, you will need to add a new device and supply the following information:
a. Name (call it whatever you want, but I’d recommend something like TC Contact Tester)
b. Device network ID (again give this a unique name like TC_Conact_Tester)
c. Select the type of device equal to the device handler name you created in step 1.
d. Publish it and assign it to the appropriate location
4. After you have created the device, you will need to edit the settings (similar to what you did with the TC Alarm interface).
a. Go to the device and edit the preferences (you can also do this from within the device).
b. Enter your application ID
c. Enter your application version
d. Enter your device ID
e. Enter your location ID
f. Enter your Total Connect user name
g. Enter the password for the Total Connect user name
h. Enter a Row to start with (always start with 0 here)
i. Enter a Row to end with (I’d recommend starting with 5)
NOTE: keep the row start and row end limited to 5 values (0-5, 5-10, etc.) if you do not the information returned in the
logger gets a little unreliable.
j. Click on Done
5. You will now need to view the LiveLogging in SmartThings in order to view the results. You will see information that returns
something like this:
zoneID: 2 -- Row: [0]
zone: 2 -- Basement Side Left Window
6. Remember this information as you will be using it when creating the actual device. This means that for Zone 2 (which is
defined as the Basement Side Left Window) you will use Row 0
7. I’d recommend running this once, creating a new Device and if you have more than 5 zones, coming back and adjusting the
start and end to view the results (i.e. go to Row start 5 and Row end 10)
Step 2 – Create your new contact sensor device
1. Create a new Device Handler that will get you be your device handler for all Total Connect Contact Sensors (name it something
like TC Contact Sensor)
2. Copy the code from here: https://gist.github.com/QCCowboy/7b225053ac9fcc3e13c9
3. After the device handler is created, you will need to add a new device and supply the following information:
a. Name (call it whatever you want, but I’d recommend the same description you used in Total Connect )
b. Device network ID (again give this a unique name like TC_Conact_x) – in my case I made the last digit (x) the ID the same as
the row returned.
c. Select the type of device equal to the device handler name you created in step 1 (TC Contact Sensor).
d. Publish it and assign it to the appropriate location
4. After you have created the device, you will need to edit the settings (similar to what you did with the TC Alarm interface).
a. Go to the device and edit the preferences (you can also do this from within the device).
b. Enter your application ID
c. Enter your application version
d. Enter your device ID
e. Enter your location ID
f. Enter your Total Connect user name
g. Enter the password for the Total Connect user name
h. Enter the Row number you will be using (in the case above it is Row 0) - note this is not the zone ID, but the row number.
i. Click on Done
5. You should now have a contact sensor that shows up in your Smart Things and can even be added to your alarm.
6. Repeat as necessary.
NOTE: Zones do not automatically refresh. To do this I used Pollster and made them refresh every x minutes. Pollster and it’s
instructions can be found here: https://github.com/statusbits/smartthings/blob/master/Pollster.md
NOTE: I’ve noticed that in the Smart Things alarm, it either recognizes zones as open or closed. I have all of the different status types in here and therefore a faulted alarm might not trigger the smart things alarm as well, but hey that is why you have an alarm system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment