Xiaomi Aqara fails on HA restart

I have had the Xiaomi Aqara gateway working with a handful of motion sensors for a while now and jsut recently it has been failing to load whenever I restart Home Assistant. The logs always say something like this:

2019-03-18 19:20:08 ERROR (SyncWorker_3) [homeassistant.components.xiaomi_aqara] No gateway discovered
2019-03-18 19:20:08 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Component failed to initialize.

I am able to get it to load if I unplug the gateway and then restart Home Assistant. It is as if the gateway is only discoverable a few minutes after being restarted. Any help would be greatly appreciated.

try adding

discovery_retry: 10

to the Xiaomi Gateway (Aqara )component

Could be a timeout issue

I had bad luck with auto discovery and so, instead, list out my mac addresses for each gateway, like so:

xiaomi_aqara:
  discovery_retry: 25
  gateways:
    - mac: '78:11:DC:B3:XX:XX'
      key: !secret xiaomi_key_kitchen
    - mac: '78:11:DC:B2:XX:XX'
      key: !secret xiaomi_key_hall