MyQ error message

Today, the MyQ component has stopped working for me. The only thing that has changed is a recent upgrade to release 0.78, but I keep getting this error:

2018-09-18 22:07:06 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity.py", line 235, in async_update_ha_state
    state = self.state
  File "/usr/src/app/homeassistant/components/cover/__init__.py", line 220, in state
    if self.is_opening:
  File "/usr/src/app/homeassistant/components/cover/myq.py", line 108, in is_opening
    return MYQ_TO_HASS[self._status] == STATE_OPENING
KeyError: 'open'

Has anyone else seen this?

I have a pull request open that should fix that. Automations still work but it doesn’t seem to understand the state of the device.

1 Like

If you add my change as a custom component or manually make the changes I made it should resolve it. I had the same issue, hopefully it gets merged and pushed out sometime in the near future.

1 Like

I am getting this error as well.

Thanks, I put in your modified file as a custom component and it’s back to normal. I see that your pull request got merged, so I assume it’ll be fixed in the next release. Thanks for tracking this down.

1 Like

Cross-posting to a few others as this does not appear to be solved, for me at least, after upgrading to .79 which has the pull request merged. Any ideas are greatly appreciated.

=========================

The new update on 0.79 doesn’t seem to solve the issue for me. I am still getting the below when opening and stopping the door halfway. The system doesn’t seem to recognize the ‘opening’ / ‘stopped’ state, though it does see ‘closing’ and ‘closed’:

2018-09-28 21:24:14 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 234, in async_update_ha_state
state = self.state
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/cover/init.py”, line 231, in state
if self.is_opening:
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/cover/myq.py”, line 109, in is_opening
return MYQ_TO_HASS[self._status] == STATE_OPENING
KeyError: ‘stopped’

The above occurs when I am running the ‘open’ and then ‘stop’ command. Otherwise, the below is happening in the background and writing to the log file:

2018-09-28 21:20:29 ERROR (SyncWorker_11) [pymyq] MyQ - API Error[get_devices] 500 Server Error: Internal Server Error for url: https://myqexternal.myqdevice.com/api/v4/UserDeviceDetails/Get
2018-09-28 21:20:29 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 234, in async_update_ha_state
state = self.state
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/cover/init.py”, line 231, in state
if self.is_opening:
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/cover/myq.py”, line 109, in is_opening
return MYQ_TO_HASS[self._status] == STATE_OPENING
KeyError: False

1 Like

Mine is totally unresponsive now, it works in the Chamberlain app but HA just sees it as closed. I get “Updating myq cover took longer than the scheduled update interval 0:00:15” in the error log endlessly.

Mine is working with version 0.79, using the code that @geekoftheweek linked to above.

You just need to save the myq.py file in a folder called custom_components/cover and restart. If you get a warning like this in your log on startup, you’ve done it right:

2018-09-30 13:53:46 WARNING (MainThread) [homeassistant.loader] You are using
a custom component for cover.myq which has not been tested by Home Assistant.
This component might cause stability problems, be sure to disable it if you do
experience issues with Home Assistant.

I’ll give it a shot, but didn’t this change get merged in 0.79?

No longer needed as it was included in 0.79, same component.

So are the issues solved in 0.79? Folks are still reporting errors in the thread that @bakerbug linked to, so I’ve just left the custom one in place.

Different issue, the component in 0.79 is exactly the same as my custom one. That was the pull request that got merged into the main branch, so it’s no different.

1 Like

I’m getting this now:

MyQ - API Error[get_devices] 500 Server Error: Internal Server Error for url: https://myqexternal.myqdevice.com/api/v4/UserDeviceDetails/Get

and then eventually this:

