New Bluetooth/Switchbot integration very slow home assistant

Hey guys,

Got the new Bluetooth integration set up and working with the new Switchbot Integration.

Its really really slow, I was using SwitchBot-MQTT-BLE-ESP32 and that was good, pretty fast, but the ESP32 would crash a lot :frowning:

So I know Bluetooth can be quicker. Any tips to improve speed? Using the supported Ugreen dongle passed though Proxmox

Thanks :slight_smile:

1 Like

hey @liminal . Bluetooth just isnt great at long distances. I had bluetooth working with switchbot and HA before the latest integration. I tried with a bluetooth dongle with external antenna.

feel free to use the native bluetooth/switchbot integration with HA, but just a note that my primary ESP32 has been running for months without issue. So if you are experiencing issues, it is most likely related to library versions you are using. I believe the ESP32 core library +v2 has BLE issues, just not enough people have reported it to me yet. Using v1.0.6 from arduino IDE works for me. The platform IO libraries are different than the arduino ones

another note I plan on releasing a major update (v7) in the next couple days as I have finally figured out issues when I was attempting to create an esp32 switchbot mesh network for improved performance

Its not a great experience lol, I haven’t got a huge apartment, but using a Bluetooth dongle probably just is not powerful enough.

I added some info about my environment here

Ill try recompiling with the Arduino libraries in the next few days, but Bluetooth mesh sounds like an awesome way to go. Happy to test if you want?

Install HAOS 9.x when it becomes available in the next few weeks. It will use a much faster Dbus broker.

2 Likes

I have the same issue. It worked fine before, but since August it is so slow (20 seconds to a minute, to never) that it is nearly unusable. That’s regardless of distance with the device. (I am using the official Switchbot Integration and the built-in bluetooth on an RPi4.)

2 Likes

What HAOS version are you on? (post above)

Hi Samuel. I am using the very latest–9.2.

Hey guys,

With the official integration;

What’s the speed like now with all the new stuff?
Can you toggle a Switchbot, or is it still only on/off

Thanks

Connection performance is usually ~1s for the adapters listed as high performance with a USB extension cable and good RSSI:

  • ASUS USB-BT400 (BCM20702A0)
  • Cable Matters 604002-BLK (BCM20702A0)
  • Enbiawit BT403 (CSR8510A10)
  • Feasycom FSC-BP119 (CSR8510A10) :signal_strength:
  • GMYLE 3340 (BCM20702A0)
  • HIDEEZ BT0015-01 (CSR8510A10)
  • IOGEAR GBU521W6 (BCM20702A0)
  • Kinivo BTD-400 (BCM20702A0)
  • Nuu You BT40 (CSR8510A10)
  • Panda Wireless PBU40 (CSR8510A10)
  • Pluggable USB-BT4LE (BCM20702A0)
  • QGOO BT-06A (CSR8510A10)
  • Raspberry Pi 3B+ (CYW43455)
  • Raspberry Pi 4B (CYW43455)
  • SABRENT BT-UB40 (CSR8510A10)
  • SoundBot SB342 (BCM20702A0)
  • StarTech USBBT1EDR4 (CSR8510A10)
  • StarTech USBBT2EDR4 (BCM20702A0)
  • Techkey PBT06H (CSR8510A10)
  • TRENDnet TBW-107UB (CSR8510A10)
  • UGREEN CM109 (CSR8510A10)
  • Warmstor WBT-AD01 (CSR8510A10)

Experiences are expected to vary widely based on:

  • the bluetooth adapter
  • linux kernel version (run HAOS for the best experience)
  • bluez version (run HAOS for the best experience)
  • interference and number of bluetooth devices in range (less is better, see below)
  • dbus implementation. Use dbus-broker for best results.
  • cpu time availability. Check your system with the profiler.start service
  • bluetooth adapter firmware

See BLUETOOTH INTERFERENCE WITH OTHER DEVICES

I also get 1-2s to connect and execute commands for me using a not recommended ZEXMTE BT-505 adapter with -63 RSSI and a USB extension cable, however some users reported much worse results with the RTL8761BU if the system cpu performance is not so great.

1 Like

Keep meaning to reply to this lol

