Keep connection between ESP32 bluetooth proxy and switchbot

Hi!

I’m using a ESP32 bluetooth proxy to trigger my SwitchBot.

Is there a way to keep the bluetooth proxy connected to the switch bot, so that commands are issued faster?

When it hasn’t performed an action recently, the delay between issuing a command and having the SwitchBot react is quite long (2-5 seconds). If it performs a single action, a subsequent action within the next couple of seconds is almost instantanoues.

Thanks in advance,
Peter

How close is your ESP32 to the SwitchBot? And do you have active set to true for the BT Proxy YAML on the ESP?

I have a SwitchBot Lock and had similar issues until I put a dedicated proxy VERY near it and set active to true (I hadn’t ever used BT Proxy for an active connection before and thus had never defined that in the YAML before.). I’ve since moved the ESP further away, but it’s still pretty close. I started off with it literally a couple feet away and direct line of sight.

Now it’s essentially instantaneous all the time, with MAYBE a fraction of a second difference between the first command and subsequent ones shortly thereafter.

If you have a dedicated ESP32 for the switchbot anyway (without other usecases on the same device), I’d always recommend SwitchBot bot/curtain/meter/contact/motion MQTT ESP32 bridge - Local control
Rock solid since day 1 I used it.

Thank you for your replies. @Lakini, I’ll give that firmware a shot once I have the time!

Yes I have “active” set to true for the bluetooth proxy. I pasted my config below. My ESP32 is really not far from the device, less than 1 meter and there is a box & wooden mirror cabinet between them, but I can’t imagine that this should impact the performance.

I have noticed the signal strength of the BT connection between my ESP and the lock change DRAMATICALLY just with the door open vs closed with my ESP located nearby but without a line of sight. I didn’t notice this when it was setting right next to it and had line of sight. Not sure if the BT antenna is somewhat directional or if it’s just a product of my door being metal and it disturbing how the signal propagates open vs closed.

I also have the issue that connection is lost for 5-10 minutes every few hours:

Happens to my SwitchBot Bot and also for the SwitchBot Lock.

I placed the ESP32 very near to the device. Signal was improved but outages are basically identical.
Does anyone have an idea?
My options are to switch to MQQT ESP32 Bridge which was very stable for the Bot but does not work (yet) with the Lock. Other options would be to buy the SwitchBot Hub.

HA Integration would be perfect but it’s just too unstable. Connection from my Raspberry Pi 4 directly is also way worse than the Proxy device.

What sensor is that history for? Google translate is failing me.

It’s the SwitchBot Bot.

I just studied the guide in more detail: Bluetooth Proxy — ESPHome

I’ll set Platform to esp-idf and remove interval: 1100ms and window: 1100ms because that’s not recommended for WiFi Devices. I hope this helps. I will report In the next days.

I’ll be curious to see the results and bet that it’ll fix your issues. Have had my lock for many months and other than the very occasional hiccup, it’s worked quite flawlessly using a BT Proxy.

Ok, this totally fixed my problems:

I guess it was because the interval: 1100ms and windows: 1100ms setting which killed WiFi every 1 or 2 hours. But could also be the esp-idf instead of Arduino setting.

Now I am totally happy and don’t have to buy that Hub :slight_smile:

1 Like

Hi. Would you be able to tell me if this will still work if my Home Assistant server does not have a Bluetooth dongle?

I’m using the synology Nas, which doesn’t allow it on usb ports anymore

Will ESP 32 integrate with Home Assistant via Wi-Fi? And then use Bluetooth to reach switch or curtains?

Yeah, no BT dongle needed.

Yes

Cool thanks. Is there one you can recommend? Preferably one that has a case on it? I just need to open and close curtains via Bluetooth. Nothing crazy lol Just don’t know what’s compatible and what’s not. I’m just getting started

Any ESP32 should do. I make my own cases and PCBs, so I can’t recommend a nicely packaged one but I know there are lots out there. I’m sure other folks have favorites.