liminal
(Shane)
August 7, 2022, 3:57am
1
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
So I know Bluetooth can be quicker. Any tips to improve speed? Using the supported Ugreen dongle passed though Proxmox
Thanks
1 Like
devWaves
(Dev Waves)
August 7, 2022, 10:26am
2
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
liminal
(Shane)
August 7, 2022, 11:30pm
3
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
opened 03:57PM - 04 Aug 22 UTC
closed 12:26AM - 22 Aug 22 UTC
I have 2 switchbot curtains paired together, one switchbot bot and one contact sā¦ ensor connected to my wemos di mini eps32. Like I said after a 2 to 3 days of working my contact sensor stops reporting to my home assistant. It (the switchbot devices) give an unavailable status or continues to report the same last state but do not record any new event. I have everything up to date with firmware 1.1, your code is in version v6.12. Maybe I have too many connected device?
This is the connected devices code:
/* Switchbot Bot Settings */
static std::map<std::string, std::string> allBots = {
{ "SwitchbotThermopompe", "C2:C2:78:DF:41:B4" }/*,
{ "switchbottwo", "yY:yY:yY:yY:yY:yY" }*/
};
/* Switchbot Curtain Settings */
static const int curtainClosedPosition = 10; // When 2 curtains are controlled (left -> right and right -> left) it's possible one of the curtains pushes one of the switchbots more open. Change this value to set a position where a curtain is still considered closed
static std::map<std::string, std::string> allCurtains = {
{ "RideauxCuisine", "C6:BD:87:AE:EB:17" }/*,
{ "curtaintwo", "yY:yY:yY:yY:yY:yY" }*/
};
/* Switchbot Meter Settings */
static std::map<std::string, std::string> allMeters = {
/*{ "meterone", "xX:xX:xX:xX:xX:xX" },
{ "metertwo", "yY:yY:yY:yY:yY:yY" }*/
};
/* Switchbot Contact Sensor Settings */
static std::map<std::string, std::string> allContactSensors = {
{ "PortePrincipale", "D4:FB:FD:48:2F:6F" }/*,
{ "contacttwo", "yY:yY:yY:yY:yY:yY" }*/
};
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?
bdraco
(J. Nick Koston)
August 25, 2022, 5:50am
4
Install HAOS 9.x when it becomes available in the next few weeks. It will use a much faster Dbus broker.
2 Likes
Oz1234
(Enzo)
October 12, 2022, 3:49pm
5
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
samuel81
(Matte)
October 12, 2022, 3:52pm
6
What HAOS version are you on? (post above)
Oz1234
(Enzo)
October 16, 2022, 1:02am
7
samuel81:
HAOS
Hi Samuel. I am using the very latestā9.2.
liminal
(Shane)
October 16, 2022, 11:05pm
8
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
bdraco
(J. Nick Koston)
October 17, 2022, 12:40am
9
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)
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
liminal
(Shane)
October 24, 2022, 3:30am
10
Keep meaning to reply to this lol
Thanks for the info
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.
liminal
(Shane)
November 16, 2022, 9:44am
11
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
1 Like
bdraco
(J. Nick Koston)
November 16, 2022, 12:39pm
12
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
home-assistant:current
ā home-assistant:more_bluetooth
opened 09:39PM - 08 Nov 22 UTC
## Proposed change
Now that I know what to look for when ordering these, I foā¦ und
quite a few more of the better performing ones as the quality
of the Linux driver seems to be the most important factor.
Another pile of adapters arrived today so I'm updating
the docs again.
Document the slow startup of the Broadcom adapters
on the Odroid n2+
I've also opened up https://github.com/home-assistant/core/pull/81926
to fix Broadcom adapters never showing up in discovery because
of the slow startup / 120s delay.
The test box has grown to two test boxes:
![IMG_0068](https://user-images.githubusercontent.com/663432/201812110-86c3c407-6668-445c-9277-81c2cd3b2954.jpg)
## Type of change
<!--
What types of changes does your PR introduce to our documentation/website?
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR.
-->
- [ ] Spelling, grammar or other readability improvements (`current` branch).
- [x] Adjusted missing or incorrect information in the current documentation (`current` branch).
- [ ] Added documentation for a new integration I'm adding to Home Assistant (`next` branch).
- [ ] I've opened up a PR to add logo's and icons in [Brands repository](https://github.com/home-assistant/brands).
- [ ] Added documentation for a new feature I'm adding to Home Assistant (`next` branch).
- [ ] Removed stale or deprecated documentation.
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- Link to parent pull request in the codebase:
- Link to parent pull request in the Brands repository:
- This PR fixes or closes issue: fixes #
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [ ] This PR uses the correct branch, based on one of the following:
- I made a change to the existing documentation and used the `current` branch.
- I made a change that is related to an upcoming version of Home Assistant and used the `next` branch.
- [ ] The documentation follows the Home Assistant documentation [standards].
[standards]: https://developers.home-assistant.io/docs/documenting/standards
ASUS USB-BT400 (BCM20702A0)
Cable Matters 604002-BLK (BCM20702A0)
Enbiawit BT403 (CSR8510A10)
Feasycom FSC-BP119 (CSR8510A10)
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)
liminal
(Shane)
November 17, 2022, 1:38am
13
Thanks for that!
I actually thought I had the right UGREEN adaptor, but I think they may have sent me the wrong one
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
Im also running as passthough using proxmox
liminal
(Shane)
November 18, 2022, 4:50am
14
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
Venice
(Tobias)
November 26, 2022, 7:34am
15
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? ^^
liminal
(Shane)
November 27, 2022, 6:09am
16
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
bdraco
(J. Nick Koston)
December 13, 2022, 7:04am
17
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.
samuel81
(Matte)
December 13, 2022, 12:22pm
18
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
bdraco
(J. Nick Koston)
December 13, 2022, 8:48pm
20
That doesnāt look like the web flasher at ESPHome Bluetooth Proxy
Are you flashing from the site?