core: MyQ : Error when controlling MyQ but it can successfully report status

The problem

It recently asked to re-enter the credentials. It successfully connected and it shows the status, but when I control the garage opener (open or close) I get the following error. I deleted and readded the integration but that didn’t help. Again, it successfully reports the status of the garage opener but can’t control it.

Failed to call service cover/open_cover. Opening of cover Garage Opener failed with error: Credentials are invalid, update username/password to re-try authentication.

What version of Home Assistant Core has the issue?

2022.9.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

MyQ

Link to integration documentation on our website

https://www.home-assistant.io/integrations/myq

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/myq/cover.py:103
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 9:41:46 AM (12 occurrences)
Last logged: 6:19:26 PM

[546112809968] Opening of cover Garage Opener failed with error: Credentials are invalid, update username/password to re-try authentication.
[544381344384] Opening of cover Garage Opener failed with error: Credentials are invalid, update username/password to re-try authentication.
[547981402720] Opening of cover Garage Opener failed with error: Credentials are invalid, update username/password to re-try authentication.
[547979630368] Opening of cover Garage Opener failed with error: Credentials are invalid, update username/password to re-try authentication.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/myq/cover.py", line 101, in async_open_cover
    wait_task = await self._device.open(wait_for_state=False)
  File "/usr/local/lib/python3.10/site-packages/pymyq/garagedoor.py", line 81, in open
    return await self._send_state_command(
  File "/usr/local/lib/python3.10/site-packages/pymyq/device.py", line 201, in _send_state_command
    await self.account.api.request(
  File "/usr/local/lib/python3.10/site-packages/pymyq/api.py", line 236, in request
    await self._authentication_task_completed()
  File "/usr/local/lib/python3.10/site-packages/pymyq/api.py", line 142, in _authentication_task_completed
    authentication_task = await self.authenticate(wait=False)
  File "/usr/local/lib/python3.10/site-packages/pymyq/api.py", line 465, in authenticate
    raise InvalidCredentialsError(message)
pymyq.errors.InvalidCredentialsError: Credentials are invalid, update username/password to re-try authentication.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/myq/cover.py", line 103, in async_open_cover
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Opening of cover Garage Opener failed with error: Credentials are invalid, update username/password to re-try authentication.

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 11
  • Comments: 24 (5 by maintainers)

Most upvoted comments

Happened to a few people today. After the MyQ integration asks for your password and it connects (but then errors out when you try to actually use it), you just have to restart HomeAssistant. It should come back for you then.

It sounds like the credentials are getting stored in memory and not getting refreshed. Thus the restart fixes it by reloading it fresh. Probably a bad variable reference somewhere.

+1 for restarting Home Assistant to fix.

Restart was the key. Not sure why is it required after updating the credentials. (And what happened to credentials, by the way - my password has not changed, it is still the same. Neither pymyq has not changed, AFAIK)