Update for cover.garage_door_opener fails
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 171, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File “/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py”, line 56, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File “/usr/local/lib/python3.6/socket.py”, line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 343, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 849, in _validate_conn
conn.connect()
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 314, in connect
conn = self._new_conn()
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 180, in _new_conn
self, “Failed to establish a new connection: %s” % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fa45f578588>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/requests/adapters.py”, line 445, in send
timeout=timeout
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py”, line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘myqexternal.myqdevice.com’, port=443): Max retries exceeded with url: /api/v4/UserDeviceDetails/Get (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa45f578588>: Failed to establish a new connection: [Errno -3] Try again’,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 223, in async_update_ha_state
yield from self.async_device_update()
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 352, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/cover/myq.py”, line 131, in update
self._status = self.myq.get_status(self.device_id)
File “/usr/local/lib/python3.6/site-packages/pymyq/init.py”, line 168, in get_status
devices = self.get_devices()
File “/usr/local/lib/python3.6/site-packages/pymyq/init.py”, line 125, in get_devices
‘User-Agent’: self.USERAGENT
File “/usr/local/lib/python3.6/site-packages/requests/api.py”, line 72, in get
return request(‘get’, url, params=params, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/api.py”, line 58, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 512, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 622, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/adapters.py”, line 513, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘myqexternal.myqdevice.com’, port=443): >Max retries exceeded with url: /api/v4/UserDeviceDetails/Get (Caused by .NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa45f578588>: Failed to establish a new connection: [Errno -3] Try again’,))

0.79.1 here and it’s still broken.

I hope I can find time this week to write my own ESP8266 code to bypass myq altogether.

Same, just ordered a few ultrasonic detectors, nodemcu, magnetic reed and power supply. Only thing that sucks is having to wire it all the way back to the button instead of just the screw terminals on the opener, but whatever.

I’m going to intercept the button signal where it ties into the motor, so I’ll be wiring mine up above the operator.

What’s the signal? I tried shorting it and got nothing, I think there are specific signals created with resistors and capacitors that signal it. Did you try it?

Also seeing similar issue with MyQ on 79.2, but appears to be intermittent. I have had it work sometimes, but more often than not it isn’t.

Seeing this in the logs:

    2018-10-02 08:41:35 ERROR (MainThread) [homeassistant.components.cover] Error while setting up platform myq
    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 171, in _new_conn
        (self._dns_host, self.port), self.timeout, **extra_kw)
    File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 56, in create_connection
        for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
    File "/usr/local/lib/python3.6/socket.py", line 745, in getaddrinfo
        for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    socket.gaierror: [Errno -3] Try again

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
        chunked=chunked)
    File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
        self._validate_conn(conn)
    File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
        conn.connect()
    File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 314, in connect
        conn = self._new_conn()
    File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 180, in _new_conn
        self, "Failed to establish a new connection: %s" % e)
    urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x6f6f7990>: Failed to establish a new connection: [Errno -3] Try again

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 445, in send
        timeout=timeout
    File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
        _stacktrace=sys.exc_info()[2])
    File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
        raise MaxRetryError(_pool, url, error or ResponseError(cause))
    urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='myqexternal.myqdevice.com', port=443): Max retries exceeded with url: /api/v4/User/Validate (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6f6f7990>: Failed to establish a new connection: [Errno -3] Try again',))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
        SLOW_SETUP_MAX_WAIT, loop=hass.loop)
    File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
        return fut.result()
    File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
        result = self.fn(*self.args, **self.kwargs)
    File "/usr/local/lib/python3.6/site-packages/homeassistant/components/cover/myq.py", line 54, in setup_platform
        if not myq.is_login_valid():
    File "/usr/local/lib/python3.6/site-packages/pymyq/__init__.py", line 97, in is_login_valid
        timeout=self.REQUEST_TIMEOUT
    File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 112, in post
        return request('post', url, data=data, json=json, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 58, in request
        return session.request(method=method, url=url, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 512, in request
        resp = self.send(prep, **send_kwargs)
    File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 622, in send
        r = adapter.send(request, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 513, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: HTTPSConnectionPool(host='myqexternal.myqdevice.com', port=443): Max retries exceeded with url: /api/v4/User/Validate (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6f6f7990>: Failed to establish a new connection: [Errno -3] Try again',))

Seeing this also. v79.2.

I am seeing this as well in 0.79.3.