core: MyQ Task exception was never retrieved

Home Assistant release with the issue:

0.79.0b1

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Hassio Component/platform:

MyQ

Description of problem: Usually get two errors at the same time, this one and the one posted in the traceback. Not sure if the two errors are related.

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

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

cover:
  - platform: myq
    username: myemail
    password: mypassword
    type: chamberlain

Traceback (if applicable):

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

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 53 (29 by maintainers)

Most upvoted comments

@towerhand @geekofweek @vajonam @ehendrix23 I have submitted https://github.com/home-assistant/home-assistant/pull/17535 for this with the documentation update as well for scan_interval.

@arraylabs think this solution is good for a PR back into the main branch.

Sorry, been away on vacation out of the country for the last 1.5 weeks.

@vajonam @ehendrix23 @talljohnson would you have a chance to test out some changes?

Changes:

  • default SCAN_INTERVAL defined as 120 seconds not the standard 15 seconds
  • SCAN_INTERVAL (the default of 120 seconds) can be overridden in configuration.yaml with scan_interval on the component
  • Switch to beta_4 of the pymyq library which includes an endpoint change for get_status, its a more direct endpoint and the return is much smaller
  • change init to check door status immediately and if fails fall back to None, better than waiting for the update to get the status after HA start/restart
  • Updates to close_cover and open_cover based on @ehendrix23 code with additional status check. Does two things, retries sending the open/close command if it initially fails the API call. Once API is successfull it queries status until it gets an open or close status or fails. Provides a quicker update of confirmed open/close than waiting for update to occur.
  • Change to update to check for False from pymyq and return either current status or None.

Let me know if you run into any issues or if something looks wrong, or there is just a better way to accomplish something.

https://gist.github.com/arraylabs/bd1a58fb44761aa968a8cb0569ac8710

I would create a new one, but actually this would be done in the pymyq dependant component that @arraylabs seems to maintain AFAIK.