Page 1 of 1

Honeywell Total Connect (Windows Phone)

Posted: Fri Jan 09, 2015 10:36 am
by atom0s
A while back I made a proof of concept application for both Windows and Windows Phone 7 to communicate with Honeywell's alarm system service as they do not offer any option for the Windows Phone 7+ platform. (Mind you this was when I had a WP7 phone. I have an Android now.) So I set out to make the Android version of the app for Windows Phone 7.

Before I begin: The information in this post is for educational purposes only. I do not hold responsibility for what you do with this information or source code. Use at your own risk.

Obtaining The APK Locally
The link to the APK on the play store can be found here: ... armnet.tc2
We can see that the file name is ‘com.alarmnet.tc2′, Just add .apk to the name and Google. You will find a dozen sites with the APK. You can also root your phone to gain access etc. but I will not cover that here.

Decompilg The APK
Now that we have the APK we need to decompile it. You can use the following tools to accomplish this:
- dex2jar:

With this tool, you can easily convert the .dex file inside the .apk file (it is just a .zip file!) back to a usable jar file.
Simply drag and drop the .dex file onto ‘d2j-dex2jar.bat’ and you’re done.

Next to decompile the Jar to readable source code I used:
- Jd-Gui:

Again simply open the .jar now with this tool and you will see the decompiled source.

Understanding The Source
While I do recommend looking through the entire thing to get accustom to their setup, I will point out what is important.
- com\alarmnet\tc2\rcmobile\
- com\alarmnet\tc2\rcmobile\

Both of these files contain the service call data and connection flow that we will need to follow in our application. I really recommend studying these because their method of handling the connection is fairly convoluted in my opinion.

Making The Connection (Service Call Flow)
Now that we have the source, we can analyze the setup of the service calls and how they are handled. For one, we see the main service object can be found here:

Code: Select all
They were nice enough to use a Windows service so this makes things a bit easier while working with it at least. :)

To make a login request, we have a two step process:
- AuthenticateUserLogin : Which does what it sounds like, it auths our login information.
- GetSessionDetails : Obtains information about our session. (ie. Session Id, Module Flags, Security Locations, User Info)

To even login, we are required to give the service some information:
- Our Application Id
- Our Application Version

Given that the Windows phone does not have an appId/version for this, we use the Android one to fake the call. In the case of the code I wrote, the version info was:
- Application Id: 34857971
- Application Version: 2.2.0

The next step is to keep the session activated and alive. After we login, the app creates a thread to keep pinging the service. Inside that thread, the app was calling KeepAlive and GetPanelMetaDataAndFullStatusByDeviceID.

Thankfully, we are given the nice usage of async callbacks for everything when we reference their service. So we can make a fairly decent setup that can be UI friendly.

Arming Our Security System (And Disarming..)
Next was seeing how we arm and disarm the system. Here I found that the call was made to ArmSecuritySystem. This handled both arming for away and stay modes. This takes a number of params which I am not 100% sure if the user id param was required or not. I would recommend not sending it at all if you do not have to. My examples sent it just to be safe when I was testing this setup.

Following suit, to disarm the system we have a similar call: DisarmSecuritySystem

Status Information And The Like
Finally, with the information obtained status codes and bitmasks were all that was left to obtain the information data. When querying for the panel status in the keep alive, we can get a number of results that mean different things (based on different security systems):
  • 10200 – Disarmed
  • 10211 – Disarmed (bypass)
  • 10201 – Armed Away
  • 10202 – Armed Away (bypass)
  • 10205 – Armed Away (instant)
  • 10206 – Armed Away (instant-bypass)
  • 10203 – Armed Stay
  • 10204 – Armed Stay (bypass)
  • 10209 – Armed Stay (instant)
  • 10210 – Armed Stay (instant-bypass)
  • 10307 – Arming
  • 10308 – Disarming
When we arm or disarm the system, we can get a specific result return of:
  • 4500
