PLUGIN: Honeywell Total Connect Comfort Thermostats

Hi,
I’m new to the forum. I’ve decided to start switching from wink to vera. First reason being I don’t want my door locks or cameras controlled in the cloud. The second reason, wink is bankrupt and I don’t want to invest any time or effort if they aren’t going to be around. Having said that, I’ve been trying to install the Honeywell wifi app in veraedge running the latest firmware and have had a heck of a time. A few observations…

If my vera is associated to a cloud account the app will not install at all
After lots of trial and error, I was able to get it installed after a full wipe and going to the vera web page directly before associating it with a vera cloud account

Now the only problem is that after going to the device in TCCSetup and enter my TCC credentials, it does not find my thermostat. I get the following error atop of the screen:

HNYWL TCC: : Honeywell TCC Authorization passed, but no devices were found.

I’ve actually logged in and the thermostat is there and both the Honeywell and wink apps work. It apparently is not refreshing or maybe it is and isn’t parsing the data correctly. Not sure…

Last Refreshed:
Refresh Status:

Last Authorization Attempt: Tue, Dec 15, 06:03:37 AM
Authorization Status: Successful

any help would be greatly appreciate :slight_smile:

I grabbed the file and tried it - no change from starting with a non-working system. No harm done :wink:

OK, thanks for the update… I’ll post another file once I can isolate what’s choking the debug messages. I suspect it’s probably a luup.log that is trying to call a function whereby he loops numerous times and outputs data. A good example is the parsing and storing of the cookie. I was doing this using just Lua and the output was BIG… I’ll probably have to go back through all of them again and set them to something like 1 (minimal) to 3 (exhaustive). All in hopes of avoiding loop calls and simply displaying the result.

@lingerba

