Page 33 of 47 FirstFirst ... 23282930313233343536373843 ... LastLast
Results 321 to 330 of 470

Thread: Decoded - EvoHome API access to control remotely.

  1. #321
    Automated Home Guru
    Join Date
    Dec 2016
    Posts
    181

    Default

    Quote Originally Posted by jzwack-honeywell View Post
    In the definitions for evohome-client, for zones they have the "Setpointmode" and "TimeUntil" values.

    I think based on the code:
    0 == "FollowSchedule"
    1 == "PermanentHold"
    2 == "TemporaryHold"

    If "setpointmode" == "FollowSchedule" then "TimeUntil" should always equal next schedule switchpoint. Unless no schedule is set.

    For instance, if you changed "SetpointMode" from 0 to 2, and left "timeUntil" with the same value you would have a temp hold until the next switchpoint.

    Also it looks like evohomeclient2 is getting schedule data.
    Quite certain that evohomeclient sets a null value for TimeUntil for the "FollowSchedule" value (or rather "Cancel Override").

    I should probably explain what I'm doing here though. In Domoticz I can pop up a dialogue in the web based frontend to set a different temperature. I found that if there was already an active temporary override, the dialogue displayed the corresponding until time. The script pointed to by DBMandrake does not supply that kind of information to Domoticz for zones that are set to follow schedule and thus the dialogue in the web frontend would by default be for a permanent override.

    So I extended the script because I wanted the web frontend to behave similar to when I turn a dial on one of the radiator valves or "Round" thermostats and I posted a copy of my version on the Domoticz forum rather than change the one on the wiki, because I did not know if other people would like such a feature and it does require doing an extra web call for each zone. Which on my machine takes in the order of 45 seconds to complete after being fired from cron. For reference: the current version of the C++ version I'm working on does the same thing in about 3 seconds (with the locally cached schedule).

  2. #322
    Automated Home Guru
    Join Date
    Dec 2016
    Posts
    181

    Default

    Quote Originally Posted by paulockenden View Post
    Surely if the mobile app works then it's not the username or password?
    Correct. According to the log he is receiving a security token. I am somewhat puzzled about the "\r\n" characters though. Should those be there?

  3. #323
    Automated Home Legend
    Join Date
    Sep 2014
    Location
    Scotland
    Posts
    2,204

    Default

    Quote Originally Posted by paulockenden View Post
    Surely if the mobile app works then it's not the username or password?
    Yes but look at the way the password is encoded in the URL string... if url encoding is not handled properly there may be an issue with certain characters in passwords.

    Other than that I'm out of ideas though. It can really only be one of two things - an issue with it not handling the password correctly, or a problem with the evohome client library or python installation on the system.

  4. #324
    Automated Home Legend
    Join Date
    Sep 2014
    Location
    Scotland
    Posts
    2,204

    Default

    Quote Originally Posted by gordonb3 View Post
    Correct. According to the log he is receiving a security token. I am somewhat puzzled about the "\r\n" characters though. Should those be there?
    I see them on my working system so I think they're fine.

    I can't see anything wrong comparing his debug log to my working one, except for the fact that the response to the second query is an HTTP error. The only difference in the request string is the order of the Headers, but that shouldn't matter, and his version of python-requests is newer than mine, which also shouldn't matter. Otherwise the requests are identical, sans username and password.

  5. #325
    Automated Home Legend
    Join Date
    Sep 2014
    Location
    Scotland
    Posts
    2,204

    Default

    Here is my successful debug log with username and password censored, if it helps:

    Code:
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): tccna.honeywell.com
    send: 'POST /Auth/OAuth/Token HTTP/1.1\r\nHost: tccna.honeywell.com\r\nContent-Length: 302\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml\r\nUser-Agent: python-requests/2.9.1\r\nConnection: keep-alive\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthorization: Basic YjAxM2FhMjYtOTcyNC00ZGJkLTg4OTctMDQ4YjlhYWRhMjQ5OnRlc3Q=\r\n\r\nUsername=censored&Host=rs.alarmnet.com%2F&Password=censored&Pragma=no-cache&Cache-Control=no-store+no-cache&scope=EMEA-V1-Basic+EMEA-V1-Anonymous+EMEA-V1-Get-Current-User-Account&grant_type=password&Content-Type=application%2Fx-www-form-urlencoded%3B+charset%3Dutf-8&Connection=Keep-Alive'
    reply: 'HTTP/1.1 200 OK\r\n'
    header: Set-Cookie: tccna=R3708284716; path=/; expires=Fri, 16-Dec-2016 09:13:32 GMT
    header: Cache-Control: no-cache
    header: Pragma: no-cache
    header: Content-Length: 1433
    header: Content-Type: application/json;charset=UTF-8
    header: Expires: -1
    header: Server: Microsoft-IIS/8.5
    header: X-Powered-By: ASP.NET
    header: Server: Web1
    header: Date: Thu, 15 Dec 2016 09:07:21 GMT
    DEBUG:requests.packages.urllib3.connectionpool:"POST /Auth/OAuth/Token HTTP/1.1" 200 1433
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): tccna.honeywell.com
    send: 'GET /WebAPI/emea/api/v1/userAccount HTTP/1.1\r\nHost: tccna.honeywell.com\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml\r\nUser-Agent: python-requests/2.9.1\r\nConnection: keep-alive\r\napplicationId: b013aa26-9724-4dbd-8897-048b9aada249\r\nAuthorization: bearer Fmw7dT-wSBfrDDYxUQ_TXJGg4eAToAWvM-jMrxpBNUWm5PrWhpvUQXCHRNerAPt61GNWiP9qGIVlOCOp7krziOPAFFxBzdpO5yKTyOn3899aCIjteAz5qun3bexa5npES9zLHq2rodW_0xtbL0aGAG1t7qfFSMsGwQ5RzoEZP_5kLpYyG7jMl1jMlptRZiL83cPJXRusWMN0OzJHltna1T7juh65GWngjAP3jKfrd7QJdAgI1we-b-XSAz7dX78j4TM1m4PBojtogCDTtdNLdMuW0YHIkktw_gHgqEzwDZ1m-iGLzBcluPdaIEpUK-Ig7tc_sylS0AoYoeIfLJjOdND9er_KYuO6XMX1OCaLz85eoA8rPfetx6_rRHx-JO44YaMyyVWh5-2D6E30I2CklA7qmMm8bHCPi6bgMEoon9qPFgLHoVgTrBtdBqVxFB7ElOS1rtuy__bO6ivVcvqiw1Jk2y9n0rwoWO4mstXVd5wJN2CQIEdDObDuF2apLGE2GFF3kSGuIZw_WGwQnYw3n1Z11_mws0DCKk04ywpVmQjHwDMRCV-iQ0F8QmlwjO0X1WGpqbd5SIx2rpit-jxus3o_c15c7b2OeZwtDb07cYbAyRSr-WxqqJPrRtfUxjKsb4oXQg\r\n\r\n'
    reply: 'HTTP/1.1 200 OK\r\n'
    header: Set-Cookie: tccna=R3710656558; path=/; expires=Fri, 16-Dec-2016 09:13:32 GMT
    header: Cache-Control: no-cache
    header: Pragma: no-cache
    header: Content-Type: application/json; charset=utf-8
    header: Expires: -1
    header: Server: Microsoft-IIS/8.5
    header: X-AspNet-Version: 4.0.30319
    header: X-Powered-By: ASP.NET
    header: Server: Web1
    header: Date: Thu, 15 Dec 2016 09:07:22 GMT
    header: Content-Length: 261
    DEBUG:requests.packages.urllib3.connectionpool:"GET /WebAPI/emea/api/v1/userAccount HTTP/1.1" 200 261
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): tccna.honeywell.com
    send: 'GET /WebAPI/emea/api/v1/location/installationInfo?userId=1108128&includeTemperatureControlSystems=True HTTP/1.1\r\nHost: tccna.honeywell.com\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml\r\nUser-Agent: python-requests/2.9.1\r\nConnection: keep-alive\r\napplicationId: b013aa26-9724-4dbd-8897-048b9aada249\r\nAuthorization: bearer Fmw7dT-wSBfrDDYxUQ_TXJGg4eAToAWvM-jMrxpBNUWm5PrWhpvUQXCHRNerAPt61GNWiP9qGIVlOCOp7krziOPAFFxBzdpO5yKTyOn3899aCIjteAz5qun3bexa5npES9zLHq2rodW_0xtbL0aGAG1t7qfFSMsGwQ5RzoEZP_5kLpYyG7jMl1jMlptRZiL83cPJXRusWMN0OzJHltna1T7juh65GWngjAP3jKfrd7QJdAgI1we-b-XSAz7dX78j4TM1m4PBojtogCDTtdNLdMuW0YHIkktw_gHgqEzwDZ1m-iGLzBcluPdaIEpUK-Ig7tc_sylS0AoYoeIfLJjOdND9er_KYuO6XMX1OCaLz85eoA8rPfetx6_rRHx-JO44YaMyyVWh5-2D6E30I2CklA7qmMm8bHCPi6bgMEoon9qPFgLHoVgTrBtdBqVxFB7ElOS1rtuy__bO6ivVcvqiw1Jk2y9n0rwoWO4mstXVd5wJN2CQIEdDObDuF2apLGE2GFF3kSGuIZw_WGwQnYw3n1Z11_mws0DCKk04ywpVmQjHwDMRCV-iQ0F8QmlwjO0X1WGpqbd5SIx2rpit-jxus3o_c15c7b2OeZwtDb07cYbAyRSr-WxqqJPrRtfUxjKsb4oXQg\r\n\r\n'
    reply: 'HTTP/1.1 200 OK\r\n'
    header: Set-Cookie: tccna=R3710656558; path=/; expires=Fri, 16-Dec-2016 09:13:32 GMT
    header: Cache-Control: no-cache
    header: Pragma: no-cache
    header: Content-Type: application/json; charset=utf-8
    header: Expires: -1
    header: Server: Microsoft-IIS/8.5
    header: X-AspNet-Version: 4.0.30319
    header: X-Powered-By: ASP.NET
    header: Server: Web1
    header: Date: Thu, 15 Dec 2016 09:07:23 GMT
    header: Content-Length: 9303
    DEBUG:requests.packages.urllib3.connectionpool:"GET /WebAPI/emea/api/v1/location/installationInfo?userId=1108128&includeTemperatureControlSystems=True HTTP/1.1" 200 9303
    {'temp': 43.0, 'setpoint': '', 'thermostat': 'DOMESTIC_HOT_WATER', 'name': '', 'id': u'2079484'}
    {'temp': 17.5, 'setpoint': 5.0, 'thermostat': 'EMEA_ZONE', 'name': u'Bathroom', 'id': u'1377389'}
    {'temp': 18.5, 'setpoint': 5.0, 'thermostat': 'EMEA_ZONE', 'name': u'Living Room', 'id': u'1378782'}
    {'temp': 15.5, 'setpoint': 5.0, 'thermostat': 'EMEA_ZONE', 'name': u'Main Bedroom', 'id': u'1438045'}
    {'temp': 17.5, 'setpoint': 5.0, 'thermostat': 'EMEA_ZONE', 'name': u'Kitchen', 'id': u'1643296'}
    {'temp': 18.5, 'setpoint': 5.0, 'thermostat': 'EMEA_ZONE', 'name': u'Hall', 'id': u'1643302'}
    {'temp': 10.5, 'setpoint': 5.0, 'thermostat': 'EMEA_ZONE', 'name': u'Study', 'id': u'2078389'}

  6. #326
    Automated Home Guru
    Join Date
    Dec 2016
    Posts
    181

    Default

    Quote Originally Posted by DBMandrake View Post
    I see them on my working system so I think they're fine.

    I can't see anything wrong comparing his debug log to my working one, except for the fact that the response to the second query is an HTTP error. The only difference in the request string is the order of the Headers, but that shouldn't matter, and his version of python-requests is newer than mine, which also shouldn't matter. Otherwise the requests are identical, sans username and password.
    That might actually have a relation to the issue. As it happens I got several bad requests myself when working on the C++ version of the library. I found that after doing a POST I needed to reset the curl client settings to get the server to return the correct response. Somehow the POST method appeared to get stuck in the connection parameters and the Honeywell site doesn't play nice if you set the wrong method even if there is no parameter involved. The newer python-requests might require enforcing the correct method rather than assume it defaults to GET as well.

  7. #327
    Automated Home Lurker
    Join Date
    Dec 2016
    Posts
    6

    Default

    Quote Originally Posted by DBMandrake View Post

    ... and his version of python-requests is newer than mine
    which version do you use? (just to check)

  8. #328
    Automated Home Lurker
    Join Date
    Dec 2016
    Posts
    6

    Default

    Finally it works.

    What I've done:
    - Setup the server clean (I run it as VM so that was no problem)
    - Registered a new account (especially looked for punctuation etc)

    Now the Test-Script works for both versions

    I think there was something wrong with the account I firstly used.

    Next steps: integrating script for Domoticz


    Thanks to everyone (especially to DBMandrake!) for helping me.

  9. #329
    Automated Home Jr Member
    Join Date
    Jun 2017
    Posts
    48

    Default

    Does anyone have a Windows C/C++ sample that shows how to connect to the Evohome?

  10. #330
    Automated Home Guru
    Join Date
    Dec 2016
    Posts
    181

    Default

    Quote Originally Posted by RichardP View Post
    Does anyone have a Windows C/C++ sample that shows how to connect to the Evohome?
    https://github.com/gordonb3/evohomeclient

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •