Alright, thanks to @Oendaril and his implementation of Async API calls, I was able to modify the original code that I had written. I have been using it for 2 days and it is working well. Though I’ll appreciate any one that wants to use it and let me know if it works or not.
NOTE: There are many awesome implementations for TotalConnect Alarm by folks in this thread which you should consider if you want full control. I’ll try to do justice to them (but I may fail) by listing what they do.
List of Apps/DeviceHandlers for TotalConnect
You only need one of this installed. Please dont install all apps/device handlers together. We really need the 1st post to echo these below, but unfortunately its too old for me to edit, so here we go:
1. SmartApp based on modes/Smart Home Monitor Status
Mode based Code: https://github.com/mhatrey/TotalConnect/blob/master/ModesBased.groovy | Author: @mhatrey
I wrote this SmartApp for simple automation based modes/routines of SmartThings. This is a very minimalistic app and I prefer not to dwindle much besides this, but there’s lot more you can do using rest of the apps/device handlers written by folks in this thread. Functionality of the app -
- SmartThings away mode = Arm Away
- SmartThings night mode = Arm Stay
- SmartThings I’m back, Good Morning mode = Disarm
With this latest version, I have implemented a way of automatically pulling LocationID & DeviceID, so all you need to enter are your user credentials.
Per request from @berg03191, I have added a SmartApp based on Smart Home Monitor Status
SHM based Code: https://github.com/mhatrey/TotalConnect/blob/master/SHMBased.groovy | Author: @mhatrey
2. DeviceHandler that act as Panel as well as Virtualized Lock/Switch
This device handler is written to as a SmartThings Device i.e. a virtualized Lock & Light and performs arming actions based on Lock ON/OFF & Switch ON/OFF. Notably
- Switch On = Armed Stay
- Lock On = Armed Away
- Switch/Lock Off = Disarm
Be sure to select “Device Type” by pointing to the Device Handler (Scroll to the bottom, you will TotalConnect Device) created before. Give it a name of your choice and device ID (Anything unique, thats not matching your existing devices)
Once the device is created you will have to edit and fill in preferences that contain your login credentials for TotalConnect.
To find LocationID & DeviceID @Oendaril has written a crafty SmartApp that you can run in the simulator to fetch that. Install the following code as a SmartApp and get that - https://github.com/Oendaril/TotalConnectAsync/blob/master/TCTesterAsync.groovy
3. Complete TotalConnect Panel
Code: Go to SmartApps > Click Settings (Top Right) > Add a Repository with the following information
- Owner: jhstroebel
- Name: SmartThings-TCv2
- Branch: master
This app is a different beast in all together and gives you lot of flexibility. I have not installed this app, so I have no experience using it.
Hope this was helpful. Cheers!
By the way, @Oendaril, @jhstroebel, if you have a moment, check my code at the following line - https://github.com/mhatrey/TotalConnect/blob/master/ModesBased.groovy#L77. I wrote this to pull Location information for users that have multiple Alarms. I’m not particularly happy about implementing a pause and a while loop, but if you can a) use the following/similar logic in your code to completely automate this for your app users and b) help me write a better logic in implementing this, it would be appreciated. Thanks!