We have moved at community.getvera.com

Author Topic: https Authentication help: Honeywell Total Comfort Connect  (Read 35682 times)

Offline JoeyD

  • Sr. Member
  • ****
  • Posts: 410
  • Karma: +36/-5
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #15 on: January 10, 2015, 05:52:50 pm »
Thanks...I'll give that a try later tonight!

Offline mikee

  • Full Member
  • ***
  • Posts: 140
  • Karma: +14/-0
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #16 on: January 10, 2015, 06:15:28 pm »
This snippet seems to work. I added content-type: application/json and my 500 errors went away ...

   req = {
      ["DeviceID"] = tonumber(device_id),
      ["SystemSwitch"] = nil,
      ["HeatSetpoint"] = 56,
      ["CoolSetpoint"] = nil,
      ["HeatNextPeriod"] = nil,
      ["StatusHeat"] = nil,
      ["StatusCool"] = nil,
      ["FanMode"] = nil,
   }

   body = json.encode(req)
   error(body)

   local res, code, header, status = https.request {
      method = "POST",
      ["url"] = URL .. "Device/SubmitControlScreenChanges",
      headers = {
         ["accept"] = "application/json, text/javascript, *.*; q=0.01",
         ["accept-encoding"] = "gzip,deflate,sdch",
         ["accept-language"] = "en-US, en, q=0.8",
         ["cache-control"] = "max-age=0",
         ["connection"] = "keep-alive",
         ["host"] = HOST,
         ["dnt"] = "1",
         ["referer"] = URL .. "Device/Control/" .. device_id,
         ["x-requested-with"] = "XMLHttpRequest",
         ["user-agent"] = USER_AGENT,
         ["content-type"] = "application/json",
         ["content-length"] = #body,
         ["cookie"] = cookie_string,
      },
      source = body_source,
   }

Offline JoeyD

  • Sr. Member
  • ****
  • Posts: 410
  • Karma: +36/-5
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #17 on: January 10, 2015, 07:36:35 pm »
Thanks, mikee! Between that and CudaNet's post, that should pretty much do it. I'll be able to resume my own work in this in another hour or so.

Quick quesition...you have source=body_source. Is that supposed to be body...or did you operate on body?

Offline mikee

  • Full Member
  • ***
  • Posts: 140
  • Karma: +14/-0
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #18 on: January 10, 2015, 07:50:46 pm »
Yeah, I didn't know about ltn12.source.string so I implemented a simple one. body_source just takes the body and returns it on the first call, nill after that, same as ltn12.source.string(body). I'll replace it with ltn12.source.string. Thanks for the pointer.

Offline ServiceXp

  • Sr. Member
  • ****
  • Posts: 342
  • Karma: +9/-6
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #19 on: January 10, 2015, 10:08:44 pm »
Subscribed
U.S.A Vera 3

Offline JoeyD

  • Sr. Member
  • ****
  • Posts: 410
  • Karma: +36/-5
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #20 on: January 10, 2015, 11:07:50 pm »
So it looks like we have success!

Thanks to mikee and CudaNet I am now able to successfully get data from the WiFi thermostats, and send data to change a setting.

So at this point it's basically time to really start building the app itself.

It's not clear to me at this time if I'll be able to query the API to get a list of locations and devices associated with an account, or if for at least the short term I'll require the user to enter in device Ids via the UI.  Then I'll add standard HVAC thermostat child devices and start building out the implementation.

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #21 on: January 11, 2015, 12:32:48 am »
Awesome ! I have no doubt others will contribute, after all - that's what makes this product great (the forum and it's members)...

So it looks like we have success!

Thanks to mikee and CudaNet I am now able to successfully get data from the WiFi thermostats, and send data to change a setting.

So at this point it's basically time to really start building the app itself.

It's not clear to me at this time if I'll be able to query the API to get a list of locations and devices associated with an account, or if for at least the short term I'll require the user to enter in device Ids via the UI.  Then I'll add standard HVAC thermostat child devices and start building out the implementation.
openLuup, AltUI, Zway and HomeWave, enough said...

Offline mvader

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: +29/-75
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #22 on: January 11, 2015, 02:03:00 am »
So it looks like we have success!

Thanks to mikee and CudaNet I am now able to successfully get data from the WiFi thermostats, and send data to change a setting.

So at this point it's basically time to really start building the app itself.

