Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "APIRateLimited" response every time despite successful login #28

Open
mleibundgut opened this issue Aug 17, 2020 · 3 comments
Open

Comments

@mleibundgut
Copy link

I am able to successfully log in, but any other call like "somecomfort --devices" gives me a rate limited response. I can wait as long as I want - nothing changes. Below is the sample debug output:

FOR LOGIN:
pi@rasp-zwave:~ $ somecomfort --login --username xxx --password yyy
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.mytotalconnectcomfort.com:443
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal HTTP/1.1" 200 4155
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "POST /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 23
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "POST /portal/Location/GetLocationListData?filter=&page=1 HTTP/1.1" 200 8220
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal/Device/CheckDataSession/956501 HTTP/1.1" 200 1644
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal/Device/CheckDataSession/2521619 HTTP/1.1" 200 1644
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal/Device/CheckDataSession/2115571 HTTP/1.1" 200 1650
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal/Device/CheckDataSession/2118169 HTTP/1.1" 200 1650
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal/Device/CheckDataSession/4414091 HTTP/1.1" 200 1650
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal/Device/CheckDataSession/2307771 HTTP/1.1" 200 1645
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?UserName=xxx&RememberMe=false&Password=yyy&timeOffset=480 HTTP/1.1" 200 32
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal/Device/CheckDataSession/2276899 HTTP/1.1" 200 1645
Success

FOR DEVICE CHECK:
pi@rasp-zwave:~ $ somecomfort --devices
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.mytotalconnectcomfort.com:443
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal HTTP/1.1" 200 4155
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "POST /portal?RememberMe=false&timeOffset=480 HTTP/1.1" 200 4288
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?RememberMe=false&timeOffset=480 HTTP/1.1" 200 4196
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?RememberMe=false&timeOffset=480 HTTP/1.1" 200 4196
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "POST /portal/Location/GetLocationListData?filter=&page=1 HTTP/1.1" 401 None
Traceback (most recent call last):
File "/home/pi/.local/bin/somecomfort", line 10, in
sys.exit(main())
File "/home/pi/.local/lib/python2.7/site-packages/somecomfort/main.py", line 201, in main
_main(session)
File "/home/pi/.local/lib/python2.7/site-packages/somecomfort/main.py", line 156, in _main
session=session)
File "/home/pi/.local/lib/python2.7/site-packages/somecomfort/client.py", line 385, in init
self._discover()
File "/home/pi/.local/lib/python2.7/site-packages/somecomfort/client.py", line 49, in wrapper
return fn(*args, **kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/somecomfort/client.py", line 500, in _discover
raw_locations = self._get_locations()
File "/home/pi/.local/lib/python2.7/site-packages/somecomfort/client.py", line 463, in _get_locations
return self._post_json(url, params=params)
File "/home/pi/.local/lib/python2.7/site-packages/somecomfort/client.py", line 447, in _post_json
return self._request_json('post', *args, **kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/somecomfort/client.py", line 436, in _request_json
raise APIRateLimited()
somecomfort.client.APIRateLimited: You are being rate-limited. Try waiting a bit.

Would be great if I could use the API - trying to get the temperature from the thermostat to lower my shades when it gets too warm.

@nriley
Copy link

nriley commented Nov 10, 2020

Of note is that the HTTP error message does not mention rate limiting at all; it simply is a generic 401 (401 - Unauthorized: Access is denied due to invalid credentials.

https://github.com/HubitatCommunity/HoneywellThermo-TCC seems to be a currently updated TCC client which has made some recent fixes — probably the same thing needs to happen with somecomfort.

@BigGeorgeTx
Copy link

BigGeorgeTx commented Nov 13, 2020

I am also experiencing this problem. I downloaded the code Nov 19, 2020 for the first time.
I never overcame the problem trying to run Somecomfort by itself. However, I was checking it out as a baby-step towards installing the https://github.com/mjcumming/Somecomfort-Homie project to use with my OpenHAB install. I recently got that to work and it seems to be pulling the data it needs from Honeywell TCC using Somecomfort.

@atlflyer
Copy link

I was able to work around this problem by providing the --username and --password parameters every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants