New Bluetooth/Switchbot integration very slow home assistant

Be sure you are flashing with 2022.12.0b5 or later as it has the fix for this

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

Looks like its showing 2022.12 is showing up to install though HA now.

But this is interesting;

“OTA will work, but to fully take advantage of the performance increases for bluetooth, it is best to at least one serial flash with ESPHome 2022.12.0 or later.”

Why will it be better if I flash it though the cable and not OTA, That is a bit of a hassle :frowning:

1 Like

The newer code uses esp-idf and a new partition table which can’t be OTA

2 Likes

So this is still broken? My switchbot is connected via the Bluetooth in a Pi4 direct line of site about 4M (12’) away. It takes over 30 seconds to “wake up” then it will respond almost instantly after that. Then after about a minute or two of inactivity it is back to the long wake up time.

If I connect to the switchbot with my phone from the same spot (or even on the other side of the house >30’ away) the response is instant.

There is clearly something wrong with the Pi4 Bluetooth antenna or something messed up with the HASS OS (I’m on HASS OS 9.3) and 2022.11.1 core

Any way to fix this.

2 Likes

I don’t have the same experience with any of my RPi4s using 2022.12.6 + HAOS 9.4.

Unless you are willing to dig in and figure out where the issue is on your own, I’d setup a proxy or get one of the external adapters on this list https://www.home-assistant.io/integrations/bluetooth/#known-working-high-performance-adapters

Connection times with the ethernet based proxies are usually sub 1s with ESPHome 2022.12.0+

1 Like

Thanks for the response.

Is there a link for how to set up a ESPHome Proxy? Any of the external adapters that you like better than others?

I use the Feasycom FSC-BP119 (CSR8510A10) :signal_strength: for my production

https://www.aliexpress.us/item/2255799901392975.html

1 Like

There is a link somewhere in this thread that has all the high performance adaptors

Just a question on this. Does this only help when using the actual Bluetooth proxy firmware or would I see improvements for other ESP32s that are using:

esp32_ble_tracker:
bluetooth_proxy:
  active: true

You should do the serial flash for anything that has bluetooth_proxy active set to true

2 Likes

Wow, this makes such a difference. Switchbot is almost instant now.

3 Likes

Is it still instant for you? I flashed with serial, but it isn’t instant at all. What setting do you have for ‘tries’ within the curtains integration?

It seems to change with almost every update :frowning:

Its seeming to get slower. :roll_eyes:

There is definitely something going on with Bluetooth (non proxy) and Home Assistant. I have a Switchbot Plug Mini, and when first turned it on to pair it, it was found instantly so that was nice. This was with a small dongle (Realtek) connected directly to the back of the server in a closet about 15 feet away.

When I actually attempt to control the plugs it takes 10-15 seconds to respond, then second command is sent almost instantly, if I wait a couple minutes to send another command it takes 10-15 seconds.

I have also tested with the dongle connected to an active USB extension cable and placed within inches of the plugs. It still takes 10-15 seconds.

I have some ESP32 WROOM devices coming that have bluetooth and I planned on using BT Proxy which I hear actaully works. But it seems like native (physically connected) BT support has just been neglected and people are expected to create their own BT Proxies. I’m fine with that, but for a newer user it is probably out of the question.

The reason I chose to post is because I believe that this could be fixed, and I want to encourage anyone with the the knowledge to do so! Thanks for all the work that so many of you put in to this stuff!!

I was having the same problem described by others here–an initial delay of 30-60 seconds to activate my Switchbot Bot–and found the following solution, which might be helpful to others:

I noticed that the Raspberry Pi 4 that I’m running HA on has onboard Bluetooth, which was active in the Bluetooth integration. I disabled it, and that fixed the problem for me. My Switchbot now responds quickly when it is close to either my USB Bluetooth dongle (ZEXMTE BT505) or my ESPHome proxy.

IMPROVING CONNECTION TIMES

Note these timings are using HA dev / 2023.7.x with ESPHome 2023.6.0 so it will be slower with HA versions before 2023.7.x

Great thread.
I have a Raspberry Pi 3B+ using HA. The bluetooth performance with my Switchbot (On / Off switch) was just terribly slow, 15+ seconds if I’m lucky, then within 5 seconds after it’s established it’s connection when toggle from the Switchbot HA integration via bluetooth.

I have a ESP32-CAM lying about and gave it a go with the bluetooth proxy, and to my delight installation over browser was a success and now toggling the Switchbot from HA integration is a constant reliable 4 initially to establish connection, and near instant after that.

I did disable my built in bluetooth in HA to make sure its just using the proxy.

Just hats off to the developers of all of these tools, amazing stuff!

2 Likes

Disabling the on-board bluetooth and using only the bluetooth proxy was the game changer! Incredible response, really changed the performance and role of bluetooth devices in my home, thank you!

I can confirm this as well, got a ESP32 dev board and installed using ESPHome Bluetooth Proxy , now Switchbot reacts within seconds. Yay!