It's not clear to me at this time if I'll be able to query the API to get a list of locations and devices associated with an account, or if for at least the short term I'll require the user to enter in device Ids via the UI.  Then I'll add standard HVAC thermostat child devices and start building out the implementation.

Awesome work! thanks to all..

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #23 on: January 11, 2015, 01:36:35 pm »
Also, be careful hitting their server too many times in x amount of time. I read last night that they recently implemented a short period lockout (to keep polling to a minimum), I'd say every 5 minutes or so should be safe...
openLuup, AltUI, Zway and HomeWave, enough said...

Offline JoeyD

  • Sr. Member
  • ****
  • Posts: 410
  • Karma: +36/-5
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #24 on: January 11, 2015, 05:57:57 pm »
Thanks...I'll make that the default refresh rate.

That also explains some sporadic authentication issues I've encountered during development. :)

So I have something that those following this thread can test.  What is done so far:

1) Installs a parent device. (Honeywell TCC).
2) Allows you to enter up to three thermostats to connect to
3) Creates the child thermostat devices for those IDs
4) I think I have put in support for all the UI elements (at least with UI7)
    - Indoor Temperature
    - Current set-point
    - Fan mode
    - Thermostat mode (Heat / Cool / Auto).
5) The UI information will refresh every 5 minutes

Right now...communication is ONE WAY.  Only reading the data and updating the UI.  You can try and click buttons to change settings, but it won't do anything.  This is more or less designed to test the set-up process, authentication and updating of the UI.  So if you install this, please report back on if it appears to work, or if you're having any problems.

TO INSTALL:
1) Download the attached zip file.
2) Upload the 6 files contained in the zip to your vera.  For UI7
     - Apps-->Develop Apps-->luup files
     - Click on the Upload button.
     - You can select multiple files at once, or upload 1 one at a time, but you must upload all 6.
3) Add the parent device:
     - Apps --> Develop Apps -- > Create Device
     - In Upnp Device Filename type the device file name: D_HoneywellTCC1.xml
     - In Description type what you want, such as: "Honeywell TCC"
     - Click "Create Device"
4) I typically reload luup at this point for good measure:
     - Devices --> The device you just added --> Click on ">", then click on Advanced and scroll to the bottom.  Click on "Reload Engine"

5) After luup reloads, go to the "TCC Setup" tab of the new device

6) Enter your Total Connect Comfort user name and password, and click "Update".  After a few seconds, you should see that authorization is "successful"

7) Enter your wifi device ids in the spaces provided (up to 3) and click "Update Ids".  (To get your device IDs, log in to mytotalconnectcomfort.com.  Navigate to one of your thermostats (so that you see all of the controls for an individual thermostat).  In your bowser URL, you will see something like "https://mytotalconnectcomfort.com/portal/Device/Control/XXXXXX".  Where XXXXXX is the device ID for that thermostat.

8.) After you update the IDs, it will take Vera a minute or two to add the child devices and then sync them.  they should refresh every 5 minutes.

Good luck!!


Offline ServiceXp

  • Sr. Member
  • ****
  • Posts: 342
  • Karma: +9/-6
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #25 on: January 11, 2015, 08:08:54 pm »
Not displaying correctly in UI 1.5


U.S.A Vera 3

Offline rayp

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +3/-0
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #26 on: January 11, 2015, 08:31:30 pm »
It's connecting at least !
So awesome to see this being brought to life.

Offline ServiceXp

  • Sr. Member
  • ****
  • Posts: 342
  • Karma: +9/-6
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #27 on: January 11, 2015, 08:47:59 pm »
It's connecting at least !
So awesome to see this being brought to life.
How did you enter the password to connect? The field is not displaying on mine.
U.S.A Vera 3

Offline rayp

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +3/-0
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #28 on: January 11, 2015, 08:59:51 pm »
Entered it in the advanced tab.

Offline JoeyD

  • Sr. Member
  • ****
  • Posts: 410
  • Karma: +36/-5
Re: https Authentication help: Honeywell Total Comfort Connect
« Reply #29 on: January 11, 2015, 10:12:22 pm »
Thanks for posting...this is exactly the kind of feedback I'm looking for!

Unfortunately, I don't have UI5 to test with...I'll see if there's something obvious that might fix the UI placement for UI5.  Otherwise, I may need someone with UI5 to take a look at the .json file and tweak it.