core: MyQ broken again
Home Assistant release with the issue:
0.100.3
Last working Home Assistant release (if known):
0.100.3
Operating environment (Hass.io/Docker/Windows/etc.):
Docker
Integration:
cover/myq
Description of problem:
Once again, the MyQ integration appears to be broken. Traceback below. It’s possible this is just an issue with the MyQ back-end, but given that (a) the platform broke recently and (b) the MyQ iOS app appears to be working fine, posting a new issue.
Problem-relevant configuration.yaml
entries and (fill out even if it seems unimportant):
---
cover:
- platform: myq
username: !secret chamberlain_myq_username
password: !secret chamberlain_myq_password
type: chamberlain
Traceback (if applicable):
2019-10-28 20:31:03 ERROR (MainThread) [homeassistant.components.cover] Error while setting up platform myq
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/src/homeassistant/homeassistant/components/myq/cover.py", line 53, in async_setup_platform
myq = await login(username, password, websession)
File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 162, in login
await api.authenticate(username, password)
File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 117, in authenticate
login_request=True,
File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 85, in request
data = await resp.json(content_type=None)
File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 1040, in json
return loads(stripped.decode(encoding))
File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Additional information:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (4 by maintainers)
Mine is in Docker on a Pi. I used the Hass.io SSH&Web Terminal addin Disable Protection mode Activated the terminal then docker exec -it homeassistant /bin/bash The above command gets you inside the container. Then edit the api.py file /usr/local/lib/python3.7/site-packages/pymyq/api.py as stated above removing the user agent lines here: https://github.com/brbeaird/pymyq/commit/dff9fcdd87be2ca4d1507e713d0fc363538f5ec9
Great job figuring this out… I made the edit and my garage doors are back
Okay, I made the change suggested in the PR and it fixed the issue. Here’s a link to it: PR
Basically, it’s a matter of editing the
pymyq/api.py
library and removing the user agent. The library can be found in./lib/python3.6/site-packages/pymyq
.