PLUGIN: Honeywell Total Connect Comfort Thermostats

Attached is Mikee’s fix for cookies ! Also contains some debug messages to track the HTTP status and cookie status (minimal log traffic).

The device id is parsed as a series of digits. I don’t see anything (obvious) that would limit it. However, if there are non digits in the longer ID this will be a problem (as well as in any device ID).

[quote=“CudaNet, post:341, topic:185402”]Attached is Mikee’s fix for cookies ! Also contains some debug messages to track the HTTP status and cookie status (minimal log traffic).

I uninstalled the app from my system. Reinstalled the app version from the app store. Then I uploaded the LUA file you attached. After that is when I entered my username/password. It logged in successfully, however when I clicked the refresh button, it is still not finding any thermostats. I restarted the luup engine and still nothing.

I may need to load this on one of my openLuup test systems so I can unit test without causing issues with the stats I use.

[quote=“lingerba, post:343, topic:185402”][quote=“CudaNet, post:341, topic:185402”]Attached is Mikee’s fix for cookies ! Also contains some debug messages to track the HTTP status and cookie status (minimal log traffic).

I uninstalled the app from my system. Reinstalled the app version from the app store. Then I uploaded the LUA file you attached. After that is when I entered my username/password. It logged in successfully, however when I clicked the refresh button, it is still not finding any thermostats. I restarted the luup engine and still nothing.[/quote]

I’m pretty sure cohibafan’s ID was entirely numeric but it really should be adapted to these cases in the unlikely event alphanumeric is received one day.

I have not yet sent CudaNet the changes for auto setup. Let me clean them up and I’ll post.

Correct - currently entirely 7 digits.

I’m back and able to test again. I can usually only work on this during the week. Feel free to post your version of the code and I’ll test with my two thermostats.

Just installed the Honeywell app. After entering my credentials in the TCC Setup and clicking Login, I receive,

“Unsuccessful. Error code 200”
“HNYWL TCC: : Honeywell thermostat user authentication failed. Check TCC Setup”

The credentials do work when I access Honeywell TCC on the website. I have deleted the app and reinstalled. Any suggestions???

Thanks…

Lindsey,

Can you tell us a little more about your setup. Model of thermostat, version of code installed (1.2 or the 1.0 release candidate). Mikee has done some refactoring of the code but I’m afraid this is the first I’ve heard of this type of problem. So I hate to put you through remedial questions but sometimes it’s the most minor details that help us determine a solution.

Thanks

[quote=“Lindsey, post:349, topic:185402”]Just installed the Honeywell app. After entering my credentials in the TCC Setup and clicking Login, I receive,

“Unsuccessful. Error code 200”
“HNYWL TCC: : Honeywell thermostat user authentication failed. Check TCC Setup”

The credentials do work when I access Honeywell TCC on the website. I have deleted the app and reinstalled. Any suggestions???

Thanks…[/quote]

Mikee, I’m here to help. Feel free to release or if you’d prefer, I’m more than willing to adjust the code with your changes. Either way, all of us here appreciate you taking the time to do all of this for the group. Especially during the holidays when time is limited !

I have gone thru the plugin and reworked a number of things. I have run on my two thermos as well as done some unit tests with 7 digit device IDs. I also lowered the reauth interval to 60 minutes (the min) and verified it reauthenticates so should stay connected without periodic failures. I am including 3 modified files, the lua implementation, the json UI file (changed table layout ) and xml implementation file.

I can only do minimal testing myself since I have a heat only system connected to the wifis.

Install:

Install the official app and then upload these 3 files making sure the Restart Luup is checked (or reboot after upload).

Logging is enabled so will be a bunch of output in the log. Once we get thru testing I’ll figure out how to update the official app.

Notes:

  1. I reorganized a lot of stuff, constants for string, permanent log, trace capability, fix nil references, update comments. I also put the plugin in a module. Could still be more of this cleanup.
  2. Fix the locations processing so the auto-configure works again. Again, bunch of cleanup
  3. Widen the thermo name column in the dialog and fix cut-n-paste errors that put the 3rd therm device ID in the 2nd row (along with the 2nd thermo). I wrote a table generator lua script to make it easy(er) to adjust the table.
  4. Added the re-auth callback. The default is 24hours but can be changed (ReAuthInterval).

Thanks Mikee, I’m loading it now…

