Switchbot component very slow

I added two switchbots and it works fine with the mac adresses found in their app. In that same app the response is almost instantaneous with <1 second before it is triggered.

With the component it can take up to 30 second before the action is triggered. After that first press (either a restart or longer time between use) it is quite fast and no issue. Range is not a problem and within 20-30 cm of each other.

Any suggestion what to try?

Enable debug logging for the switchbot library and check the logs.

Thanks!

Getting this:

2018-12-03 15:54:09 ERROR (SyncWorker_7) [switchbot] Cannot connect to switchbot.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/switchbot/__init__.py", line 25, in _sendpacket
    bluepy.btle.ADDR_TYPE_RANDOM)
  File "/usr/local/lib/python3.6/site-packages/bluepy/btle.py", line 353, in __init__
    self._connect(deviceAddr, addrType, iface)
  File "/usr/local/lib/python3.6/site-packages/bluepy/btle.py", line 402, in _connect
    "Failed to connect to peripheral %s, addr type: %s" % (addr, addrType))
bluepy.btle.BTLEException: Failed to connect to peripheral cd:c4:9b:a6:78:6f, addr type: random

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/switchbot/__init__.py", line 25, in _sendpacket
    bluepy.btle.ADDR_TYPE_RANDOM)
  File "/usr/local/lib/python3.6/site-packages/bluepy/btle.py", line 353, in __init__
    self._connect(deviceAddr, addrType, iface)
  File "/usr/local/lib/python3.6/site-packages/bluepy/btle.py", line 402, in _connect
    "Failed to connect to peripheral %s, addr type: %s" % (addr, addrType))
bluepy.btle.BTLEException: Failed to connect to peripheral cd:c4:9b:a6:78:6f, addr type: random

It does eventually work which is strange, right?

Did you manage to find any answers to this?

Mine just seems very unreliable?? I get the same code as you posted.

I moved it to a separate Raspberry Pi I think and worked ok since…

Did you connect it to the bluetooth of your raspberry?

As in you moved your HA instance to different hardware?