When this occurs the system wants us to force-request the current panels last command state. When we do this, that service call can have the following returns:
  • 0 – Success
  • -4502 – Invalid pin. (Yes, that is a negative result.)
  • 4501 – Repoll Required (Command is currently scheduled.)
Also when we call the GetPanelMetaDataAndFullStatusByDeviceID method, we are given the current panels zone data. These zones can have a series of flags in their status mask. The status codes are as follow for the zones:
  • 0 – Normal
  • 1 – Bypassed
  • 2 – Faulted
  • 8 – Trouble
  • 16 – Tampered
  • 32 – Supervision Failed
Putting It All Together
When I first started working on this I made a simple test application which can be seen here:

After getting the test app to work fairly well, I moved to working on the demo phone app I created. Which can be seen here:
Image Image

Getting it to work simply for myself was great. I was happy to get it in a somewhat working manner. However, I am by no means a Windows Phone developer. This was my first solo app project for the WP7 platform and I can honestly say my last. I am not a fan of Windows Phones at all and I have since gotten rid of mine and moved to Android.

About The Source Code
The source code is in a beta “working” state. Meaning, things are thrown together just to get it to work and test things out kind of state. I did not take the time to fully cleanup the code, it may [read: does] still have errors and problems. I cannot guarantee it will work for everyone and such. The following sources will be of my original test application (proof of concept) and the phone app.

I do wish that people at least honor me by giving me credits if you use this source code. I also do request that you do not sell your app, if you make one, for money. Honeywell offers this service free of charge on all other platforms, there is no reason to nickle and dime people for a simple feature-set like this.

Windows Proof of Concept Client:
Windows Phone 7 Proof of Concept App:

Re: Honeywell Total Connect (Windows Phone)

Posted: Wed Jun 14, 2017 7:05 pm
by transformers
Did you look into the possible arming types accepted by ArmSecuritySystem in the TC2 API? It doesn't really say what int values are accepted and what each would mean.

ArmType 0 seems to be for Away mode, ArmType 1 for Stay mode, but I can't seem to figure out which ArmType is for Stay (instant). I see that you figured out the status code that is returned from an Armed Stay (instant) mode.

What I'm trying to do is modify the code on this SmartThings SmartApp so that it also allows one to arm in Stay (instant) mode. ... em/21248/7

By the way I didn't write the app. I'm trying to make it for for my use case.

Thanks in advance.

Re: Honeywell Total Connect (Windows Phone)

Posted: Wed Jun 14, 2017 10:52 pm
by atom0s
I landed up ditching this project soon after I posted the sources I did. I now have an Android phone after all the roadblocks Microsoft kept putting on their system within WIndows Phone 7 and 8 which just really deterred me from wanting to keep the phone any longer. So I never really looked more into this since Android has a fully supported app from Honeywell already. In terms of what I found most of the info is within the Android app that can be decompiled fairly easily using normal APK tools. All of the API callbacks and info I used I got from that.

Re: Honeywell Total Connect (Windows Phone)

Posted: Thu Jun 15, 2017 6:45 am
by transformers
I took a guess and used ArmType = 2 and it did put the system into Stay Instant mode. I didn't think it would be that easy.

Anyway, your work was really useful because I got the list of alarm states. I came across your site from doing several Google searches for this info. There aren't many people that posted this kind of stuff on the web.

I do use the Honeywell app on my Android phone from time to time. But with a SmartThings hub I have a home automation system which via the totalconnect API I can have it arm and disarm the system based on my phone's presence. There's a whole online community that create little apps like this.

Anyway, there were other people on the smartthings community looking for the Stay Instant mode code so hopefully they will find this info as useful. It may not be a really big deal to most but to me it was one of those "standing on the shoulders of giants" type of moments when I was able to use your work to figure this out. Your site is full of interesting projects. Thanks again for sharing and also taking the time to reply to my post.

Re: Honeywell Total Connect (Windows Phone)

Posted: Thu Jun 15, 2017 10:24 am
by atom0s
Not a problem, glad to hear you found what you needed. :)