[quote=“mikee, post:352, topic:185402”]I have gone thru the plugin and reworked a number of things. I have run on my two thermos as well as done some unit tests with 7 digit device IDs. I also lowered the reauth interval to 60 minutes (the min) and verified it reauthenticates so should stay connected without periodic failures. I am including 3 modified files, the lua implementation, the json UI file (changed table layout ) and xml implementation file.

I can only do minimal testing myself since I have a heat only system connected to the wifis.

Install:

Install the official app and then upload these 3 files making sure the Restart Luup is checked (or reboot after upload).

Logging is enabled so will be a bunch of output in the log. Once we get thru testing I’ll figure out how to update the official app.

Notes:

  1. I reorganized a lot of stuff, constants for string, permanent log, trace capability, fix nil references, update comments. I also put the plugin in a module. Could still be more of this cleanup.
  2. Fix the locations processing so the auto-configure works again. Again, bunch of cleanup
  3. Widen the thermo name column in the dialog and fix cut-n-paste errors that put the 3rd therm device ID in the 2nd row (along with the 2nd thermo). I wrote a table generator lua script to make it easy(er) to adjust the table.
  4. Added the re-auth callback. The default is 24hours but can be changed (ReAuthInterval).[/quote]

Great job, it works!!!
VeraEdge UI7 (1.7.1598)
Single Honeywell RTH9580

Had the non-app store version installed. Deleted both devices (controller and thermo). Installed the app store version. Vera found the controller but not the thermo. Entered my credentials as normal in the controller. Blue Vera msg said it authenticated, but no devices found. Installed your 3 files above. Vera found the thermostat and the 7 digit thermo popped up automatically. Instantly showed the current temp (awesome). Set the thermo to “Cool” from the Vera and it worked! Checked Honeywell dashboard (web) and it reflected the change too. Turned the thermo to “Off” from the Vera and it worked (Honeywell website confirmed “Off”).

Looking good for my simple needs. Not at home for a week so I can’t test a whole lot more, but happy to help test configuration stuff as needed.

The only bit that could work better is that I cannot select and type in numerically the desired temp when setting up scenes; I must use the arrows.

This can be easily remedied with Lua code (within the scene).

@Mikee,

I took a quick glance at the revisions. When you get a chance, have a quick look at the following functions…

device = dev

function SetCurrentSetpoint_Heat(dev, NewCurrentSetpoint)
   -- This may be called from UI5 convention, so handle it.
   luup.variable_set(SERVICE_SETPOINT_HEAT, "CurrentSetpoint",
		     NewCurrentSetpoint,
		     dev)
   log("SetCurrentSetpoint_Heat NewCurrentSetpoint = " .. tostring(NewCurrentSetpoint))
   setTStatus("SETPOINT_HEAT", NewCurrentSetpoint, device)
end

And this…

TCC_DEVICE_ID = TCC_DEVIDE_ID 

function getStatus(TccDevice_ID)
   trace("getStatus", { TCC_DEVIDE_ID = TCC_DEVIDE_ID })

And this I believe was an old typo from Joey (should be newOpmode).

newOpmode = newOpemode 

function buildSetReq(veraID)

   elseif newOpemode == "AutoChangeOver" then

I’ll give this more attention when I get home, especially since I really want to see the log data…

Thanks! They are fixed. I am changing names to follow CONSTANTS, Globals, locals and I suspect there are more lurking… The TCC_DEVICE_ID was supposed to be TccDevice_Id. I’ll keep going over it, I really appreciate the reviews. Should have run time control over the logging in soon …

You’re very welcome. It’s inevitable that little things will be lurking in this code and you nailed it - globals and locals…

I did have authentication fail on me twice today, although I have no log data to support what happened. When it failed the 2nd time (authentication failed, check TCC setup), I checked TCC and direct access to their site failed. Within a few minutes the site came back up and I refreshed access on Vera3. That was at approx. 2:33 (central). I just checked Vera and all is well (1.5 hrs). I’ll continue to check if from my office off and on until I get home. If it fails again on me tonight, I’ll post all the log data I can scrape up !

Hmmm, that brings up and interesting point. If the login fails we do not attempt a retry. This will essentially stop the plugin until a manual (or external event) causes a new login. I don’t think this is right but I didn’t want to keep trying in case the credentials were bad. I don’t know if there are any lockouts an auto login could trip. But I think that maybe a slow (like an hour-ish) retry might be in order to re-establish the session. Thoughts ?

Oh, I had a login failure at 13:09 Eastern …