Automation Execution failure opens my MyQ garage door

Hi,

I have an automation that checks if my MyQ garage is open at 9.30 and closes it. A few days I found the automation opening the closed garage door at 9.30pm. Once when we were out of the house. It was sceary to find the garage door fully open when coming to the house. It doesn’t happen all the time. This is what I found in the log:

Logger: homeassistant.core
Source: components/myq/cover.py:86
First occurred: 9:31:21 PM (1 occurrences)
Last logged: 9:31:21 PM

Error executing service: <ServiceCall cover.close_cover (c:14fd7067dcc84d5bdead2fee): entity_id=['cover.garage_door_2']>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1511, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/myq/cover.py", line 86, in async_close_cover
    raise HomeAssistantError(f"Closing of cover {self._device.name} failed")
homeassistant.exceptions.HomeAssistantError: Closing of cover Garage Door failed

I have another automation that closes the garage door (if it is open) if the weather changes to “rain”. Now I am scared to keep that automation active. Even though it has not happened, a rain condition during the night can also open the garage door.

Is this a bug? If there is an exception HA should stop executing the automation but it seems to toggle the cover service.

Thanks in advance.

You probably have to post the automation in order to get help.
It sounds like you have an issue with check of start conditions.

Here is the automation. It is a very simple automation:

alias: Night Garage Door Close
trigger:
  - at: '21:30:00'
    platform: time
condition:
  - condition: state
    entity_id: cover.garage_door_2
    state: open
action:
  - data:
      entity_id: cover.garage_door_2
    service: cover.close_cover

The problem here is, why would HA even do anything when the garage is closed because the automation should not trigger.

So, I think I fond what’s hapenning but it still is not right. When I look at the history:

It seems MyQ has not reported to HA that the garage door is already closed. So, HA tell MyQ to close the already closed garage door. Either MyQ misunderstands the directive and opens the already closed Garage door or HA fails to understand what MyQ is saying and issues an open command.

Can we know who’s issuing the open command here? Is it HA or MyQ?

It seems that your garage door have not just open or closed states, but also opening and closing.
If I look at the pictures, then HA sends a command to the garage door to close at 9:30PM and the status change to closing.
About a minute later the status change to open, which might indicate that the garage door failed to close correctly, maybe due to a obstacle or a blocking. This is probably a safety feature.

Your automation looks ok, but you might need a notification set up if the door has failed to close by like 9:35PM.

I know there are two other statuses. But I didn’t care because I want the automation to trigger only if the status is “open”. All other statuses were ignored. At the time the garage door was physically closed. There was no obstacle or anything. It was just closed. So. The automation saw it as open, which is physically closed, and asked it to close. I tested it using developer options and it does nothing. MyQ ignores the request.
I don’t know what’s wrong where but opening a door where only a close command is issued is a major security issue.

Ok, your problem is not as such with the automation, but rather that HA’s sensor sees the door as open where it is closed.
This is an issue with the integrations.