Thanks for the info :slight_smile:

I’ve rolled this out with the native integration and the Bluetooth proxy, but its still pretty hit and miss. Mostly it works, sometimes it doesn’t. Sometimes it really quick, mostly its very slow 7s +

Think this is more to do with battery based Switchbot low energy devices then the integration

Behaves pretty much the same as, devWaves’s SwitchBot-MQTT-BLE-ESP32

Slower then the Switchbot hub using the API. But at least its local I guess.

Now that we have had the improved integration for a while, anyone finding its still slow with Switchbots? I have curtains as well and they seem to have gotten a little quicker, but the actual Switchbots seem more unreliable if anything :frowning:

1 Like

Here is a list of adapters I’ve found that are fast connecting to the bots home-assistant.io/bluetooth.markdown at 422439e68790b23480319c82c93e1c30fda98e1c · home-assistant/home-assistant.io · GitHub

  • ASUS USB-BT400 (BCM20702A0)
  • Cable Matters 604002-BLK (BCM20702A0)
  • Enbiawit BT403 (CSR8510A10)
  • Feasycom FSC-BP119 (CSR8510A10) :signal_strength:
  • GMYLE 3340 (BCM20702A0)
  • HIDEEZ BT0015-01 (CSR8510A10)
  • IOGEAR GBU521W6 (BCM20702A0)
  • Kinivo BTD-400 (BCM20702A0)
  • Nuu You BT40 (CSR8510A10)
  • Panda Wireless PBU40 (CSR8510A10)
  • Pluggable USB-BT4LE (BCM20702A0)
  • QGOO BT-06A (CSR8510A10)
  • Raspberry Pi 3B+ (CYW43455)
  • Raspberry Pi 4B (CYW43455)
  • SABRENT BT-UB40 (CSR8510A10)
  • SoundBot SB342 (BCM20702A0)
  • StarTech USBBT1EDR4 (CSR8510A10)
  • StarTech USBBT2EDR4 (BCM20702A0)
  • Techkey PBT06H (CSR8510A10)
  • TRENDnet TBW-107UB (CSR8510A10)
  • UGREEN CM109 (CSR8510A10)
  • Warmstor WBT-AD01 (CSR8510A10)

Thanks for that!

I actually thought I had the right UGREEN adaptor, but I think they may have sent me the wrong one :frowning:

I just ordered the SABRENT BT-UB40 So lets see if that’s an improvement.

I actually think I’m getting fast times on the curtains because they are going though the ESP32 proxys.

Anyway will see, appreciate you posting this :slight_smile:

Im also running as passthough using proxmox

Early days, but initial testing of the SABRENT BT-UB40 and everything is working a hell of a lot faster then the other Ugreen BT USB I had.

So If you are getting slow response, make sure your adaptor is on the high performance list. It, so far, really makes a difference :slight_smile:

Mhh I use a RaspberryPI 4 with HASS and the Switchbot takes sometimes 15-20 seconds to react.
If I trigger the bot via my Smartphone (iPhone 12 Pro) it’s way faster than via home assistant.It takes maximum 5 seconds which is OK for bluetooth.

How long do you have to wait with your SABRENT stick? ^^

It depends on the device and how I’m using it (Alexa will add a bit for eg)

But its been consistent at about 4-7 seconds.

Its a big improvement

1 Like

Also if you are using an ESPHome based proxy:

If you flashed your ESPHome proxy before 7:00AM UTC on Tuesday, December 13, 2022, please flash again as it should improve the connection times.

Please use the web flash tool below or ESPHome addon 2022.12.0b5 or later as the main line ESPHome addon does not yet have the connection time improvements or aarch64 flashing fix:
https://esphome.github.io/bluetooth-proxies/

If you use the ESPHome addon you MUST connect the device via serial to flash it or you will not see the performance improvements with active connections.

Been getting this every time I try to reflash:

Yep, same here. These updates used to work fine before.

Error: Could not find the package with 'platformio/toolchain-esp32ulp @ ~1.22851.0' requirements for your system 'linux_aarch64'

1 Like

That doesn’t look like the web flasher at ESPHome Bluetooth Proxy

Are you flashing from the site?