Hi - I don’t check the forums very often. For this sort of error you are better off on GitHub, because issues tagged homekit_controller get sent to me automatically
We have had timeout issues with garage door openers in the past (there is one manufactuer on the tip of my tongue) and most of the time there has been a quirk of the device. I think the last one was if a close request was sent while it was still in motion?
But a timeout in this part of the code is less common. It’s struggling to establish a TCP connection to your device. Is it on the edge of your WiFi range and suffering packet loss? There is a fix in either the current HA or the next big release of HA that slightly improves retrying behaviour. In older versions retrying could be overly agressive and open multiple connections, exacerbating the problem if the device has an embedded microcontroller sized TCP stack.
Are you using MyQ? I noticed that my MyQ homekit_controller integration gets wonky when you trip the safety sensor and then try to close the garage too soon. Not sure if your issue is the same. I think @Jc2k might have been referring to this in his response, as we exchanged a few messages about it.
As a work-around, I wrote the below automation. I actually have the HA integration AND the homekit_controller integration for the garage, but homekit_controller is the primary one. When the below gets triggered (when you close the garage using homekit_controller) it will then wait 7 seconds and then also execute the HA integration. It’s a stupid hack, but works pretty well.
- id: garage_door_close_retry_homekit
alias: 'Garage Door Close Retry - HomeKit'
initial_state: true
trigger:
- platform: event
event_type: homekit_state_change
event_data:
entity_id: "cover.garage_door"
service: "close_cover"
action:
# Wait 7 seconds, then retry if garage did not close due to an obstruction
- delay: '00:00:07'
- service: cover.close_cover
entity_id: cover.garage_door_ha