I corrected the error that’s been hovering over us for a long while (“Honeywell TCC Authorization passed, but no devices were found.”. The URL needed a bit tweaking, also this code puts out a lot of debug messages. It’s these very debug messages that helped. I had to create 3 levels for now (only use level 1 which is default; 0 disables). still a bit messy and I have like 3-4 more functions to clean house on. As you can see, if your using ‘Info Viewer’, basically set you pattern to “>> HYWL:”. This will show you everything that’s going on. If you could load and keep an eye on the refresh, I’ll leave mine running tonight and hopefully we can catch the ‘Authorization Issue’. Eventually we’ll get to a point where I can help cohibafan.

Please don’t distribute this file and by all means, create a backup of the original L_HoneywellTCC.lua file …
Edit : ANY function that get’s called will output a debug message under level [1].

Before

50      12/15/15 19:57:45.628   luup_log:245: >> HYWL: 'locNumber [{removed by Cuda}]'. <0x2c324680>
50      12/15/15 19:57:45.629   luup_log:245: >> HYWL: Executing 'createCookieStringFromTable' function | Line 417 << <0x2c324680>
{removed by Cuda; my cookie}
50      12/15/15 19:57:46.072   luup_log:245: >> HYWL: 'Analyzing Device Status [500]'. <0x2c324680>
50      12/15/15 19:57:46.073   luup_log:245: >> HYWL: 'resultCode [3]'. <0x2c324680>
50      12/15/15 19:57:46.073   luup_log:245: >> HYWL: 'resultText [Issue with processing getDevicesInLocation.  (Issue already logged)]'. <0x2c324680>
50      12/15/15 19:57:46.074   luup_log:245: >> HYWL: Executing 'task' function | Line 134 << <0x2c324680>
50      12/15/15 19:57:46.075   luup_log:245: >> HYWL: 'authResult' from 'locResult': 3 <0x2c324680>
50      12/15/15 19:57:46.076   luup_log:245: >> HYWL: 'authText' from 'locText': Issue with processing getDevicesInLocation.  (Issue already logged)

After

50 12/15/15 20:21:29.728 luup_log:245: >> HYWL: Executing 'getDevicesInLocation' function | Line 907 << <0x2cb16680> 50 12/15/15 20:21:29.729 luup_log:245: >> HYWL: 'locNumber [{removed by Cuda}]'. <0x2cb16680> 50 12/15/15 20:21:29.730 luup_log:245: >> HYWL: Executing 'createCookieStringFromTable' function | Line 417 << <0x2cb16680> {removed by Cuda; my cookie} 50 12/15/15 20:21:30.205 luup_log:245: >> HYWL: 'Analyzing Device Status [200]'. <0x2cb16680> 50 12/15/15 20:21:30.206 luup_log:245: >> HYWL: 'Analyzing Device Status [200]'. <0x2cb166

I tried just installing the updated LUA file. Nothing changed. What I mean by this is as far as I could tell, the old version of the app was still being shown (which didn’t have the issue of not finding devices). So I uninstalled the entire app, then I installed it fresh from the app store. Then I updated the app with your updated LUA file. The error message is now gone. However, the main parent app is not finding the actual thermostats (and thus, not auto-creating the thermostat devices in Vera). It shows that my login was successful, but it is not finding the thermostats. So basically the error still exists, it just doesn’t show the error message.

OK, so we’re running different versions of Joey’s code. That makes sense now and it gives me a couple of ideas.
I hope you were able to restore your setup back to the way it was before my file.

I can restore, but I have not done so yet (because I don’t want to have to do it all over again). I am okay with not having this functionality for a little while during testing. :slight_smile:

Question:
How does one uninstall the manually installed app, or should one simply delete the devices and then install over the top of the files (as occurs automatically)?
I’m happy to test on UI7 (VeraEdge).

OK, good - thanks for the quick reply and test…

I’m hoping no one has to un-install, rather just update their Lua file. No need to test just yet, let me work through all the little details of why. Once we have it stable, I’ll see about trying to help you get your stat working.

[quote=“cohibafan, post:308, topic:185402”]Question:
How does one uninstall the manually installed app, or should one simply delete the devices and then install over the top of the files (as occurs automatically)?
I’m happy to test on UI7 (VeraEdge).[/quote]

Man, I really appreciate you working on this. I’ll jump on board for testing and monitoring. I currently have a Veralite running UI7 and two Honeywell thermostats. I’ll replace the lua file with your current one and let you know.

The error about successful logins went away but I’m still getting an error on refresh: “Unsuccessful. Error code: nil”. I’ll step through and see what I can find.

I actually have a different file if you really want to test. The code is very sensitive to changes so I’m going about this a little different. Are you running version 1.2 or the rc 1.0 ?

Absolutely. Where can I get it? I’m new to Luup, but do have some programming experience. I’m still trying to grasp the parsing cookies thing.

When I initially loaded your file, I got the refresh nil error; therefore I believe the status from the getStatus function wasn’t 200 or 401. After putting in a log to see, it’s been refreshing successfully with a 200. Figures, lol.

Sorry, running 1.2.

I think my issue (last night) was I modified a parameter (refresh every 1800s from 300s) when I should have left well enough alone. It may have been a coincidence but my system didn’t refresh from that point on (all night). This morning I simply changed the value within the plugin back to 300s (used within init and autoRefresh functions), reloaded the engine and voila, everything is working and updating as it should be.

The whole cookie thing is nuts ! I’m used to Oauth2 and I’ve never dealt with cookies (glad he was able to work through that part). My log messages show just how crazy it is as it collects it and parses. I corrected the ‘500’ status by altering the URL within the function getDevicesInLocation.’

So is your system refreshing every 300s ? If so then run with that file as it has all the debug data available to you. I’m just slowly introducing changes that I know work rather than blast through his code correcting minor mistakes. I want to know exactly what function is causing the Authentication error (nil ?!?).

Cookie: LocalisationCultureCookie=en-US; EccMyTcc=Rnnnnnnnnn; ASP.NET_SessionId=(removed); ADRUM_BT=R(removed); TrueHomeCheckCookie=; checkCookie=checkValue; .ASPXAUTH_TH_A=(removed); thlang=en-US

[quote=“jlind, post:314, topic:185402”]Absolutely. Where can I get it? I’m new to Luup, but do have some programming experience. I’m still trying to grasp the parsing cookies thing.

When I initially loaded your file, I got the refresh nil error; therefore I believe the status from the getStatus function wasn’t 200 or 401. After putting in a log to see, it’s been refreshing successfully with a 200. Figures, lol.[/quote]

I updated it to refresh at that rate (5min) so I could check it more often. Not getting the Authentication error anymore. It seems almost like it has to do with the cookie expiring because it’s sporadic.

Perhaps, the cookie expiration (from memory) was something like 2 days - the logs should provide approximation…

ok, mine failed but I cannot see logs from here. Looks like it …

[1] Calls ‘refreshStatus’
[2] ‘refreshStatus’ then calls ‘getStatus(tcc_ID)’
[3] ‘getStatus(TCC_DEVICE_ID)’ then prepares to call Honeywell but first has to call ‘createCookieStringFromTable(tblLoginCookie)’
[4] ‘getStatus’ ultimately returns statResult, if this isn’t a 1 then it’s supposed to refresh the login cookie; retrieveLoginCookie(username,password)

Going to put some more detail to the logs for greater visibility…

OK, so mine had the same issue with failing authentication but I didn’t catch the log. Everything else seems to work fine. It works for an amount of time, then fails and doesn’t reattempt.