#bluetooth-archived
1 messages · Page 6 of 1
Ha tries to work around it by restarting the chip but you’ll still probably see gaps where the chip was dead
(Some of them are so bad you have to unplug them and plug them back in to recover from their broken state)
(If it hasn’t shipped yet, I’d cancel the bt500)
Ok thank@you very much
Can I completely rely on esphomes BT proxy’s and have no own bt dongle on the Raspi itself? Will I still be able to use all bt devices as usual?
In theory yes. Third party custom components that don’t follow our best practices might not work with proxies, but that’s their crap code not a problem with the proxies.
The only other thing to watch out for is that the proxies are for BLE, you can’t use the proxies for Bluetooth audio for example.
But there isn’t a built in integration for Bluetooth audio. Generally if there is a built in BLE integration for a device built in (like inkbird_ble or Xiaomi_ble) then it should work fine.
Does anyone here know if I can link esphome ble_client to mqtt for controlling the client over mqtt?
or is this a better topic for #devs_bluetooth-archived
It sounds like you are kinda reinventing the esphome Bluetooth proxy feature but over Mqtt? I don’t think there’s anyone working on that in core. The effort has been making Bluetooth proxies work natively with ha integrations directly, without needing mqtt at all.
There has been some work to pull the proxies code out of ha so you can do dev without ha. When that is mature you could probably make your own mqtt adaptor to that.
But if you have the python skills to do that it’d be easier to just make a ha integration targeting the proxies directly
(Of course the proxies code is so much more than just a wrapper around the ble client - it handles things like picking the nearest esp for connections, keeping tracking of how many connection slots are open (esp devices can only handle a couple of connections at once, so nearest esp might not be the best esp) and can use one or more usb dongles at the same time too)
I need your help! I was given the xiaomi kettle the smart one but with bluetooth app. Can I integrate it with ha?
If you have working Bluetooth in HA and the kettle is close enough and supported it would be automatically detected if it was supported.
The only Xiaomi kettle I can see in xiaomi_ble is YM-K1501 and it doesn’t control the kettle.
This is exactly my use case, I want to use the bluetooth proxy without HA
or with HA is fine but I want to be able to drive with code outside HA
Need a little help understanding ESPHome Bluetooth Proxy. I decided to play around with Bluetooth on HA so I made Bluetooth proxy using the ESPHome Ready-Made Projects for ESP32. The proxy is working and quickly discovered a Nutrichef Smart BBQ Grill Thermometer that is supported in the Inkbird Integration. The question I have is how often should I see the data update. It appears to typically take 30 to 40 seconds and I don’t know if this is a function of the Inkbird Integration and/or the ESPHome Bluetooth Proxy? I have moved the Nutrichef and Bluetooth proxy as close as a couple of feet apart and up to 25 feet apart and doesn’t seem to matter. I have also located them in different areas of the house to see if there is any interference. When I use the BBQ app on my iPhone the temperature updates almost instantly. I also noticed when using the BBQ app the Bluetooth proxy doesn’t respond at all so I assume they can’t be connected at the same time. The 30 to 40-second update time is not an issue I am just trying to understand how it is working. I plan to use the Inkbird integration with Home Assistant because the Nutrichef device and the iPhone app have a limited range
So it depends on a lot of factors but in ideal conditions with the right device the proxies can handle many updates a second.
WiFi can mean you miss some updates , as the Bluetooth and WiFi features share the same radio. So it switches between Bluetooth and WiFi as fast as it can.
Now last time I looked the inkbird integration used a passive method to get updates. It listened for disconnected broadcasts. These are one of the most power efficient ways to send data.
That works great with the inkbirds I have in my freezer (again, updates crazy fast)
It’s possible your grill thermo doesn’t update as fast because you are meant to use it with the app open.
When the app is open it will establish a 2 way connection and actively subscribe to the temperature and get notified as it changes.
(Probably)
HA avoids ble notifications where it can, they force connections to be left open (connection slots are a limited resource! A proxy can only handle a couple at once).
It’s not uncommon for a device to stop broadcasting when it’s connected to a device with a 2 way connection. The broadcasts are often used for discovery so the device thinks that they are no longer needed.
Thanks- that makes perfect sense.
There might be a nice way to handle this with a scan interval like setting. Once every x seconds, connect, read / wait on a notification and disconnect
Time slice the devices
That’s up to each integration to decide what’s best for their devices. There are some devices where we just connect, read the current value, disconnect.
My inkbirds have been running about a year so far without changing batteries. Changing to polling for them would decrease that life expectancy and decrease the range that data can be collected at. So it wouldn’t make sense to make the entire integration polling. You could write a new polling integration just for your grill sensor.
Probably right on range but depending on the device and the connection parameters used, being in a connected state can be less power than advertising
Yeah it does. I only have experience with Xiaomi devices (polling those takes months off them) and homekit (which goes to great lengths to avoid connections and notifications - building an encrypted mechanism on top of adverts to send per characteristic updates)
The Linux Bluetooth stack is less well optimized than eg the Apple stack. So I know there’s a big difference there. No idea where bluedroid fits in.
I think the solution for you is still to write a custom integration to suit your devices characteristics, if you need more frequent updates. Polling integrations and passive advertisement integrations are structured differently so it’s easier to just start from scratch.
Hi all, I've just built my first esp32 BT proxy - do I also need to install the BT integration (tried, it says no adapter found), the guide page seems vague to me 😦
No you do not
The Bluetooth integration is for Bluetooth dongles
You have one Bluetooth integration per dongle, and none otherwise
Hey should a bluetooth speaker appear in my devices automatically if it's in pairing mode? I have a raspberry pi 3b+. I thik the bluetooth is working but I didn't do anything special while setting it up
No
Bluetooth integrations in HA are for BLE things using GATT or broadcasting data (sensors). There’s no Bluetooth sound integration.
Mostly that means sensors, plus a few bulbs, locks, etc.
Oh I see. What about using the 3.5mm jack with a Bluetooth receiver?
Can’t help you with audio questions, I don’t use ha for audio myself.
Hi all, I found in the drawer this Yeelight Dimmer switch https://www.manualslib.com/manual/1872030/Yeelight-Ylkg08yl.html#manual
The xiaomi home app does not discover the device, and HA needs the bindkey for decrypting the communication.
I haven't quite figured out how to use the https://atc1441.github.io/TelinkFlasher.html, reason why I'm first trying to extract the bindkey, but the app doesn't find the device.
Can anyone please help?
Same is with yeelight app. It scans for devices but never finds it.
I set up a BT proxy using esphome. It is detected under the esphome integration in hass so I configured it, is there anything else to be done to set this up? I also saw an "iBeacon Tracker" integration automatically detected, I added that as well but it doesn't have any device
You are done! BT range extended 👍
what's this ibeacon tracker for? does that represent the esphome proxy?
I enabled the BLE transmitter sensor on my android phone, now what? how can I make use of that in the ibeacon tracker integration? I'm confused. That's all I see https://ibb.co/yP8Fqng
also this, https://ibb.co/ry96zNs
If you added iBeacon as an integration, it can pick up iBeacons (not to be confused with BLE transmitters)
ok, I am confusing them then. Also, I didn't add the "iBeacon Tracker" integration manually, it was automatically detected, I guess from the proxy
Looks good! If you don’t have a use case/don’t have iBeacons, there is not much use to add that integration
From having BT in general.
You could have not added it (and hit ignore instead)
Not via the companion app, there are dedicated iBeacon apps. But they are buggy. (Don’t set fields required by the protocol).
Hello everyone, I got a usecase and I'd like to have your opinion on the feasability.
I'd like to use voice assitant to play spotify on a BT speaker. From what I've seen, the pipeline to have spotify played on a speaker is doable, my question is about the speaker itself. Right now I'm using some small esp device (with shitty speaker) to capture voice and playback sounds, but what if I want to play spotify music on a nice BT speaker ? I dont want to have the BT speaker turned on H24, so will it possible that when I say "play some metallica on bedroom speaker" that it turn on the speaker (with some smart plug for exemple), then the BT speaker reconnect to the HA (on a proxmox in my case), then play the music and stay on for a while ? How about delay ? How did you guys handle your BT devices, always on ?
I'm checking before buying a BT dongle (if you have a nice and not expensive reference btw 😄 )
cheers
Most of us here are using Bluetooth for things like sensors (temperature, motion, humidity, leak, etc) or simple iot devices like locks, bulbs or thermostats. The core Bluetooth integration is for those kind of devices (BLE with GATT characteristics or BLE devices with sensor data in their discovery advertisements).
There’s no core support in the main Bluetooth integration for audio.
I don’t think there is any support in haos for setting up audio devices, but like I said, it’s not my area.
hmm too bad, from what I'm reading, people are doing that by adding device to spotify then use spotify API to tell spotify to stream audio to that device, so basically HA is just for sending order to spotify
So using the Spotify connect addon?
I think you’d need to configure bluez (the Linux Bluetooth stack) to map the speaker up like it was a local sound output.
I don’t know if there is Ui for that. Might be but I’ve never seen it. But certainly not part of HA Bluetooth integration.
yep
I'm using an atom lite as a BT proxy and got a switchbot bot to test it. The bot is 2+ meters far from the atom lite, direct line of sight and the bluetooth signal entity is saying -75 dBm, that's not normal, right?
What sort of value are you expecting?
maybe -40s ?
Have never seen a value that low with either Linux Bluetooth or an ESPHome proxy
Usually good for me is -70 to -80
That’s with dongles that have external antennae and proxies that do too
I see, good to know, I'm no expert in that whatsoever, thanks
if I get several atom lites connected, is it possible to know which one is being used by the device/bot ?
Depends on the integration
No idea for switchbot
For the ones that expose device tracker you might see an extended attributed on the device tracker entity.
I see
if the device's signal is -84 dbm, is it good enough without adding another proxy or is it better to put one there?
-84 is what I consider the yellow or orange area, at -90 I’d definitely be considering another proxy, up to -80 I definitely wouldn’t. In the middle, I’d suck it and see a bit probably. Depends on the integration tho.
For a broadcast based integration where you can tolerate losing some packets (eg you see broadcasts every few seconds and it’s only humidity or temp or similar) then I’d probably not bother until I could see gaps in data in graphs.
Question i bought a CSR8510 A10
to connect to my switchbot curtains, but u dont get any device discord, how does this work
i added the device in my integrations, it became discoverable on its own
so that works, but i dont see any bluetooth devices
i use HASSOS
on proxmox
Check your dmesg output - there are fake CSR chips on the market. Linux might detect it as a fake or have random errors for it.
where can i find this ?
dmesg output
The shell command “dmesg” on Linux systems
I assume you can ssh into proxmox and it’s just a thin wrapper around Linux? I’ve never really looked at it sorry
The other thing that stands out is that USB passthrough of Bluetooth to a vm has also been a problem for some people. To the point that they’ve gotten extra pci-e usb cards to passthrough the whole card, or ditched their vm server entirely.
are there bluetooth to zigbee devices?
Some Bluetooth devices (Xiaomi temperature sensors) can be flashed with custom firmware that enables zigbee
But if you want to avoid usb Bluetooth and get full house coverage your best bet are esphome Bluetooth proxies
would love to avoid the dongle XD
bought it quz i didnt know better
and it aint that far, but i know that my headset already has issues with the connection to my pc
same distance
is there a guide to those proxy's?
and what i best can buy
Yeah or Ethernet if you buy an esp with a socket
With Ethernet they are pretty much on par with usb dongles if not better
I use these because they have a case and a big antennae and Ethernet - https://blakadder.com/gl-s10/
But they needed soldering to flash custom firmware. Easy if you can solder!
These are popular - https://uk.robotshop.com/products/m5stack-atom-lite-esp32-development-kit
But they don’t have Ethernet or a dedicated antennae
Still fine if close enough to target device
i dont know how to solder
The 2nd link doesn’t need soldering 🙂
its micro usb powered?
found this site to flash
https://esphome.io/projects/?type=bluetooth
aslo says the atom lite
so i guess ill go for that 1
i can put it like 2m apart from it
so the connection should be good
nice they are also sold on amazon
does this also have wifi?
The 2nd 2 I linked to are WiFi only
My Bluetooth integration is repeatedly failing and reinitialising. How can I start debugging?
Rpi3b with haos
I have mijia bthome thermometers so this is a big issue for me
Logger: bluetooth_auto_recovery.recover
Source: components/bluetooth/util.py:78
First occurred: 12:51:34 PM (159 occurrences)
Last logged: 1:42:16 PM
Could not determine the power state of the Bluetooth adapter hci0 [B8:27:EB:6C:58:04] due to timeout after 5 seconds
Could not cycle the Bluetooth adapter hci0 [B8:27:EB:6C:58:04]: [Errno 110] Operation timed out
Bluetooth adapter hci0 [B8:27:EB:6C:58:04] could not be reset:
Closing Bluetooth adapter hci0 [B8:27:EB:6C:58:04] failed: [Errno 9] Bad file descriptor
Logger: bluetooth_auto_recovery.recover
Source: runner.py:188
First occurred: 12:51:58 PM (44 occurrences)
Last logged: 1:42:00 PM
Bluetooth management socket connection lost: [Errno 22] Invalid argument
Is the Passive Ble Monitor more stable?
The built in Bluetooth in ha is plenty stable if the underlying hardware is up to the task
The “auto recovery” code is kicking in because ha knows your Bluetooth chip isn’t working. It’s not the integration that’s failing, it’s the hardware.
If you are using the internal Bluetooth on your pi, the auto recovery doesn’t work because the Bluetooth chip is connected by uart not by usb.
We’d recommend a usb dongle from the list on the official ha Bluetooth documentation, ideally with an external antenna, and with a usb extension cable to get it some distance from the pi.
Or an ESPhome Bluetooth proxy
(The range on your pi is another issue is another problem waiting to happen)
In the meantime, setting ha to use passive discovery (it’s an option on the Bluetooth integration) and doing a full power off and on may help.
I am waiting on a sonoff zigbee gateway anyway. I'll convert the thermometers to zigbee. So problem should be gone then.
Ha suggests install onto a RPI, is it that there is no recovery or is it because it's not Implemented? Feels like RPI should be supported if the getting started tells you to run it on an rpi
There is no recovery possible for uart
The usb recovery works by simulating a usb unplug and replug, uart is old and does not have such mechanisms at all hardware level.
If the chip is breaking there is not much HA can do
Weird that the RPI doesn't have a ble recovery in their API at all?
Not really
There’s not a thing called ble recovery
It’s a workaround ha came up with because Bluetooth under Linux is a bit crap
Iot is more demanding than connecting a headset, phone and keyboard and mouse to a pi. We have to process many events a second (in a dense urban environment near a main road, hundreds) and that might explain why some pi users are fine.
The range of the thing does come up a lot. We’ve had users complain about there device only working at 1m or less
Again we cant change RF characteristics in software
Oh and let me say this. Auto recovery is not a good thing. It’s not like if your pi had it you would be happy.
It takes ha a while to notice there is a problem. The chip doesn’t announce it’s dead.
And some chips crash often
I had a Realtek one that died every few minutes
Even with auto recovery I missed a lot of data
Understood. I hope it works out for zigbee
i bought a bunch of esp32 to use as a bluetooth proxy https://www.amazon.com/dp/B08D5ZD528?psc=1&ref=ppx_yo2ov_dt_b_product_details, did i get the right ones? will i need one for each bluetooth device?
You shouldn’t need one per device. An esp32 can handle a couple of connections at the same time. Even then, most devices don’t hold the connection open. There’s a handful of devices that do (airthings springs to mind). If you have lots of those sorts of devices you will need more.
The downside of the type of board you have selected is its wireless. The esp32 has one radio and WiFi and Bluetooth have to share it. That means it switches from Bluetooth to WiFi and then back to Bluetooth. It means it can miss some broadcasts. Eg my Xiaomi temp sensors broadcast often enough that I can miss some packets and it not matter.
It also has no external antenna which will limit its range.
That's the same one I have and they work great with my Switchbot Blind Tilts as long as they're in close proximity.
Before I was using only 1, and it was closer to 1 of the 3. So the other 2 were slower to respond. But now all 3 work great since I added another one.
I definitely need to get at least 2 more. Using the Hub 2(via Matter) to control the Curtain Bots sucks.
It fails to execute the command too often. The ESP32's have never failed me. Even if they took 30 seconds to work, they still worked.
eh..i just bought the one linked a little above with the antenna that has an ethernet port so i can not have to fuss with it. gonna return the ones i bought from amazon.
I installed the ESP32 bluetooth proxy on my generic ESP32 and I've only got a 16 line YAML code which feels short considering all the configuration that the BLE hub and tracker require. Is the below portion importing all of that for me?
packages:
esphome.bluetooth-proxy: github://esphome/firmware/bluetooth-proxy/esp32-generic.yaml@main
Yes, but it’s not a lot even then
It’s like 1 line to make sure you are using esp-idf (not arduino), and a couple to turn on the proxy in active scanning mode. Then the rest is the usual stuff to turn on the esphome api, ota updates, wifi, etc.
https://esphome.io/components/bluetooth_proxy.html has a full example for a board with LAN
Avoid messing with esp32_ble_tracker “scan parameters” for WiFi only Bluetooth proxies, it can make things far worse
has anyone come across a way to connect a keyboard to an esp32 via bluetooth to use as a keyboard remote?
I've got a bluetooth macro pad that I'd like to use as a control panel
have a few spare pis lying around too I could use if thats a preferable method
unfortunately, I'm out of direct bluetooth range, so there needs to be some amount of network relay
Searching for “Bluetooth HID” might help. I think that’s part of “classic” Bluetooth. Most of what we do round here is part of Bluetooth GATT. So you won’t be able to use Bluetooth proxies directly for example. And the esphome “ble client” is for GATT as well.
This might be what you are after https://github.com/fsievers22/esphome-ble-remote?
oh interesting thanks, I'll take a closer look at this
got it working, and it works flawlessly
thx a bunch
I installed ESPresence and have Apple devices. When I go to enroll my iPhone 15 Pro (iOS 17.2), the Bluetooth pairing doesn't ask to pair securely. I just get the normal pairing prompt. Thus, no iPhone comes up as an enrolled device. What am I doing wrong?
Hi, I have an HA yellow. I couldn't figure out whether or not it has bluetooth, or how to enable it, does anyone know?
I don’t believe it does.
If it did, it would be provided by your CM4 module. And then it’s the same as the pi4. And if you search in here you’ll see pi4 users struggling with reliability and range. Much better off with a usb adaptor from the high performance list (on a usb extension cable to get it away from interference from the pi). Or getting an ESPhome based proxy.
is there any way to know which bluetooth proxy a bt device is connected to?
It will be in diagnostics, and if you turn on debug logs
hmm where do I see it in diagnostics? I see a bt signal sensor but that just seems to be the rssi. And on the proxy the only diagnostic sensor is the safe mode boot
Not all integrations expose it that way
Private Ble device is one that does
ah I see. Ok. I was just trying to sort out why the rssi for 2 devices is so low. There is a proxy right near them so I suspect it's connecting to one that is much further away
One thing to watch out for if your integration requires an active connection - the proxies can only handle a handful each.
For passive Bluetooth like inkbird that’s irrelevant, but a bit of a pain for eg air things
yeah. It's a switchbot curtain which I think does require an active connection. I currently have 2 proxies + the built in BT of the rpi
Both proxies esphome and recently updated?
yup, latest esphome
Shelly’s aren’t full proxies and caught a few people out
There was a setting that said whether or not esphome was allowed to make connections. Worth double checking that is turned on on them both. Think it’s the “active: true” under Bluetooth proxy. But I might be mistaken there.
hmm let me check especially since the bt settings are just being pulled from github
yup both have active true
Ah, we were both thinking about diagnostic sensors.
But the diagnostic download for the Bluetooth integration will have every device HA can see
Categorised by scanner
ohh
since te diagnostic info on the bt integration is only for the dongle I assumed it wouldn't have info for proxies
My Switchbot Hub 2 has turned into a $70(okay I paid $56) climate sensor 🤡
I can deal with delayed commands, but it failed to execute the command too often.
So I got another 3 pack of ESP32's. Why are these $5 things way more reliable than the $70 hub from Switchbot?
When I look at that I see all proxies, but you should see some information on the esphome integration too
In case anyone comes back to this looking for an answer about remotely connecting keyboards to control HA, @fringe field's comments were correct that keyboards won't work with the proxies (or the ble remote). The solution I ultimately came up with was to use a Raspberry Pi Zero w to connect to the keyboard over bluetooth, and then use triggerhappy on the Pi to trigger scripts to call the HA API over the network. So far, fairly reliable.
Ok some searching in discord and google did not give me the awnser I need. Does the PI4 support bluetooth tracking like my phone. I want to set up automation to if my phone is close to my pi4 to trigger things. I had seen a youtube video that someone did just this. Was tracking his phone within a few feet from room to room. I know other bluetooth proxies would be need to do this in room to room. But if I am in the same room close to my pi4 shouldnt I be able to do this with the built in bluetooth on the pi4? If so any links or info to get me going?
If you are using the built in integrations then it’s the same whether you are using the pi Bluetooth, usb Bluetooth or esphome Bluetooth
If the thing you watched was esppresence, probably not but you’d have to ask them
Anything else, no idea
As for your phone - what phone.
Most modern phones can’t be tracked by BLE because of privacy features
So you are down to iBeacon for android (which is an extra app that caused your phone to advertise itself continuously, though apparently the iBeacon apps break the RFC so HA can’t see them) or the private_ble_device integration for iOS. That needs you to have a macOS device to extract an encryption key to make the “random” MAC addresses trackable.
Android phone. Was hoping i could do some sort of proximity integration with it via bluetooth. If the app is broke. Any other links or info to do this? Were to start?
I think there are a gazillion iBeacon apps. I don’t know which are good and which are bad.
Can’t help with Android; iOS here
I am currently setting up a esp32 bluetooth proxy. Do I have to pair devices individually to specific proxy, or can they freely roam?
you should be able to add as many proxies as you like (within reason as each one requires a bit of cpu time on the host -- usually around 0.1-0.25%) and the system will figure out the best path to the device
host as in home assistant host?
yes
its magic, thats amazing!
and all I add to the esp is:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true```
leave the interval and window default
ahh, I see
1100 will cause you all types of wifi problems unless the device is ethernet
and even than 1100 is overkill
I wish everything worked as seamlessly as blutooth proxies :X
as soon as the esp was flashed the nearby problematic device appeared online.
i just bought this..i forgot to buy the programmer.
does this thing also do bluetooth devices or only BLE? i'm trying to use this with the ember mug integration, which i think is bluetooth.
I have some GoveeLife Smart Mini Double Buttons that use BLE. Is it possible to use these buttons with the Bluetooth integration on HA?
hi guys, any idea how I can get the BT integration to work, I am trying both the nuc onboard BT and a usb adapter and it keeps failing
2024-01-11 13:32:52.233 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not cycle the Bluetooth adapter hci1 [38:CA:73:09:3E:D9]: [Errno 71] Protocol error
2024-01-11 13:32:57.236 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth adapter hci1 [38:CA:73:09:3E:D9] could not be reset:
2024-01-11 13:32:59.409 ERROR (MainThread) [bluetooth_auto_recovery.recover] Unexpected error while attempting USB reset of hci1: [Errno 19] No such device
If you are seeing auto recovery logs that means ha thinks your Bluetooth chipset has hung and is trying to reset it. But not every Bluetooth dongle implements usb correctly.
What usb adaptor is it?
Is it on the supported list?
oh is there an official list, I doubt it, it was some old one I had laying around
its on the main bluetooth docs page - https://www.home-assistant.io/integrations/bluetooth/#known-working-high-performance-adapters
if yours is using a realtek chipset its not going to be any good for HA
hmm it seems like I cannot disable the wifi/BT chip from the bios
is there a way to disable it from HA?
hci0 (38:CA:73:09:3E:D9) this guy
Delete the integration for it and then ignore it if it tries to come back
Hi! I have a Switchbot Bot, and a Switchbot Hub Mini.
I have been using a bluetooth dongle and the switchbot bluetooth integration to control the bot, but it’s unreliable, as the bluetooth dongle sometimes is disconnected from my HA, and requires reconfiguration.
I would like to use the Switchbot API to control this. I have created some python scripts that successfully turn on/off the device GitHub - AndrewBreyen/switchbot-scripts
How can I use these scripts to create a light to turn on/off the bot?
If you switch to using an ESPHome proxy that will likely solve the problem
As for using the API, thats not a question for this channel. You might open a PR against the library for the switchbot cloud integration.
hey guys can someone suggest a cheap and compatible BT dongle to buy to use with my HA instance?
https://www.home-assistant.io/integrations/bluetooth/ has a list of ones that have been tested
Avoid any that have a Realtek chip inside
yeah saw the list, was more wondering what the nice people on here are using 🙂
Most people that talk on here are using something from that list because they came here with something not on that list and it didn’t work very well.
Or they are using multiple esphome proxies
I am using something.. from that list!
The first thing I tried was Realtek and not on that list and… it didn’t work 🎉
Actually it worked but it needed restarting every half hour
(Though its replacement fell down the back of a cupboard so I’m effectively running just esphome proxies right now)
Yeah I was using a Hub 2 to control my Switchbot devices locally. But it sucked.
Now I have 4 ESP32's spread all over my house and it controls my SB devices very fast and it always works.
I really don't understand what the fascination is about switchbot. Whats the reason someone would choose that over smart switch/relay that goes inside the switch box. The switchbox seems bulky and looks like it would interfere with using the switch physically. Am I completely missing something about them?
You're only talking about the button pusher right? Yeah I feel the same way.
I did buy one as a garage opener. But other than that I would never choose that to control my switches over a relay or new smart switches.
Yes, the original switchbot type for only some styles of wall switches. Ive never had the desire to want to try one but, am I right to assume they are probably noisy as well? They do have quite the product lineup now I see. I had no idea they were making such a variety of smart home devices and appliances. It's always nice to have a variety of options out there.
I really like some of their products. I have 3 Curtain Bots and 3 Blind Tilts.
There are arguably better options for opening curtains, but nothing comes close to their Blind tilt in price and versatility.
I've got three ESP32 bluetooth proxies (flashed by the ESPhome website) added to ESPhome. One of them is right next to a Bluetooth Eve Motion that is paried with Home Assistant, how do I make sure this proxy can see the device? It doesn't seem any more responsive than before I installed the proxy.
Do I need to turn on the ability to make service calls?
Can you turn on the signal strength sensor on its device page and tell us what sort of value you are getting?
I will agree, they do have a more practical product lineup than when I first heard of them and they primarily just made switchbot bots for light switches. Those things were all the craze back in the day and then people realized how impracticable they were.
-66 dBm
That’s a pretty good signal
Oh okay. Good to know
I have a BT proxy that HA is saying is offline. The ESPHome addon also says it's offline and I can't connect to view logs. However my router says it's online, I can ping it from HA (when I'm ssh'ed in), and I can telnet to 6053 from my local machine (don't have telnet installed in HA). Any ideas on things to try?
how can I find the "hci" number of a bt proxy?
only the bluetooth adapters on your system have an HCI number, what are you trying to do?
Bluetooth Proxies will be automatically discovered by the esphome integration
I was using the batmon addon, connect to a BMS via bluetooth and it was connected my bt proxy but all of a sudden is looking for an address with hci0
The add on has “use the new home assistant Bluetooth integration” as a todo
It’s also an addon which means it can use the Bluetooth management code that’s inside HA
Having proxies connected to multiple things at once also isn’t really supported, so the addon shouldn’t be connecting directly itself
So.. im not sure how it ever was using your proxy
Do you have a link or something of how you got that working originally?
Hi! Bluetooth related question: Is it possible to add a bluetooth device in home assistant (raspberry pi 5) to control capabilities, something custom? I have a chinese audio board that have 2 Bluetooth channels, one for audio purpose like a regular bluetooth speaker and one for controlling the device / eq / input sources, etc . I want to be able to switch via bluetooth from home assistant the input source (BT or Line in)
It's possible - if you are a fluent python developer or someone else has that exact same board and already made an integration for it.
Typically with Bluetooth if you write an integration for one bulb, you'll need to write a completely different integration for a bulb from a different vendor. Even though they are both Bluetooth, the stuff that happens "on top of" the Bluetooth is completely different. So when it comes to more obscure devices you run out of luck fast.
i thought this, but I also hoped that I can use some kind of templates instruction calls like in esphome (- ble_client.ble_write:
id: xxxxx
service_uuid: 00001623-1212-efde-1623-785feabcd123
characteristic_uuid: 00001624-1212-efde-1623-785feabcd123
value: [0x0a, 0x00, 0x41, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01]
- ble_client.ble_write:
id: xxxxx
service_uuid: 00001623-1212-efde-1623-785feabcd123
characteristic_uuid: 00001624-1212-efde-1623-785feabcd123
value: [0x08, 0x00, 0x81, 0x00, 0x01, 0x51, 0x00, 0x32]
in the idea that I could connect to a device by the mac address then send custom instructions
in HA speak that would probably be a "service call"
if you go to /developer-tools/service in your HA you can browse all of those.
Does anyone know about tuya ble?
because I am trying to configure this device: CubeTouch II (product_id 'xhf790if'), but I don't know if it must already be configured with my account from the phone or not
I have an issue with Bluetooth adapter running on a windows host machine
the adapter (usb edimax) works when home assistant boots for a few minutes then stops.
restarting the guest machine helps but also solves it only for 5 minutes orso
this only happens on a windows host machine, Running it on a linux or native home assistant oss dont have any issue ,
anyone a idea how to solve it?
Virtualbox 7.0
0pcode 0x2041
No GPIO to reset Realtek Device
It seems to be telling you that your hardware is inadequate
Indeed Realtek hardware is pretty crappy for IoT Bluetooth stuff
Home assistant actually tries to reset Realtek adaptors when they crash (typically every few minutes) - but some don’t even have the usb pins wired up to let them do it
Even if you have one machine where it works and one where it doesn’t, if it’s a Realtek chip you are going to have a crappy experience
Thanks for a reply, yeah I've read that the realtek ones have some issues.
But I was hoping it was host oss related, just because the native OSS or in a linux host doesn't have any issue s...
Anyhow any usb stick u recomented?
The ones on the documentation site
Or tbh you’ll probably have a better chance with esphome Bluetooth proxies
Bluetooth in VMs is always funky
Thank u i wil look into it!
Oh, Thougt your answer was to another Komment. Sorry!
Hi, Is anyone experiencing problems with tuya ble? Because I'm trying to configure this device: CubeTouch II (product_id 'xhf790if'), but with tuya ble integration installed via hacs it doesn't work. it's a supported device.
Unable to load configuration flow: {"message":"Invalid handler specified"}
Greetings. I am trying to have my riolink doorbell play a sound through a bluetooth speaker and I am unable to make it work. I've attached a link with the specs and confs of my BT setup. I am able to select the vlc-telnet from the media player and the sound emanates from the HA computer's speaker, not from the BT speaker. Am I approaching this the wrong way, should I instead use a different solution other then a BT speaker?
Is there a common solution to "i deleted my BLE device and now I can't re-add it" 😅
Have you tried restarting ha?
Is this a trick question - did you delete it because it was already showing as unavailable 😂
yeah tried, heh
but no trick question, was playing around with the BLE sensor for flowers and it stopped working (became unavailable no matter where i placed it in the room (using BT proxies)) so i deleted it and hopped to reset it but cant seem to re-add it
has anyone use batmon for bmses?
i set it up and it is connected to the BLE device, but I cant figrue out the mqtt part. it says tyo put in my mqtt credentials but I am nto sure where
Has anyone got bluetooth working in Kubernetes / Container? I am using the Airthings BLE integration and it had been working for months, but when I had to upgrade my k8s node it complains now and I'm not making any progress.
2024-01-25 14:20:29.446 DEBUG (MainThread) [homeassistant.components.bluetooth.scanner] hci0 (00:1A:7D:DA:71:13): BleakError while starting bluetooth; attempt: (2/3): [org.freedesktop.DBus.Error.AccessDenied] An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender="(null)" (inactive) interface="org.freedesktop.DBus" member="AddMatch" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)
I tried disabling apparmor altogether on the node, but still getting this error
Mine is working in k8s with containerd, but Debian host so no apparmor.
I disabled apparmor, so not sure why I get that message. Anything special in the HA manifest?
I do have a dbus hostMount in mine
path: /run/dbus
type: ""
name: bt-dbus```
Do you have the security context set to privileged ?
I have /var/run/dbus/system_bus_socket rather than the whole dbus folder
There’s also some /run vs /var/run tension - both exist but on some Os /run is a symlink and on others /var/run is. If you did an os version upgrade it could have changed.
Thanks for these! Great ideas. I don't seem to have the pod running as privileged, and k8s doesn't like it in my pod manifest. for some reason, where do I set securityContext: privileged: true?
You probably have it at the container level instead of spec level
Some settings apply to all containers in a pod so you can’t put them on the container definition
Thank you, the securityContext: privileged: true solved the problem, not sure why it changed.
How can I disable onboard ble in haos?
Would anyone be willing to help me connect the xiaomi kettle pro smart to home assistant (Read only). The app I use on my smartphone is "Xiaomi Home".
It might help people to help you if they know what you’ve tried, what Bluetooth dongles/proxies you’ve got, etc.
Eg it’s quite likely kettle is in your kitchen, not the same room as your HA machine? So knowing about those sorts of things might be important too
It looks like Ha might support YM-K1501, which looks a bit like the one you linked to, but confirming that model number would also be good
Hello, the kettle is in the kitchen. It is not that far from the Raspberry pi where HA runs.
Attached to the raspberry pi is the zigbee hub, but it has nothing to do with these functions I think
Are you using the internal pi Bluetooth?
yes
Because that can have a range of about a metre
very little information can be seen on the app.
but also with tuya devices?
because I have a Cubetouch (which does not connect now) but it used to work properly. Also in the kitchen
It’s not very logical
Works better for some than others
Also cubetouch could just be broadcasting with more power
Zigbee can also create interference
But if I have a Google Home or android tablet in that room, can I use it as a gateway to connect it to Ha?
The recommended approach is to have a usb Bluetooth dongle on an extension cable (to get rid of sources of interference like usb 3 and other IoT radios)
No
You can use Shelly or esphome to create range extenders (we call them Bluetooth proxies)
I have 5 proxies to cover the house. Might need a couple more TBH.
but as a bluetooth dongle any good? Even someone 'cheap' on amazon?
Read the docs
I only have shelly's 2.5 connected via wifi. But can z2h also be connected?
There’s a list of tested ones
I don’t have Shelly’s so can’t help you with what’s supported or how to configure it
ok, dont worry
I tried connecting a Bluetooth dogle I found at home to test it. After I connect it, do I need to do anything in particular?
sorry tag
It automatically recognised a Bluetooth device with the MAc
hci1
So it showed up as a discovery and you added it, and now it’s alongside hci0?
@vital bane I converted your message into a file since it's above 15 lines :+1:
I'm curious, what type of devices do you have connected to the proxies?
Mostly sensors. A few radiator thermostats. Had to move a bunch of eve devices back to Bluetooth control because thread was unstable, some eve devices that predate thread, some Xiaomi homekit sensors, so none homekit Xiaomi sensors, some inkbird sensors. And I detect presence of Apple phones with them too (auto arm/disarm alarm, turn on outdoor lights when I get home etc)
Hi guys.
I had a power outage today, and when HA booted back on, my bluetooth does not work.
Source: config_entries.py:406
First occurred: 5:26:04 PM (77 occurrences)
Last logged: 5:41:05 PM
Could not determine the power state of the Bluetooth adapter hci0 [00:00:00:00:00:00] due to timeout after 5 seconds
Bluetooth adapter hci0 [00:00:00:00:00:00] could not be reset:
Closing Bluetooth adapter hci0 [00:00:00:00:00:00] failed: [Errno 9] Bad file descriptor
Any idea on whats going on? Im using HA Yellow, with a compute module with BT.
Auto recovery means there is a problem with the Bluetooth radio and HA is trying to restart it to get things working again
Unfortunately the pi radio can’t be restarted from software
Try shutting down and removing power
If it keeps happening you’ll need a usb Bluetooth dongle from the high performance list on the HA website (Broadcom or csr, absolutely not Realtek) and ideally on an extension lead to get it away from sources of interference like usb3 and disk I/o, or esphome Bluetooth proxies.
hi, as i am very new to Linux/ Raspberry PI's etc., can you explain me, how you did it?
I’ve been meaning to write up a blog post about it. I’ll see if I can work that up and I’ll post it here.
Until then, I’m not sure what your degree of comfort with Linux, or the command line is, but there’s basically three or four steps once you have a Pi booting with the “lite” OS
- Use the bluetoothctl command to pair with the keyboard
- Install triggerhappy with “sudo apt install triggerhappy”
- Then configure trigger happy (there are lots of guides online) to run a bash script on a given key press
- The bash script can be just a single curl command to call a script or service in home assistant (you can find guides online for using the HA API as well)
If you have access to ChatGPT 4, it will probably go a long way to helping with the details
For what it’s worth, I generally found Bluetooth unreliable on the pi zero w. You might want to try a zero 2.
Hi all, I am trying to set up bluetooth proxy with a esp32. My configuration is
name: bt-proxy
But in the log, the hostname is set as bt-proxy-305c48
The log reads,
[C][mdns:115]: mDNS:
[C][mdns:116]: Hostname: bt-proxy-305c48
How do I fix this?
I set the name_add_mac_suffix option to true. But in that case all the associated settings should have the update, right?
It shows up as online and I can see the logs. But clicking on the Visit button says the address not found.
any idea how I can setup Shelly gen 2 bluetooth proxy as only BT device? I dont have adapter connected and it seems I can't find configuration for bluetooth to say that please use this proxy in this IP
You don’t add it to the Bluetooth integration, you add it to the Shelly integration. If Bluetooth is configured on the Shelly and if firmware is new enough and it’s supported, it will all just work.
It won’t show up under the Bluetooth integration though.
ok then how can I pair e.g. Yale lock through this proxy?
as currently I dont have bluetooth adapter so no bluetooth integration is loaded but from shelly I've enabled active bluetooth proxy
when I try to add bluetooth integration it just says no adapters and fail to load
maybe also question which version this came in
You can’t with Shelly
Shelly (last I heard) does not support 2 way Bluetooth like eg the esphome proxies do
That is the expected behaviour. You only add the Bluetooth integration for Bluetooth dongles, and you don’t have one.
If you had a compatible device and a compatible proxy, it would show up under its own integration in the discovery part of the Ui
For example, there is a Yale Access Bluetooth integration
yes this I tried
so what exactly shely allows me to do if not pair? it has 3 modes disabled, active and passive
I've selected the active from the shelly integration on the gen2 device
Bluetooth devices send beacons or advertisements
Sometimes they put sensor data in those beacons
Shelly is able to receive those and then we hand them off to integrations like Xiaomi, inkbird, govee and others.
Active or passive is the type of beacons
Passive we are completely silent and just listen to what’s in the background
Active we send our own beacons to ask for nearby devices to send their beacons
Inkbird only works with active
Others work with just passive
Sometimes you want some proxies with active and some with passive as devices are dumb and if they receive 3 active beacons they will send 3 temperature readings.
sound a bit weird how the communication then works? if the original bt is not in range shelly should somehow redirect the commands to bt device
This is a limitation of the Shelly device
The ESPhome implementation works fine
Their “os” is more general purpose than esphome, which builds custom code for your precise configuration. So they only handle the types of sensors I mentioned.
Esphome instead is more like a remote Bluetooth dongle - you can ask it to connect and control a device on your behalf
ok so I would need some esp devices
bummer as the shelly's would have already covered nice area
If you are only using the Shelly devices as Bluetooth proxies you may be able to flash them to esphome
I can’t help you do that but there are guides online
Their antenna may not be as good for transmission as they weren’t designed for this.
no those are EM monitors
I personally use https://www.gl-inet.com/products/gl-s10/
Though I needed to solder a header on to flash them with esphome
and also I use those for load balancing of the power network
They have a proper antennae
And Shelly and all WiFi based esp stuff has a limitation that the radio has to switch between WiFi and Bluetooth (because there isn’t the hardware to do both at once)
The s10 has LAN so can turn WiFi off and avoid that limit
https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware in its EA variant also popular
ok, Thanks for the support
now that I'm reading the bluetooth proxies documentation it says active connection not supported
shelly integration is then missleading as active should be supported..
There is some confusing terminology
Active sometimes used as short hand for “active scanning”
Sometimes for “active connection”
Shelly has support for active scanning
Not active connection
Ah maybe that Bluetooth gateway setting is new
maybe I just update everything and do full restart wait a day and see what happens
That doesn’t have a GATT client implementation
Which would be required for your device
is that doable with the new firmware?
I don’t know
But also the ticket you found is misleading
Aranet is like Xiaomi and inkbird
It doesn’t actually connect at all
It processes those broadcasts I told you about
In passive mode, not even active mode
As it stands you still need some esphome devices and I have seen nothing to make me think Shelly has gained full proxy capabilities
Hello again.
so i bought my self the: SABRENT USB Bluetooth 4.0 (BT-UB40), that was recommended on the HAS page.
Sadly i still have problems. no error codes anymore, but Bluetooth stops working again, took a lil more time this time , but still does
What i notice trough that windows reclaimed the device and has Bluetooth again.
it did the same with the old edimax stick,
While i was running linux mint and virtual box with the edimax stick i had 0 issues
So or it is an windows issue, or a virtual box one,
i am running the latest version of HAS/virtual box/Winodws 11 up to date
Is there a way to make windows not reclaim the usb?
That might solve my issue
I also looked into Bluetooth proxy
but buying that device is not an option right now,
i was thinking of going back to Linux.
But i host a game server on the same pc sometimes for friends, and most dedicated servers files work better on windows sadly
I don’t have any experience of that setup - windows infuriates me - but I do remember virtualbox as being quite flakey on Mac and Linux.
I also know that usb passthrough of Bluetooth is a common problem on here
To the point that people go bare metal with haos
Or in one case they got a pci-e usb card and did pci-e passthrough instead of usb passthrough
You might be better off asking in a place that specialises in virtual box about whether there is a hypervisor level workaround
(FWIW Bluetooth was also incredibly flakey with VMware ESX server for me)
Thank u for ur response,
i might go and gonna try asking it on the virtualbox forum
but it does anoy me a lil bit!
But i am not gonna buy anything anymore to get Bluetooth working correctly
I might just look around for an old Celeron Laptop and run HAS OS on that,
But yess usb pass-trough is a pain in the but on windows/virtualbox
getting the zigbee stick working was also a pain!
Is there anything like ibeacon tracking but for regular BLE devices? Would love to trigger automations when my Xiaomi Band is near the PI 4 hosting HASSIO
I know you can do this with ESP32 boards around the house, but i don't have any yet, and thought getting started using only the Pi is a decent idea
assuming your Mi Band has a static mac address, https://www.home-assistant.io/integrations/bluetooth_le_tracker/ should do it
if you are using the bluetooth thats built into the pi i should warn you that we semi frequently get people in here that are struggling with it either crashing (the bluetooth chip crashes, and a full power cycle (with unplug) is needed to fix it) or it just struggles with range
with esphome bluetooth proxies, its the same integration on the HA side. so you can mix and match with your bluetooth on your pi and a bunch of esp32's all feeding data into the bluetooth_le_tracker integration
Thanks!
I just updated to home asisstant core 2014.1.6 and now all my bluetooth thermometers (govee H5075) don't work anymore. is this a known issue with this version?
What did you upgrade from? Have you upgraded anything else (like HAOS version)? What are you using for Bluetooth? Proxy? USB dongle? Pi internal usb?
i updated from 1.5, i upgraded nothing else, and the adapter is the internal from the raspberry 4
i don't see anything in the logs as well, only my ACs from midea are throwing errors, but thats "normal"
Sometimes the pi Bluetooth chip just crashes
You might need to shut down the entire pi, remove power (unplug it) and then plug it back in
i restartet over the interface and did a hard reset, both didn't fix anything
Did you unplug it?
yeah
Looking at the 1.6 tag on github, it has no Bluetooth or govee changes
Do you have a sensirion or airthings?
no
They are the only remotely Bluetooth related integrations to change in that tag, and they won’t be loaded on your system.
There’s not been many GitHub issues this year for this integration, the ones that are open dont seem related
hm, i loaded my backup of 1.5 and it still can't connect to all my sensors, so it seems to be something else
In that case try changing its batteries and moving it closer
i have 6, and all are unavailable
Also try looking at a diagnostic download for the Bluetooth integration to see if HA sees anything at all
If it sees nothing then the pi Bluetooth is probably completely broken or underpowered
i don't think logs are saved. since i loaded the backup all logs are gone
I’m not interested in logs
If you look at the integrations page, under Bluetooth there is a … menu on your Bluetooth dongle that has a “download diagnostics” link
It will download what the dongle/chip currently sees
Has to be for the Bluetooth integration
You’ll have to upload it to a pastebin type service
it seems the bluetooth adapter can't be found
So if you are absolutely positive you haven’t upgraded HAOS and you have definitely unplugged power to the pi, then your pi is either underpowered or faulty.
i will look into it more tomorrow, but i purchased a bundle and the power supply was delivered with it. and it also worked for months now. The bluetooth integration shows an error, that the device (bluetooth adapter) can't be configured
but i'm pretty sure that error message has been there for a week now, and the govee integration still worked
Not much else I can say then
We’ve ruled out the upgrade
If you send the file I asked for I can confirm if your Bluetooth has seen any data at all
But what I can tell you is pi Bluetooth seems to be the most frequent problem I see in here
Unfortunately the pi doesn’t connect to it over usb
When usb Bluetooth crashes Ha has a recovery mechanism that can restart it
Which is why I said about disconnecting from power
nmcli radio tells me wifi is enabled, but nmcli device wifi rescan throws an error because it can't find a wifi device, so i guess the chip just broke
i can't download any diagnostics for the bluetooth integration, the only options are reloading, rename, system options, disable and delete
Does sound pretty broken!
Could you take a backup and try running raspbian on it to see if it’s a driver problem?
on monday i will try, the raspi is running at the office
I have a eso32 configured as a Bluetooth proxy. But my HA didn't recognize that as a Bluetooth proxy and I don't see any integration named Bluetooth proxy. I should have one, right?
No, there’s no “Bluetooth proxy” integration
If the esp32 is configured correctly and you have the esphome integration added in HA then that is it
Let me say first that yours truly is an idiot and bough a BT adapter based on ATS2851 which isn't supported by the kernel 😄
So, I was looking for recommended adapters and all of them are on pretty ancienct BT 4.0 cypress chipset and hard to actually come by with external antenna. I was thinking about using ESP32 and BT proxy, but afaik it's not a complete solution due to BTLE, which is ~80% of my usage.
What would be the best option for me? Looking for USB adapter on CSR8510A10 or digging more into ESP32 route?
I was going to get a USB BT adapter too. But my BT devices are really far apart. I think it would have been a bad idea.
ESP32's are really cheap. I bought 4 in total and spread them throughout my home really near my BT devices.
And because of that, they respond very quickly and never fail. I think it's the way to go if you have BT devices.
https://custom-components.github.io/ble_monitor/parse_data#why-isnt-ble-monitor-working-with-esphome-bluetooth-proxies it seems that some BLE stuff isn't working with with proxies
Hmm, well then I can only speak for Switchbot devices. All mine work perfectly.
I even have local control with their wifi plug now because it also uses BT.
I want to integrate multiple of the cheap xiaomi thermometers and a few other BLE sensors hmm
I have like a box of ESP32 so I may as well try and see
Most ble monitor stuff is getting integrated directly into HA so no custom components required
There has been a Xiaomi BLE integration in core for over a year now.
The ble monitor maintainer just added a bunch more devices for the feb release of HA (devices that need event entities, like remotes)
Some more coming in March
With the BLE integrations in core, esp32s will just work
(If you have Bluetooth proxy mode configured correctly)
so, if I was to provide a new device support I should make a native component for HA core, correct?
Yes, unless it belongs to an existing one like Xiaomi, inkbird, govee, etc
(there's a lot of sports equipment from Wahoo that could use HA integration but they're notoriously tight-lipped and push their cloud connection for local BT devices.......... but it's easy to get the data, just the decoding is a bit annoying as they're trying to fit a lot into a single packet with clever bitshifts)
As for LE, HA Bluetooth is pretty much only LE
Paring LE advertisements and doing GATT. Both are supported by HA and by the proxies
so passive advertisements work via proxy as long as core integration supports it, and GATT works with the same conditions as well but will eat a connection on the proxy and thus is subject to the limit of ESP, correct?
Correct
thank you for clarifying 🙂
As for dongles - getting a newer one won’t unlock any benefits, bluez doesn’t expose long range Bluetooth 5 for example. So we are stuck at Bluetooth 4 capabilities until upstream catches up with the world.
newer chips might work but no one has tested them - you might keep getting me unsupported devices
Bluetooth on Linux is not great
Naive implementations were 10x slower than the same naive code on macOS
And the firmware/driver combos are so flakey we have to have code to trigger usb resets to recover crashed Bluetooth chips
why is BT such a mess on everything but macOS..... I constantly have to fight with BT on my wife's windows PC too
“Choice” just creates an infinite test matrix whilst letting each party pretend it’s not their responsibility
I guess... still better than GPUs 😄
And unfortunately people buy crap and put up with it
If we all bought just the Bluetooth radios that worked Realtek would maybe make better ones 🥲
(Realtek Bluetooth crashes for some of our uses every couple of minutes)
=> Realtek
=> Good chips
Pick one. The amount of work I sunken into debugging their ethernet drivers cannot be overstated. After talking with some of their engineers (my workplace has some partnership so we sometimes hang out) it's partially a cultural problem there.
@nocturne hinge I converted your message into a file since it's above 15 lines :+1:
Feb 04 11:21:44 homeassistant systemd[1]: Starting bluetooth.service - Bluetooth service...
Feb 04 11:21:44 homeassistant (uetoothd)[476]: ConfigurationDirectory 'bluetooth' already exists but the mode is different. (File system: 755 ConfigurationDirectoryMode: 555)
Feb 04 11:21:44 homeassistant bluetoothd[476]: Bluetooth daemon 5.66
Feb 04 11:21:44 homeassistant bluetoothd[476]: Starting SDP server
Feb 04 11:21:44 homeassistant bluetoothd[476]: profiles/audio/vcp.c:vcp_init() D-Bus experimental not enabled
Feb 04 11:21:44 homeassistant bluetoothd[476]: src/plugin.c:plugin_init() Failed to init vcp plugin
Feb 04 11:21:44 homeassistant bluetoothd[476]: profiles/audio/mcp.c:mcp_init() D-Bus experimental not enabled
Feb 04 11:21:44 homeassistant bluetoothd[476]: src/plugin.c:plugin_init() Failed to init mcp plugin
Feb 04 11:21:44 homeassistant bluetoothd[476]: profiles/audio/bap.c:bap_init() D-Bus experimental not enabled
Feb 04 11:21:44 homeassistant bluetoothd[476]: src/plugin.c:plugin_init() Failed to init bap plugin
Feb 04 11:21:44 homeassistant bluetoothd[476]: Bluetooth management interface 1.22 initialized
Feb 04 11:21:45 homeassistant systemd[1]: Started bluetooth.service - Bluetooth service.
Feb 04 11:21:45 homeassistant bluetoothd[476]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
Feb 04 11:21:45 homeassistant bluetoothd[476]: sap-server: Operation not permitted (1)
Is your pi within a metre of the washing machine?
(The errors in the linked ticket are consistent with a range issue)
(Many people in here have struggled to get more than a couple of metres out of their pi at best)
An external Bluetooth dongle on a usb cable (to get away from interference) can help, so can ESPhome based Bluetooth proxies (if the custom component uses HAs Bluetooth APIs fully)
I also have Shellys with can be used as a proxy or a bluetooth extender? but this isnt working. Maybe I will buy one.
And to your question, yes, but there is a wall in between.
Thank you for your reply
Shelly’s can increase the range that you receive Bluetooth broadcasts, but not the range you can control stuff
For that integration you’d need an ESPhome bluetooth proxy
ooh okay, thank you. good to know
can't you flash shelly with ESP?
I don't know, but even if I could, I wouldn't want to "waste" a Shelly.
You can but most of mine for example don’t have esp32s, and we need esp32 for Bluetooth stuff.
The ones that are left aren’t exactly stunning in terms of range
(They tend to be installed in places that reduce signal strength)
hey folks. I never integrated anything bluetooth in home assistant. Has anyone integrated a switchbot/fingerbot with it?
I have 8 Switchbot devices, all connected via bluetooth with the Switchbot BT integration using esp32 bluetooth proxies.
They all work great, but in my experience proximity does matter. I noticed much slower responses the further away a proxy was.
Now I have 4 proxies and every Switchbot device is near one so they all respond pretty quickly most of the time.
chance of any oral-b bluetooth working?
@fringe field with raspberry OS the bluetooth chip still works, i guess it just overheats and shuts down? i recently moved the raspberry into a server rack (just laying in its case at the top of the rack). maybe it cooled down enough while i took it out of the rack to install raspberry OS
Hard to say. You’d have to run HA out of the rack to test the theory I guess.
The rack would be terrible for the signal regardless
it was running fine before i moved it into the rack, and then it worked fine for like a week
Run it out of the rack for a bit to rule out any updates causing the problem
Then put it back and see if it happens again
Hi all. I was wondering if there was a way to use the integrated Bluetooth adapter in my PC running Home Assistant to pair to a device and act as a Bluetooth keyboard.
I would like to run a few automations on my Macbook. Potentially waking it up and unlocking it when i get close to my desk on workdays.
I searched around a bit but couldn't find anything related. Maybe I'm not using the right keywords.
Does anyone know of a resource I can review to help me understand device support when using BT proxy? I thought it was not working but have since confirmed it is... and perhaps I am dealing with a device support issue in HA.
It should support every device that HA has a BLE integration for
So if you have a inkbird, you’d read the docs for the inkbird_ble integration
If it’s a Xiaomi, the xiaomi_ble docs can help
And so on
So I have hard coded a BLE integration for the xiaomi's I have all over before and gotten them to work when specified over ESPHome, but the same devices under BTProxy are not represeted in HA directly... In working with ESPHome, we believe they are being seen and proxied and HA is just not doing anything with them. How can I pick up the troubleshooting from ESPHome to HA for BTProxy?
my lil mija's have stopped talking to HA when I started trying to use BTProxy
@idle basin both oral b devices that are in the house work with no issues. I have several Bluetooth proxies
hey there!
I got a birthday present of this cool LED Matrix
https://www.amazon.com/iDotMatrix-Programmable-Creative-Animations-Accessories/dp/B0CGJ57Y9M?th=1
Is there a way to control / send messages to it via Home Assistant somehow?
Thank you!
Hey all, I've been messing with ESPresense using ESP32 boards and M5 Stacks. I am currently using my phone as a tracker however I don't carry my phone 24/7. ESPresense lists a few wearables, including a ultahuman ring. I was wondering if anyone has messed around with any other smart rings for bluetooth tracking and presense detection?
Only BT beacons, like keychain type beacons. If it sais it supports it then it should be like any other device you've set up.
I'm a fan of bluecharmbeacons, just throw one in your pocket when you put your phone away. They are very configurable and some have a button to trigger automation or whatever. You can also set them up to only transmit if it's moving. Theres lots of options. I figured out how to pull poll then for battery level so you can track track that too.
Thanks! I'll check them out
The person who operates bluecharm is another HA user and he/she is in the HA forums if you ever have questions or whatever. It's a good product with good customer service and it supports another HA junkie. I'm happy to advertise and support things like this.
👍
An update from a few days ago seems to have broken HA's ability to see my switchbot blind tilts current position.
They still work just fine, but I'll still get an error message that the service call failed
Plus when I check on them, their open and close status is unknown and stuck at around 70% up.
Any idea what's going on here?
One more thing, only the Blind tilts are affected. All my other Switchbot devices using the integration seem perfectly fine.
I'm seeing this as well
I downgraded back to 2024.1.6 for now, and things are working correctly
I like the 2.0 improvements but I may bump back down until the next one fixes thing. Oh well 😔
Same...but seeing all the blinds show as "Closed" in homekit was frustrating my wife to no end...so i'll have to resist my desires to always to be updated 🙂
ble on esphome statically vs ble proxy humidity value differences
Just want a sanity check: a Feasycom BP108 should get picked up by a bluetooth proxy, right?
yes
I have a RPI 4 with Home Assistant 11.5. I want to try and controll my BT spotlight devices in my roof.
They are being controlled by a Vadsbo dimmer (https://www.vadsbo.net/en/product/ld220wcm/). I can controll them with my phone with an app called Casambi.
1: Would I be able to controll it through Home Assistant on my RPI 4?
2: Do i need to buy some hardware or anything to be able to controll BT devices?(as for zigbee i need to buy a usb stick)?
i'm getting error on install libraries. when i clone git repo of core then i run setup bash file but there i'm getting issue like below:
no such option: --config-settings
hey, so i have a raspberry pi 5 running HA under qemu.
I am having trouble HA discovering any bt devices.
I am using the following flags on qemu:
-chardev pty,id=charserial0,path=/dev/ttyAMA10 \
-device virtserialport,chardev=charserial0,name=org.qemu.bluetooth \
any ideas on what I may be doing wrong?
Updated to 2024.2.2 and my Switchbot Blind tilts are back to normal again. Yay.
I installed a Bluetooth USB adapter today, my Home Assistant instance detected it and an "iBeacon Tracker". What exactly is it? I tried reading the documentation but it's not clear.
- Is the iBeacon my Bluetooth adapter, or is it detecting another device?
- Is iBeacon similar to AirTag?
It detects other devices. It’s surprising what devices implement the protocol and are trackable. Even off the main road I end up with quite a few detected devices. It can be hard to detect what they are though.
I would say similar to AirTag but not as good - less private, no find my network
Android users try to use it for phone presence detection though the apps for doing that in Android aren’t very good
For iOS you would use private ble device for similar phone detection
You’d usually use multiple esphome proxies for reliable coverage with the trackers tho
Interesting. I'll probably get at least one ESPHome device that supports Bluetooth presence. Is that also done through iBeacon?
Esphome Bluetooth proxy’s work like ip based Bluetooth dongles
So any integration you can use now (like iBeacon or private ble device or the basic ble tracker) will continue to work (but with better range) when you have multiple proxies
They work 2 way too, so you’d be able to control things like lights or curtains too (if there is a HA integration)
speaking of bluetooth proxies: i've got a bluetooth body scale (the xiaomi one) and it doesnt seem to reliably update in home assistant. so i grabbed another ESP, made it into a bluetooth proxy and put it closer to the scale (like 1m with a thin wall in between). but it still doesnt really reliably update.
are bluetooth devices in some way bound to the proxy they were originally added to HA with?
i'm assuming no?
its a bit annoying. its not like its critical for my weight to update in HA, but it would be nice
I've got the same scale. I didn't realize it could connect to Home Assistant! It seems to work immediately for me
They are not bound no, they are very good at coping with the device moving around.
If you have a WiFi based proxy and it doesn’t have an external antenna and it works intermittently I’d still be dubious of the wall.
We have some combinations (mostly locks tbh) that only work at 30cm with no wall.
i'll have another look then, make sure the proxy works as intended. i just used one of those m5stack atom lite i still had around
i'll first ensure that its actually working properly as a proxy, and if thats not the issue i'll throw a different esp there, maybe even one with an external antenna. i have a bunch of different ones around, the atom lite has the benefit that it comes mostly contained, i can just plug it in and throw it in a corner. for the devboards i need to find/print a case 😄
if the other ones dont work, i'll give that a go. but at 30eur shipped vs. a few bucks for most esps, thats a bit of a difference 😄
How does Bluetooth work with ha typically?
So eg I have a Bluetooth dongle. For that I have a single Bluetooth integration configured. The range is poor so I also have a bunch of GL-S10 running esphome. Plus some Atom Us also running esphome. They are all configured as Bluetooth proxies, and are managed under the esphome integration. HA has a Bluetooth manager that can make all these devices seamlessly work together so I have full house coverage.
Then I have a bunch of homekit_controller (now homekit device) integrations that control Eve devices over Bluetooth. Using the Bluetooth manager they will connect to the Eve from the best ESPhome or dongle.
I also have some inkbird and BTHome devices collecting temperature data.
For all of these Ha actually detects them automatically when your dongle or proxy is working.
Some do require more manual work. Private BLE device is one - it needs an encryption key. Once it’s set up it lets HA know if I’m home or not without needing apps or anything. I use that to turn on the porch light when I’m home. And to arm/disarm the alarm.
I don’t know if that’s typical but that’s roughly what I have @sturdy compass
Thank you, I'll keep this configuration in mind if I decide to implement it, atm I've mostly invested in building a Zigbee network so perhaps I should try to stay in that ecosystem.
Bluetooth looks appealing though due to the low price point
I hear you. I’ve actually flashed some of my Xiaomi ble devices with a custom firmware that gets them onto my zigbee mesh.
Which firmware?
there is also https://github.com/devbis/z03mmc
pvvx is potentially better (claims to be much more power efficient), though the way it has been handled in z2m is not great. ended up with 2 firmwares with different clusters, so pvvx needs an external converter right now.
however i have 4x LYWSD03MMC that were originally BLE running on my zigbee mesh for about a month i guess
Neat
Huh I didn't know you could do that
Really neat
its a very recent discovery!
I've been trying to add some govee bluetooth devices, and when I click add device, it almost immediately says "No new devices found on network"
Like I see a flicker of a menu before it switches to that, as if it never attempted to search for new devices
It’s always listening, so it’s almost like it’s always searching, so the add step is always instant for that integration.
Most likely causes of that are (a) your Bluetooth dongle crashed. If it’s Realtek based, it’s probably that. Internal (intel or pi especially) are also frequent offenders. Powering down your HA box, unplugging for 30, then trying again will help briefly for a subset of these cases (might be minutes, might be hours, might be days).
(b) interference. Make sure you are using a usb dongle not internal. Make sure it’s connected by an extension cable to get it away from usb 3 and sata.
(C) distance. Try bringing them within half a metre and see if they are detected. There are combinations of devices and dongles that only work at that distance. They are usually locks, but. But there are so many variables best to just try this,
(D) New unsupported device. If it’s on the list on https://www.home-assistant.io/integrations/govee_ble/ it should be working.
Govee is a very simple integration so if youve checked those things it’s probably time to raise an issue. Make sure to include what devices you are adding, what Bluetooth dongle/proxy, the distance betweeen them, that you are using an extension etc.
I think it's a supported device issue. Looks like the govee Bluetooth integration only really supports climate or meat sensors.
I've got some questions about the ESP32 BT Proxy and a temp sensor Xiaomi MiThermometer LYWSD03MMC flashed with the pvvx firmware & set to BTHome protocol. I don't think I set up encryption within the firmware settings so my HA instance automatically discovered the thermometer via the BTHome integration, or at least I'm not aware of adding it manually via BT MAC, etc.
-
So I assume it's broadcasting its sensor readings to anyone with a BT protocol viewer?
-
If I were to bring up another nearby HA instance with its own BT Proxy, would it also autodiscover it to? Or is this device sorta "locked" to my HA instance?
-
I'm confused about https://esphome.io/components/sensor/xiaomi_ble.html#lywsd03mmc. Do that sensor yaml go into HA itself or do I tweak the ESP32 BT Proxy yaml and recompile it? The docs aren't very clear about that part. And do I just create my own bindkey and make sure it's the same in both the pvvx firmware settings and in my yaml?
Thanks!!
Yes. The advertisements are broadcast. Yes another HA instance with its own bt dongle or esphome ble proxy can also discover and use simultaneously. I think the default ble proxy settings will poll (aka active) for ble devices
I don't know the effects on sensor battery of multiple things polling
Then link and config you pasted is for explicitly defining the sensor in esphome. That would not use ble proxy
Some people think active scanning barely uses any more battery, or makes no difference whatsoever. But if you end up with lots of proxies you can set some to be active and some to be passive. some people deploy them in pairs, with one active and one passive.
That's a good point. Let one trigger them all. (That see the scan)
Morning folks 👋 My latest set of LEDs have a BLE UART profile (yes, really!) and you have to send bytes over serial to control it. I have no idea why they have done it this way, but they have. So what I thought would be a few hours of integration work has now got me wondering... does Home Assistant have support for the BLE UART profile, specifically the Nordic spec (which is what Wireshark tells me this is using).
I'm not even sure that it would be possible to proxy this via the ESP Home proxies, but maybe? It doesn't seem to be syncronous. You just fire the bytes off and hope for the best.
So before I spend too much time on this, will it ever work via HA?
right now bluetooth in HA supports either reacting to data encoded in advertisements, or GATT. and thats it. we certainly don't support the "classic" bluetooth UART.
if BL:E UART is built on top of GATT, it could work. pretty sure we have seen devices where 'UART' is done in GATT by having a read and write characteristic, and you use the GATT notification mechanism to get asynchronous data back from the device.
Yeah, it's over GATT, not classic Bluetooth. This thing doesn't ever return any data by the looks of it.
if its actually GATT then it will work, and it will work with the proxies. In theory at least.
Neat! So I would just connect to the characteristic as normal, and just write the bytes? Now I come to think of it, that makes sense. Because, as you say, if it's over GATT then really it's just "write some bytes to this characteristic". I'm going to give it a go... (GH repo here for anyone interested: https://github.com/8none1/hilighting_homeassistant)
Yup, it just works ™️ 🎉
Are there any troubleshooting steps to check if an ESP32 bluetooth proxy is working correctly and in active mode?
Ive got only one BT device with HA integration (Ember mug) and while its being detected and MAC address discovered, im getting:
2024-02-14 10:29:13.956 WARNING (MainThread) [aioesphomeapi.connection] bt-proxy-masterbedroom @ 10.10.10.185: Connection error occurred: [Errno 104] Connection reset by peer
so im not sure if thats a problem of my esp32 bt proxy, integration, device, or something else
That error looks like a tcp ip failure rather than a Bluetooth one. Most likely causes are either the esp has a weak wifi connection and keeps dropping off or esp itself is crashing.
Did you configure / compile the esphome firmware yourself? If so, did you set it to use esp-idf?
ESP is actually on wired ethernet
its GL-S10
i used the website which flashes GL-S10s automtically, dont remember the url now
So you know about the packet loss on those, and adjusted the clock pin accordingly for your hw rev?
Sorry on phone so can’t fish details out but my gl-s10s had to use a different GPIO config to avoid it
No, never heard about it
ok one of my GL-S10s is 1.0 but the other one is 2.1
Followup question, will the Bluetooth proxy allow my device to connect to any of the bluetooth proxies - for example the closest one - or just the one which was closest at the time of pairing?
but also, is there really no place where i could find for example the list of bluetooth proxies in my environment, information which one works, which one is active, etc?
for example besides a couple of GL-S10 i have Everything Presence Lite with bluetooth proxy firmware installed in several places of my home
It will use the best at any given time
That might not be the closest - for example it is aware of how many connections a proxy can support (2 for some) and will use another in that case
You can move around the house and see the proxy change
I think the information is there in the backend but no one with front end dev skills has taken up the challenge
You can see the Bluetooth state for each proxy in its diagnostic json
im asking because i think (might be wrong) that the bluetooth device will store a mac address of bluetooth host, doesnt it?
I don’t know what you mean
when i paired my Ember mug with my HA, it stopped accepting connections from a phone it was paired with before
so the mac address of device its paired to must be stored somewhere on the mug
so my worry is that the part of my issue might be that it has paired with one proxy and trying to connect to another proxy
So all of the devices Ha support don’t have that limitation. So indeed that could be a problem
(i have disconnected GL-S10 2.1 but still have problems with connectivity to the mug)
Do you still have that tcp error?
I am using a Raspberry Pi 4 with Home Assistant 12.0.
I want to use the onboard bluetooth to controll some BT devices. I see that a Bluetooth integration came with the installation of HAOS. But when I try to add a entry I just get a message as of "No unconfigured Bluetooth adapters found. There are 0 ignored adapters.".
What could be wrong?
hard to say, i have removed the mug from HA but now cannot readd it (its not detected for pairing)
so kinda a different issue on the top of the previous
Hi all,
I'm trying to integrate a Procaster PRE-01 sound system with Home Assistant running on a Raspberry Pi 3, aiming to control it (on/off) via Bluetooth.
Issue: The device isn't recognized by Home Assistant's Bluetooth tracker, so I cannot see the Procaster PRE-01 in Home Assistant besides that they are next to each other.
Goal: Automate turning the Procaster PRE-01 on/off through Bluetooth.
There are no integrations for the Procaster in Home Assistant and I do not have a clue about what could be done
Thanks for any insights!
https://esphome.io/components/ble_client.html "A maximum of three devices is supported due to limitations in the ESP32 BLE stack. If you wish to connect more devices, use additional ESP32 boards." Does "BLE stack" mean the Espressif IDF BLE libraries? Does anyone know if this limitation only exists in the stack or at the hardware level? And are there other microcontrollers out there (not Espressif) that can connect to many devices? Please 'reply' so I get notified. Thanks!
We already had to switch from the standard Bluetooth stack esphome uses to bluedroid to get BLE working well at all. I believe there is a third called NimBLE.
But actually these connection limits are pretty common. USB Bluetooth dongles have similar ones. I think there’s one chipset that can handle like 5 or maybe 7 connections, and it does so at the expense of speed.
Not aware of any device that can handle more than 7 at once
Which isn’t what I’d call many
Important to note that this is active GATT connections - a lot of devices don’t need that.
There no limit on devices that put sensor data in the advertising beacon (like inkbird or Xiaomi sensors)
And eg homekit will connect once to establish a secure session key. Then only connect again for 20-30 seconds when you control a device (eg turn it on)
Where you truly do need long lived gatt connections (I think one of the mmwave presence sensors do) then the only work around is to use esphome bluetooth proxies and have lots of proxies.
HA can load balance across them in a way that you can’t do directly on esphome with a single bleclient.
I’m wanting to use a lot of those cheap iTag clickers to use for automations. I dunno what kind of BT receiver they use, but I’m guessing they don’t transmit too often… other than periodic battery level updates I’m not sure what else these things relay on their own. I was just wanting to avoid needing 1 esp per 3 itags.
Is it possible to use a phones bluetooth as second bluetooth device?
Hm. A need a portable bt scanner 😅
Esp 32 with a usb battery
WiFi range
hm thats an issue. I net an protable scanner for external network
That’s connected to home assistant?
Yea
What are you doing
Bluetti EB3A. I need that stats from it
When i go camping i need that stats on my dashboard
You want data from your camping gear to get transmitted back to your house, so that you can access it remotely on your phone?
Yes
Would a pi running a 2nd home assistant just for your tent “home” (Tent Assistant) be any good? Both iOS and Android support multiple homes.
Otherwise you can probably make some kind of Frankenstein vpn setup for the esp32. Have it connect to a hotspot on your phone, and have a vpn to your house etc.
Though tent assistant would work even if you don’t have cell service
I would do that but we are not allowed to connect such devices to ghe Camping hotspot
esphome tbf has VPN support now
but you'd still need to hotspot the esp32 onto something
wireguard is nice!
Uhm guys. I need help. I plugt in a bluetooth dongle and deaktivated the internal bluetooth chip from my raspberrypi. Now nothing with bluetooths works. the dongle works perfekt on windows. Why does this happens?
I would like to check if and when our phones are in a specific room: would it be best to use NFC tags - and does this get picked up automatically, or is there a better way of handling this?
Wow, my english is good today
I tested it. When i deactivate the internal bt from my pi then the pi founds nothing with the dongle. When i turn it back on everything works.
Do have to configure something to scan for devices with the second bt device or whats going on. I tryed multible times rebooting but nothing helps
What Bluetooth dongle did you get, is it one from the list on the HA documentation?
a realtek
Buy one from the list on the HA documentation that had been tested. Broadcom or CSR.
just a second i check complett name
Realtek are known to be crap
strange thing. the dongle works perfect on windows or normal linux
They lock up all the time
HA is probably a bit better at triggering the bugs but they are there on normal Linux
hm. the dongle works but it dont scans.. idk whats that sh**
its an bluetooth 5.0 dongle. that should not be a problem or?
its from "UGREEN"
treiber whos loading are realtek
Anyone actually succeed at integrating a Level lock? I see a thread on the forums but have a question or two - namely, did you have to move your HA instance right next to the lock (as some have reported)?
I don’t know about that lock in particular but i do know some locks (deliberately ?) have really small Bluetooth range. We are talking 30cm.
I don’t know whether it’s a power conservation thing or a security thing, but it’s the TX on the lock, so outside our control.
I think one of the affected locks you can increase the range in the vendor app in some settings menu.
You don’t have to have your HA instance right next to the lock if you have an esphome Bluetooth proxy.
If it works but it doesn’t scan.. it doesn’t work 😅
Zero scan output is one of the most common ways in which Realtek Bluetooth devices fail under Linux
Even when Realtek “works” with HA it’s only because HA simulates usb unplug / plug cycles every few minutes to try and fix their crashes.
It’s not because it’s Bluetooth 5
Thanks! I actually bought and flashed one (perhaps prematurely). But I still have to use my 'main' HA BT dongle to add the lock device to HA before the proxy can help me, I think, correct? Or can the proxy actually be used to add new devices, as well?
I don’t know the specifics of your lock, but in general I’d expect you to be able to do this without having any dongle at all
Sorry, maybe dongle was the wrong term to use? I just mean, I presume that I can only add BT devices if they're within range (whatever that may be for the device) of my HA BT ... controller (is that the term? the thing that lets my HA hardware use BT), and not just if they're within the range of my BT proxy, is that correct?
A BT proxy (at least an esphome one) is for all intents and purposes a dongle that’s connected over WiFi or Ethernet
At least for BLE GATT
Ahh, okay, that's what I was wrong about / misunderstanding. Thank you!
The Shelly proxies can only proxy incoming broadcast data
But the esphome ones are full GATT clients and in some cases actually better than having a dongle.
Sweet, that makes me doubt less my decision to get one and implement it for fun (even though even if it was totally unhelpful, it was still only $15 and some time spent having fun).
There were reports by some that the Level Bolts wouldn't do initial connections through ESPHome proxies, but they connect via HomeKit as opposed to their own integration. Is this particular level lock also connecting via HomeKit?
*I don't know if the reports are accurate, but I mention the homekit bit in case it adds relevant information to the conversation. FWIW, my level bolts all connected from within their doors, and some were pretty far from the bluetooth stick in my yellow (none were incredibly close), so it may be feasible that they connected via a proxy (or I may have disconnectced the proxy to get them to connect and forgotten, it's been some time).
Homekit in general works very well with proxies
In fact, the ESPhome bluetooth stack (bluedroid) is often better than BlueZ
We have some HomeKit devices that are basically not compatible with BlueZ - e.g. older Eve devices that are slow and have lots of GATT characteristics. BlueZ can't enumerate them before hitting one of its hardcoded internal timeouts.
And they work with Bluedroid
HomeKit doesn't pin pairings to a particular device. And in the general case you can absolutely pair over a proxy. The encryption stuff is identical, because its implemented in software. You just read and write TLV packets to a GATT characteristic. And it does something very similar when connecting in future.
However that was enough context to find - https://github.com/home-assistant/core/issues/84112, which shows generic (i.e. usless debug info) connection errors from the proxy/level combo
if someone can repeatably prove that this is a problem only when pairing then i'd be interested in a bug report.
maybe we are reading a characteristic the lock doesn't want us to, though i don't know why bluez isn't affected if thats the case
and if its a connection failure, it shouldn't be limited to pairing time
Are there such a thing as bluetooth "modules" that are connectable up to an ESP such as via serial/SPI/i2c (maybe not even via ESPHome) that would allow many of them to be connected, therefore allowing lots of BT devices to be connected? Please 'reply' so I get notified.
You can connect lots of usb dongles to home assistant to do that
You can also connect lots of esphome devices to home assistant to do that
Even a mix of both
HA will pick the best one, even as a device moves around your home
If it had to be within an esp without HA you’d have more luck on the esphome discord
everything i’ve been able to find says discovered devices should just appear as new integrations waiting to be configured, and there is no “scanning” to do. I’ve got an esphome bt proxy and the linux host’s hci0 configured, and both appear to be seeing other devices based on their debug data, but no new integrations appear. any ideas? it feels like i’m missing something obvious.
My HA server isn't in a good location to put USB BT dongles. 😭 But on a positive note, my home is small enough that I can centrally place an ESP BT proxy to access my sensors. If I can avoid multiple ESP's each with its own space, power supply needs, etc, I'm interested in other ways to get lots of "connected-type" BT sensors on one though. Of course I realize that if there's no practical way to do it because of extra BT chip/module costs or whatever, then that's ok. This is kind of a exercise in "can I" versus "should I". That's half the fun of this hobby, right? 😆
What devices are you trying to add? Have you checked the HA docs for that integration in case there are special steps (eg private ble devices can’t be discovered until HA knows their encryption key). Basically, can’t help without knowing what you are trying to add!
I can see where you get your username then 🙈
The simplest option would be to get a non-GATT tag.
That would support an unbounded number of devices with a single module
BTHome and and Xiaomi ble probably have some button devices you could check out
BTW, I have a single Xiaomi temp/humidity sensor that I've flashed with the pvvx firmware and using the BTHome v1 format . I haven't had time yet to flash a newer version that supports BTHome v2 though. This particular sensor's board has support for a "binary sensor" in the form of solder pads to wire in a "reed switch"--which I've added. However, it doesn't seem that HA is able to reliably detect when the switch is on/off or is sometimes slow at responding--even when the ESP BT proxy is right next to it. I'm guessing that's just the device BT firmware being slow about sending those beacon/advertising packets, or maybe I have a lot of 2.4GHz interference in my area. 🤷♂️
https://github.com/pvvx/ATC_MiThermometer?tab=readme-ov-file#temperature-or-humidity-trigger-gpio-pa5-lywsd03mmc-label-on-the-reset-pin
I already have 3 itag clickers connected to my BT proxy and have a lot more itags I'd like to make use of. I also figured out the yaml to get double- and triple-clicks going, so that helped expand their flexibility a bit. I've been on the lookout for super-cheap tiny battery-operated button 'itags' clickers. If you spot any that are as you describe, let me know. 😉 I assume by non-GATT you mean they don't 'connect' but just do those beacon advertisements? That would be great to find cheap buttons that do that, or find a way to hack some to be able to do that... similar to how there's alternative firmware for Xiaomi temp sensors to add BTHome support.
before I switch my esp32 over to esp-idf ~does the Govee h5074 have support? i did a lgiht search but only found problem threads
Cross posting from the integration channel, Does anyone know if its possible to have a shelly device connected to HA via a BLE proxy?
Gist is that I have a shelly plug that can act as a passive or active proxy. Then I have a shelly H&T3 that has bluetooth. So Ideally Id like to connect the H&T to the plug via bluetooth to save on battery and avoid using wifi to connect to HA
I can’t answer the question directly but I can say that the Shelly proxy is only a partial proxy. It does active or passive scanning and hands the results to HA. It does not support GATT (which is needed for controlling stuff)
For temp and humidity there’s a reasonable chance that would be enough.
I don’t know what integration you’d use on the other side of the proxy though. Maybe they use BTHome?
I don’t think the Shelly integration would work tho
the shelly H&T gen 3 doesnt seem to be on the BTHome page, https://bthome.io/
When I click to add a bthome device it says none detected. Not sure if there is something specific I need to do or if it would be auto detected
Yeah it would be normally be auto detected if it was going to work
Hmm okay Ill play with it more. But the fact its not on the website doesnt seem promising
Im going to try to bring the devices really close together
having some trouble with a new homekit BLE device not being discovered in HA. it initially showed up once, setup failed, now it's gone and i cannot get it to appear again
found this in the logs: 2024-03-11 13:24:28.560 ERROR (MainThread) [dbus_fast.message_bus] "org.bluez.AdvertisementMonitor1.DeviceFound" with signature "o" could not be found could it be related?
tell me about your home assistant install
are you using HAOS?
I'm guessing not, and somehow passive scanning got turned on for your dongle
passive scanning on linux is experimental and requires BlueZ to be super up to date and configured to turn experimental mode on
@fringe field i'm using HAOS, passive scanning is disabled
Bluetooth Radio (0bda:8771)
by Realtek
Firmware: homeassistant
Hardware: usb:v1D6Bp0246d0548```
well at least we know its a cursed radio
if passive scanning is disabled it shouldn't be using that API
so the message is weird but i'd still expect it to work
i may have briefly put it into passive mode and then back
just been trying everything
that could explain it
the realtek radio - in the worse case those things crash every few minutes
i forget an important thing before though
HA tries to recover them from that state but it takes a couple mins to notice
so for something like a temp sensor or an ibeacon, it kinda looks like its working
(and it kind of is working enough, barely)
some don't have functional USB reset, and then you have to unplug them. but the others kind of limp along working about 10% of the time, capturing just enough BLE broadcasts to look like they aren't a hot mess
(we prefer CSR and broadcom in the docs, or ESPhome proxies)
maybe I should try a different dongle then?
a store nearby has Asus USB-BT400 in stock, but can't find what kind of radio that is
thank you so so much for your support btw
NP
thats a BCM20702A0
(Broadcom)
the docs have a warning about those and HAOS
might work, might need updated firmware
i think im currently using an LM Technologies LM1010 (as well as esphome proxies)
which has the same chip
i think i did end up upgrading the firmware (but im not running HAOS in production)
ok so i have the iphone here now
when trying to pair it says "device already connected to another home"
so that would explain it
clearly the blinds aren't reset right
interesting question: i have 1 bluetooth adapter in my HA, then 2 ESP32 to extend the network. is it possible to determine which bluetooth adapter a bluetooth beacon is near? for example. if my cat has a beacon on and goes into the living room near that ESP32, could i somehow see that? other than the distance being 0-10 feet in HA. trying to track when XYZ beacon goes near a specific ESP32 device.
yes and no
the information is in HA, as thats how HA works outh which proxy to use when connecting to a bluetooth device. but its not generally user facing.
private_ble_device does expose it as an entity or attribute or something
but i think the main generic ble tracker needs some love to bring up to current best practices, then it could probably be added to that
is this an add-on or something?
An integration
It’s for devices like iPhone that use an encrypted rotating MAC address to protect your privacy from trackers in public places
gotcha
It will tell you an estimated distance d and the MAC address of the nearest proxy
Though I use estimate lightly
and that would that work with my little bluetooth beacons?
Do they have random MAC addresses?
nope
You probably want the main ble tracker. But that doesn’t have the extra entities unfortunately (it’s basically unmaintained)
If you know python and want to maintain a part of home assistant it is doable
unfortunately not to any level i would brag about lol
Then right now you are out of luck unless you look into custom components or addons and custom firmware.
Espresence is another esp firmware that has a main role of indoor positioning. It does not work as a proxy.
np. thanks for answering.
I believe this is the closest thing to what you’re asking: https://github.com/agittins/bermuda
i need someone to explain the esphome bluetooth proxy. i bought some esp32's but i dont know exactly what im trying to do with it
basically i just wanted something continuously running scans and maybe sending a notification when something new shows up
i went to the esphome bt proxy page and used the webpage to flash the esp32.. then i added that in HA integrations but it has nothing except a "safe mode button". i was confused but then i installed esphome addon and "adopted" one of those chips, which seems to have installed a buttload of code on it. not sure what is next
That’s basically it
It is scanning in the background right now and if it sees a compatible device it will pop up a discovery for the relevant integration. If you had switchbot devices it would prompt you to setup the switchbot integration. If you had xiaomi devices it would offer the Xiaomi BLE integration
Nothing else is happening because it can’t see a device that has a compatible integration
It sounds like you want this integration - https://www.home-assistant.io/integrations/bluetooth_le_tracker/
Though it’s one of the less maintained integrations.
ah ok thanks. I did see it add a new device
it's pretty transparent
what I don't understand is what happens when I adopt this in esphome
seems like maybe it becomes a more modular device and I can upload a config telling it what I want it to do
ESPhome is a way to make programs for an esp chip without writing real code
It can work independently of ha
So you could have automations running on the chip even if HA is down
Or even if you got rid of HA
It turns a yaml config file into C++ code and builds it and manages updating it
There is some crossover but because one is c++ and one is python is not exactly the same
The point of a Bluetooth proxy is just to be like a virtual Bluetooth adapter for HA that’s in a different location to your HA machine. It uses the code in HA to talk to your devices, not esphome code.
If you use esphome directly then it could talk to your device instead and run automations directly on itself.
But HA can aggregate multiple proxies and handle load balancing over them or failover if one proxy is down. It has integrations that need less config. It has integrations ESPhome doesn’t.
The main purpose for the ESPHome addon for proxy users is just firmware updates
The image you initially flashed was a pre compiled esphome image. Adopting it hasn’t changed anything, it was esphome and it still is esphome. But now you can wire up your own electronics to it as well if you want, and configure those through the addon.
I have proxies in my ESPHome addon that are dedicated to proxying. I have others that are full blown home made devices .id generally say not to mix both on the same chip.
Do any of you guys own the Switchbot Lock?
I'm thinking of getting the Lock Pro and was planning on using it with Matter. But also thinking about using it with a ESP32 proxy.
Just wondering how fast it works with a proxy. The other SB devices I have vary in speed.
At times they work really fast and slow. I wonder if the Lock is more consistent or it also varies?
Hi. I am running Home Assistant through VS Code. I do it by opening Docker Desktop, then navigating to HA folder on VS Code. Then a pop up shows up in VS Code asking if I want to run in a devcontainer. I press "yes". How can I make USB-BT400 Bluetooth adapter visible in my HA in such a situation?
I’d expect that not to work
You need the docker for desktop VM to be running BlueZ (I don’t think it does) and for the VM to support USB passthrough.
Generally even if you were to go to a proper virtualisation setup but still relied on USB passthrough, you’d probably still have problems. USB passthrough being rubbish is the 2nd most common complaint on here after Bluetooth adaptors being rubbish.
maybe you know some tutorials to do it on Windows? Did a quick search, but I was not able to identify useful information. Of course I will spend some more time Googling it
No
We see people using a proper dedicated virtualisation by running HAOS in virtualbox. But they usually end up in here with Bluetooth reliability problems.
For people doing development we usually say to use esphome Bluetooth proxies instead of usb dongles
but is it possible to use USB dongle for development, just very hard to implement?
It works on Linux and Mac
got it
Hi, I'm still rather new to HA and just got my green set up and running. I now want/need to add Bluetooth functionality. Anyhow, all USB dongles listed here: https://www.home-assistant.io/integrations/bluetooth/ are currently not / hardly available (I'm located in Europe) and quite frankly father old (BT version seems to be 4.x for all listed devices).
Which BT 5.4 (or at least 5.x) dongle can I use if I don't want to resolve to using ESP32 to add BT functionality to my HA green?
Hi, my Bluetooth integration shows two devices, one of which has been stuck on "needs attention" / "failed setup" for days. Here are some screenshots: https://imgur.com/a/9wIMGiS. Some more info: I have a HA Yellow with a CM4 with BT. In case it's related, I also have an ESPHome with the BT proxy firmware on it. Thoughts on how to address this "needs attention" "device"? Thanks.
HA doesn’t use any BT5 features. Linux (and Bluez) don’t have support for many of them. Eg Bluez doesn’t provide a way for us to use long range mode. So you won’t be any better off with a BT5 dongle than a BT4 dongle. And actually driver support on Linux will lag a bit so it might be a worse experience.
If you must have a newer dongle then the main advice is to get one that explicitly supports Linux, and that support needs to be upstream. If it’s not upstream you should avoid it. If you are running HAOs, the firmware needs to ship with kernel. There’s no way to side load it.
If you look at the docs you’ll get a sense of where the vendors are: Realtek is great if you want a new hobby unplugging and plugging in usb devices, one is best for speed, one is best for number of devices at once.
Aim for one with an antennae and try and use a sub extension to get it away from interference your computer generates
I should add that Bluetooth on Linux is a little bit stagnant. Even passive scanning, which has existed since before the new Bluetooth features in HA, is still hidden behind feature flags in BlueZ. I think it will be a long time (if it happens at all) before things like long range trickle down from Bluez into bleak and then in Ha.
The Bluetooth integration is for Bluetooth dongles internal and external. So my guess is that you have internal Bluetooth and a dongle, and one of those doesn’t work, or you have something visible to BlueZ that looks like a dongle but it’s no longer there.
AA:AA:… is weird - did you edit that? If you didn’t then I’d guess something weird happened when you added a dongle. Like it was momentarily visible to Bluez with the wrong MAC address. Maybe a bug in its firmware loading?
Unless you expect to have 2 functional dongles you just need to delete the one that’s broken.
It might get rediscovered as a new dongle. In that case mark it as ignored.
I don’t expect to have two functioning dongles, I thought I had only one BT controller (on board the CM module), and I didn’t edit that name, so I can safely try to delete it, you think?
Is there a way to manually search for devices. Most of my BT temp sensors were found by HA automagically. But I have these 2 small ones that work with Tuya Smart Life but Home Assistant is not showing them
i guess i need to know how to figure our more about the devices too. Do I have to crack them open or is there a way to figure out what they are from the tuya app
the tuya app isnt staying connected to them so they are useless for history right now
Yes.
No there isn’t such a thing as manually searching in Ha. HA is always listening for near by devices.
Sometimes if you cancel a discovery by accident it won’t come back by itself without either restating ha or going on to “add integration”. But that won’t do a new search either.
Darn. i was hoping there was some sort of BT scan that could at least show me if HA sees the device
Alternatively, is there a way to change teh BT device. I bought a BT dongle and cant figure otu how to make sure HA is using it instead of the built in BT
I want to ensure its not just a range/power issue
You can download the diagnostics json from the Bluetooth integration
That will have all the MAC addresses it can see
i googled the hell out of it but everything I found about switching BT didn't seem to work
I had to unplug my BT dongle because it was causing performance issues, presumably by drowning out my proxies, so I can't verify this, but I think you can see the BT MAC address in the BT integration. In that case, if your BT dongle has a MAC address documented, you could check the integration to see if it matches.
Hi everyone! I'm trying to integrate my SwitchBot Hygrometer with Home Assistant using a Bluetooth dongle. While I was able to connect it, I'm having trouble getting the absolute humidity and VPD data to pull through. Could you please advise if it's possible to do so and how I might go about it?
sounds like a strange issue. in the integration are those properties "enabbled"? i know sometimes certain things are disabled yby default
If you are looking for a Bluetooth Gateway in the UK then you might be interested in this unit:
https://www.amazon.co.uk/dp/B071JR9WS9
I got it working very easily with HA.
I can't find a good answer. Can home assistant track tiles? I just want the ability for it to tell me when a tile is in range.
I'm hoping the stronger By of my HA can detect it better than my phone. I'd be happy if there were an integration that just scans and reports whenever a particular device is in range
I just started working on that myself. I have four tiles and setup two M5 Stamp C5 Mate boards with ESPresence - one in bedroom and one in living room. It's sort of working but the tiles keep alternating between bedroom and living room. I've not had time yet to figure out why...
There are integrations that do that, but devices that care about your security and privacy randomize their MAC addresses. So you can’t target a particular device for scanning.
@oblique oak thanks for the approval of the motionblinds Bluetooth integration 🙏🏻
Great to see it in the next release.
I do have two bluetooth proxies setup in HA and they appear in esphome under devices - any way to check/test if they are working well?
I have 4 and I'm honestly unsure too although I think I have an idea.
Two of them always change between unavailable and unknown. I think when it says unknown it's working.
But the other 2 I have never shows any activity. I press the safe boot mode but it still doesn't say unknown or anything else.
So I feel like they're not working properly. But I've never taken the time to learn for sure.
Check diagnostics, if it can see bluetooth devices, its working
Hello! Sorry if this has been asked a billion times before but: My understanding is that directly connecting custom (i.e. esp32/pi) bluetooth sensors to HA is a pain because reasons, and it's suggested to use a ble proxy on an esp32 or similar. This will then allow HA to see bluetooth devices connected to that proxy, but would still only work for known integrations not any custom ble service i might write. In that case i should also tag on an ble<->mqtt gateway so i can subscribe to sensor thingos. Is this about correct? If i want an mqtt gateway do i still need a proxy or i can bypass that altogether and run the gateway on esp32? Thanks!
Oh also would this work in the case i want to control a device via ble as well or not really?
MQTT are not part of the native ESPhome Bluetooth proxies in HA experience. So you shouldn’t need both if you go down the DIY route.
However keep in mind that there are lots of smarts in HA, like handling multiple proxies (de-duplication of incoming packets from multiple proxies and working out the best one to use for GATT) and to minimize CPU usage in general.
HA will not only pick the best proxy for a device automatically, but it will fail other to another one if there’s a problem with the first. For example, esp can handle like 2 or 3 GATT connections at once. So HA tracks that and doesn’t over fill the ESP.
I have no idea what MQTT solution you are thinking of but it likely won’t do everything HA is doing.
Thanks for the reply and info! I guess i was going down the mqtt route because i couldn't find a lot of info on developing + connecting custom BLE services to talk to HA. For simple passive broadcast stuff it seems there are things but for bidirectional control (i.e. a sensor + a button to control stuff) i hadn't found much info, would be great if you could point me in the right direction if that exists
Is BTHome a reasonable starting point?
BTHome is a good place to start for designing your own Bluetooth device
If you follow that protocol you won’t need a custom integration
(But it’s for passive sensors)
https://bthome.io has a list of example devices following the standard
But if you want to do GATT then I’d start with something like led_ble maybe.
Or prove it works outside HA by directly targeting bleak
Ah right so just to clarify, where should i look for nonpassive devices, i.e. ones i want to control from inputs in HA (like a switch kinda thing)? I'm certainlly gonna do baby steps of setting it up over wifi first, then getting it to work over a couple of ble devices talking to each other, but just so i know what i'm aiming for for the final version...
Find existing integrations for that kind of device. Here is the one we say for lights for example.
i'm looking for a cheap tag i can put in my daughter's school bag so when she comes home from school, the door is automatically unlocked
(yes, this is not a very safe option, but i live in a rural area, so the locking of doors is just a general indication of the human presence within)
is this something that would just work in general: https://www.aliexpress.com/item/1005006149561601.html ?
It’s hard to even know what integration something like that would work with. Some rotate their MAC address so you’d need something like the private ble device integration to see them. Or maybe they’d be ibeacons.
I know some people here have ibeacons strapped to their bins. But can’t remember which ones off hand.
heyho, i got a ThermalPro TP358 - which keeps a time/date. Sadly it drifts a lot and the official integration does not have a way to set the time. I would like to add this to HA, there is piror art in https://github.com/koenvervloesem/bluetooth-clocks - but I can't use this as I don't have a bluetooth adapter in an opportune place - I have several BLE proxies for HA through. What are my options?
A custom integration? Has someone already done this before? Essentially i just need to generate a bytestring and chug it at a specific endpoint of the device.
Got recommendation for something that works, then?
I have 2 Blue charms that work well
Asking the same question. Bought maybe by mistake M5 atom s3 lite and struggling to install BT proxy on it. Any help on this is appreciated
yes, you can add this
bluetooth_proxy: active: true
Thanks do you have a sample yaml file or link to one that works.
You just need to add that to your existing yaml and whatever else you want to run on the board
Is there a concept of a Bluetooth mesh network?
Yes
There are a couple of mesh protocols iirc
The one that ships with bluez conflicts with bluez though so you end up needing 2 dongles
However HA can get full house coverage for normal non mesh BLE devices by using ESPhome Bluetooth proxies.
(Which is just like having loads of dongles all over your house, which are then merged into a single virtual API by HA that the integrations can use)
Hello, I'm a HA noob and I'm wondering how I can control multiple LED lights? I have 2 Bluetooth LEDs but the phone can only connect to 1 Bluetooth connection at 1 time, and connecting Bluetooth on and off and to devices and then using the device's app for control is a hassle. I'm hoping HA can manage all the Bluetooth connections? I have a LIFX LED light and unsure how to find specs for the other Bluetooth LED light?
Sorry for late response. Tile trackers are what I was thinking of. But I gave the cats to my sister in law and solved the problem :).
I had wanted a way to have HA notify me whenever a tile tracker comes into range in lieu of paying Tile for that service.
i believe i'm looking for the same 🙂
so if i buy something like this, I can have it make a "mesh" network using ESPhome Bluetooth proxy so it acts like a Bluetooth mesh network?
If it runs esphome, maybe
I use this one myself - https://blakadder.com/gl-s10/
There are other options from e.g olimex that are well liked on here
It’s best to go LAN if you can. A lan based Bluetooth proxy can embarrass Linux Bluetooth. WiFi ones are still good but the WiFi and Bluetooth stacks have to share one radio
@fringe field so it seems my HA OS install is using the onboard intel bluetooth - can i use ESPHome to extend my bluetooth?