Closed a-bianucci closed 3 years ago
2020-12-16 14:28:39 DEBUG (MainThread) [pymyq.api] Sending authentication request to MyQ 2020-12-16 14:28:39 DEBUG (MainThread) [pymyq.api] Sending myq api request https://api.myqdevice.com/api/v5/Login 2020-12-16 14:28:39 DEBUG (MainThread) [pymyq.api] Attempt 1 request failed with exception: [Errno 104] Connection reset by peer 2020-12-16 14:28:39 WARNING (MainThread) [pymyq.api] Device update failed; trying again in 2 seconds 2020-12-16 14:28:41 DEBUG (MainThread) [pymyq.api] Sending myq api request https://api.myqdevice.com/api/v5/Login 2020-12-16 14:28:41 DEBUG (MainThread) [pymyq.api] Attempt 2 request failed with exception: [Errno 104] Connection reset by peer 2020-12-16 14:28:41 WARNING (MainThread) [pymyq.api] Device update failed; trying again in 4 seconds 2020-12-16 14:28:45 DEBUG (MainThread) [pymyq.api] Sending myq api request https://api.myqdevice.com/api/v5/Login 2020-12-16 14:28:45 DEBUG (MainThread) [pymyq.api] Attempt 3 request failed with exception: [Errno 104] Connection reset by peer 2020-12-16 14:28:45 WARNING (MainThread) [pymyq.api] Device update failed; trying again in 5 seconds 2020-12-16 14:28:50 DEBUG (MainThread) [pymyq.api] Sending myq api request https://api.myqdevice.com/api/v5/Login 2020-12-16 14:28:50 DEBUG (MainThread) [pymyq.api] Attempt 4 request failed with exception: [Errno 104] Connection reset by peer 2020-12-16 14:28:50 ERROR (MainThread) [homeassistant.components.myq.config_flow] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/myq/config_flow.py", line 50, in async_step_user info = await validate_input(self.hass, user_input) File "/usr/src/homeassistant/homeassistant/components/myq/config_flow.py", line 30, in validate_input await pymyq.login(data[CONF_USERNAME], data[CONF_PASSWORD], websession) File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 259, in login await api.authenticate(username, password, False) File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 170, in authenticate auth_resp = await self.request( File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 151, in request return await self._send_request( File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 114, in _send_request message = f"Error requesting data from {url}: {data.get('description', str(err))}" UnboundLocalError: local variable 'err' referenced before assignment
Rick you thinking it's an updated API then as the URL is actually available or?
home-assistant/core#44303
Rick you thinking it's an updated API then as the URL is actually available or?
Perhaps an API change? I don't really know as a simple curl for authentication is throwing an error.
That's how I read the logs to... that last line regarding local variable err wasn't sure about. Here is to hoping it just comes right back up.
The myq app on ios has a login URL of partner-identity.myq-cloud.com, that appears to be different than the existing /Login URL (api.myqdevice.com)
irctrakz if I can figure out the curl string (not a coder), could try and replace the url with what you have see what happens.
irctrakz if I can figure out the curl string (not a coder), could try and replace the url with what you have see what happens.
I'm getting the same error against that URL, I believe it's all the same servers - just different FQDN based on client/application.... looking more like possible API change, or just an issue with their API service.
Looks like they may also be certificate pinning.... but tbh, my burp skills are rusty.
Looking more to be wider spread API issues, IFTTT <> MyQ isn't working either, and that is a supported connection.
Yeah, api.myqdevice.com returns a connection reset (not even a 500 or 302), but partner-identity.myq-cloud.com gives a 400
The server is return status code 401 Unauthorized for https://api.myqdevice.com/api/v5/Login
Response body is:
{'code': '401.102', 'message': 'Unauthorized', 'description': 'The current call is Unauthorized.'}
The API._send_request function was expecting err
to remain in scope outside of the try-except block, which it doesn't. I submitted #54 to fix that issue so that the error can be properly reported.
Digging deeper, I was mistaken. The server is only dropping connection when you pass the 'User-Agent': 'okhttp/3.10.0'
header, so Chamberlain myst be blocking that user agent.
Changing the user agent to 'pymyq'
resolves the issue. My garage door is going crazy now.
Confirmed that changing User-Agent resolved the problem.
i changed the User-Agent and i am still having the same issue
I just changed the User-Agent and it resolved the issue. I hope this gets pushed to master and released soon.
How do you do that if you are running HASS Os?
can you put a copy of updated file in custome components?
Version 2.0.12 just released that includes random generator for user agent similar to what they did in HomeBridge.
Random is fun, but so is trolling them:
DEFAULT_USER_AGENT = "grow_up_MyQ/1.2.3"
I just now installed pymyq 2.0.12 on Home Assistant OS 2020-12. It did not go well. I had previously manually edited api.py with the hardcoded user agent, and that worked fine.
Is there a logic error in the just-updated api.py?
message = f"Error requesting data from {url}: {data.get('description', str(err))}"
UnboundLocalError: local variable 'err' referenced before assignment
EDIT: I updated the myq manifest (requirements) file to also point to 2.0.12, restarted HA and the error is gone. Changed nothing else. Not sure what really caused the error, but it's gone now. Sorry - Nevermind!
FYI, with the old manifest it would have downloaded the older version again. So in reality you downgraded back to previous pymy version. With the updated manifest the new 2.0.12 is downloaded and used.
So i removed the integration and now I cannot get the integration to work, unexpected error when trying to configure. tried pip install pymyq, and i get an error files or directories cannot be found. how do we get the integration back up and running form scratch?
ERROR: Failed building wheel for pycares
Can someone help me understand how the resolution is propagated? I was experiencing this same issue... When I saw that it was "resolved," I was still experiencing the problem. Eventually, I tried deleting the Integration and then reconfiguring it. But, I now get an "Unexpected error" when entering my Username and Password (I've also tried putting them in configuration.yaml). I've checked Supervisor numerous times and no updates are available. Also, I've tried rebooting Home Assistant several times, to no avail.
Here is my log: 2020-12-18 03:20:41 ERROR (MainThread) [homeassistant.components.myq.config_flow] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/myq/config_flow.py", line 50, in async_step_user info = await validate_input(self.hass, user_input) File "/usr/src/homeassistant/homeassistant/components/myq/config_flow.py", line 30, in validate_input await pymyq.login(data[CONF_USERNAME], data[CONF_PASSWORD], websession) File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 259, in login await api.authenticate(username, password, False) File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 170, in authenticate auth_resp = await self.request( File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 151, in request return await self._send_request( File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 114, in _send_request message = f"Error requesting data from {url}: {data.get('description', str(err))}" UnboundLocalError: local variable 'err' referenced before assignment
Am I doing something wrong? How do I get my Home Assistant to use the new code? I believe this is related to #https://github.com/home-assistant/core/issues/44322
Please help!
Can someone help me understand how the resolution is propagated? I was experiencing this same issue... When I saw that it was "resolved," I was still experiencing the problem. Eventually, I tried deleting the Integration and then reconfiguring it. But, I now get an "Unexpected error" when entering my Username and Password (I've also tried putting them in configuration.yaml). I've checked Supervisor numerous times and no updates are available. Also, I've tried rebooting Home Assistant several times, to no avail.
Here is my log: 2020-12-18 03:20:41 ERROR (MainThread) [homeassistant.components.myq.config_flow] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/myq/config_flow.py", line 50, in async_step_user info = await validate_input(self.hass, user_input) File "/usr/src/homeassistant/homeassistant/components/myq/config_flow.py", line 30, in validate_input await pymyq.login(data[CONF_USERNAME], data[CONF_PASSWORD], websession) File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 259, in login await api.authenticate(username, password, False) File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 170, in authenticate auth_resp = await self.request( File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 151, in request return await self._send_request( File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 114, in _send_request message = f"Error requesting data from {url}: {data.get('description', str(err))}" UnboundLocalError: local variable 'err' referenced before assignment
Am I doing something wrong? How do I get my Home Assistant to use the new code? I believe this is related to #home-assistant/core#44322
Please help!
usedjeans818,
The resolution hasn't been pushed out through the Hassio \ HASS OS process yet. So you will need to follow the instructions in this link: https://github.com/home-assistant/core/issues/44303.
The reason it's "Closed" is because it's not a HASS\Core issue but was an issue with the PYMYQ Add on. To be honest wasn't an issue with the addon specifically but a change by Chamberlin, that the dev's found a work around for.
@a-bianucci , thanks for confirming.
However, I am not running Home Assistant in a docker and get the following when I run the command from that webpage:
~ $ docker exec -t -i homeassistant /bin/bash -bash: docker: command not found
I can 'cd' into the /usr/local/lib/ directory, but there is no 'python3.8' directory in there. All there is is:
~ $ cd /usr/local/lib lib $ ls libjemalloc.a libjemalloc.so libjemalloc.so.2 libjemalloc_pic.a pkgconfig
Can you maybe help at this stage so I can get MyQ working again? I appreciate any help you can provide.
@usedjeans818 - take a look at your traceback above - it's reporting the path of the file you need to edit - "/usr/local/lib/python3.8/site-packages/pymyq/api.py". So, if you're not finding pthon3.8 in /usr/local/lib, something seems odd. How did you install homeassistant? if, for example, you used a virtual environment, the path would be different... but it would be odd that the path in the venv would be the same as the system path reported in the traceback (or at least that seems to be the system path on ubuntu). but if it's in a VM or container that path could be the same, you just need to be in said VM or container when looking for the directory. You can try sudo find / -type d -name site-packages
. If you find more than 1 site-packages directory, you have to determine which python3.8 directory is active for your homeassistant installation. once you find it, you can apply the fix you found that you referenced above.
@yajrendrag - I installed it on a Raspberry Pi 4 by following https://www.home-assistant.io/getting-started/. I think that's the issue, that it's not running under a docker. I tried the 'sudo find' command and just a 'find' and received:
~ $ sudo find / -type d -name site-packages -bash: sudo: command not found ~ $ find / -type d -name site-packages ~ $
Any other suggestions?
I finally got into HASSIO and was able to edit the DEFAULT_USER_AGENT! I'll try to document it in case anyone else runs into my issue.
And, now, my MyQ is working again! Thank you @a-bianucci and @yajrendrag for taking the time to assist me.
Any idea on how to get this to work, if I am using HA in Proxmox on a NUC?
Doors now showing unavailable.
Others are starting to notice as well.
Error Logs show: File "/usr/local/lib/python3.8/site-packages/pymyq/api.py", line 114, in _send_request message = f"Error requesting data from {url}: {data.get('description', str(err))}" UnboundLocalError: local variable 'err' referenced before assignment
Not sure if they are updating the API, or something else.