#bluetooth-archived
1 messages · Page 4 of 1
ok, i got it configured.. how can i then see which devices have been detected by this particular device?
or i need the bluetooth_le_tracker integration as well now?
the bluetooth integration (and esphome and shelly integrations) provide BLE support to HA, they don't do anything with it on their own. it's like having the drivers but no applications to use them. or connecting to WiFi and then wondering where google is without opening a web browser. so yes, you need another integration on top if you want to see entities. whether thats a sensor integration like xiaomi_ble or whether thats the bluetooth_le_tracker integration.
you can sometimes see some stuff in the diagnostics download for the shelly or bluetooth integration, but thats a diagnostic tool for devs, not something users are meant to consume
2023-08-31 13:19:53.599 WARNING (MainThread) [homeassistant.components.bluetooth_le_tracker.device_tracker] No Bluetooth LE devices to track!
2023-08-31 13:19:53.601 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy bluetooth_le_tracker
you've not configured it properly
le_tracker was updated to work with the new bluetooth stack, but its still using the old fashioned way of doing device tracking, apparently
don't use it myself, but last time this came up following https://www.home-assistant.io/integrations/bluetooth_le_tracker/ AND https://www.home-assistant.io/integrations/device_tracker/ seemed to make sense
the error is because you've not set track: true on anything in known_devices.yaml and your also not learning any new devices (with track_new_devices). without either of those, there is nothing for it to do, so it errors out
because there are indeed no devices configured to be tracked
i think my use case is probably not something that is solvable?
i don't want to track devices per se, i want to know if there are any devices nearby
Does the scan internal for bluetooth le tracker do an active scan or just listens for new devices and updates every 12s? (Default)
in that case unless you live in a faraday cage, surely a template sensor that returns true will be sufficient
my neighbours toothbrush is visible to my instance
my other neighbours tv
etc
iirc, scan interval doesn't actually do anything these days, though don't quote me on that
the new bluetotoh stack is always watching, so i don't know what a scan interval would actually control
reading the code, it might control how long things take to expire?
Ok. I've seen scan internal mean different things been implementations so wasn't sure. Esphome logs say scanning even if on passive
returns true based on what? it seems like i have to set track: true and then populate my instance with potentially hundreds, if not thousands, of just random drive-by devices..?
i just don't understand how this all ties together
it was a joke
you probably can always see bluetooth devices
theres a lot of bluetooth junk when you start using this stuff
well, actually not in this environment.. it's a horse stable.. the only ble devices there should be humans
Ok cool. Id like to move from an on-esphome- device le tracker to something on ha using proxy feature. (ibeacon is slower to detect the thing being gone due to timeout)
but of course.. there could be some sensors or some random stuff.. but the idea was to just whitelist that
yeah i don't think your use case is handled at all
the primary use case of the bluetooth stack is sensors
and controlling things
ok, i was just looking for a way to determine if a building is empty (of humans) or not
then detecting known devices with stable mac addresses
well, a random mac address should work as well.. it's still a device, and that's all i need to know to determine that someone is there
do you have any other suggestions on how to solve this? preferably with ble
you could make your own custom component
you could just periodically call the async_discovered_service_info API and if its returned nothing, no humans near
i don't know if any of that stuff is exposed to the template sensor, probably not.
hm
otherwise, i think some of the mmWave sensors are meant to distinguish between people and animals, though how well i don't know.
the problem with those sensors is that it requires some kind of LoS
Maybe there is a WiFi integration that returns # of detected or associated clients?
the problem with that is that not everyone is connecting to the local wifi
Yeah would have to be seen vs associated
This could be a neat feature for the ble trackers. Number of things seen
yeah, that would be a good diagnostic sensor too (first question after turning on shelly bluetooth is always "is this working").
Maybe with esphome you could write an automation on ble advertise set a binary sensor to true
ble advertise = some device seen?
theres no corresponding timeout, so your automation would have to start a timer to turn the sensor back to false after some time
i think you can handle that fairly easily in esphome with scripts?
so you can make a script that sets the sensor to true, waits 30s, then sets it to false
then the ble_trigger can execute the script. and if you use the "restart" mode it mentions, then the sensor should stay on until 30s after the last advertisement
(if you do it inline, i don't know whether the automation is run in parallel mode or blocks?)
the esphome discord best place for help with that though
and of course doesn't help with shelly's or anything
Good call on timeout!
hmm, trying out bluetooth_le_tracker and not seeing anyting new being added to know_devices
via esphome proxy
That doesn't use known_devices.yaml - that file was deprecated years ago
ah ok so the bluetooth_le_tracker works, but doesnt use known_devices
Any new, or "recently" updated device tracker integration (last few years) won't use that file
ok, let me see if i can find where they listed when discovered
Oh, actually... turns out that despite the updates it still uses that file...
Normally when integrations are updated they have to comply with the newer standards
ah-ha! thanks for checking
I think Le tracker was broken by a python version bump, so the changes to run on the new stack were a “emergency bug fix” rather than “new features”. Hence the exception. It’s been over a year now I think so hazy memories.
Nah, just the non-LE was broken by that
Well, is still broken
Maybe LE was too, but that was fixed
Yes, by porting it to the new stack
Makes me wonder why the other wasn't too 
New stack is LE only I think
Ah
Hi all, so that I don't spam two channels with the same wall of text, could someone assist in this regard - #integrations-archived message
Not all proxies are equal
Shelly is great for sensors that broadcast data
Like xiaomi, govee, inkbird to name a few
I believe airthings requires a connection to the device and that’s something that the Shelly is incapable of
Thank you! I was hoping they would perform the function of an active proxy, since this is specifically selectable under configuration in HA.
I understand the confusion.
But that is not what that means
Active scanning is something else
Scanning is to do with broadcasts
Active scanning involves sending a broadcast that you want to receive broadcasts
A full active proxy is also able to establish one to one connections and use GATT over that connection
That’s what is missing from Shelly
And thus ESPHOME proxy can do the latter while Shelly can't, correct?
Connecting the ESP32, things pop up immediately, like magic
https://i.imgur.com/ezllmFS.png
Yes
HA knows that it can’t support the air things over Shelly so it doesn’t even “discover” it
Like it sees it’s broadcast, but knows the Shelly can’t handle it so ignores them
Where as the esphome proxy knows it can support that device so immediately discovers it
hey there, I just bought those cheap lamps on aliexpress while knowing they wouldn't be easy to integrate into HA, but they were cheap so I thought why not give a try. One can control them through bluetooth or IR with an IR remote. Does anyone have a lead on how to try to integrate them? https://www.aliexpress.com/item/1005005763136866.html?spm=a2g0o.order_list.order_list_main.5.5b281802ilo0rm
#devs_bluetooth-archived for help writing an integration with the Bluetooth APIs in ha
well , im seeing advertisements from the esphome proxy with debug logs in HA but no new devices added to known_devices.
Have you got the tracker integration and is track_new_devices set
yes, and no, i was treating it like how the wifi intergrations worked where known_devices would populate with discovered clients and if you wanted to track you set it to true. but you just made me realize i have a dupe device_tracker section on this test box. let me clean that up
does anyone know if you can use an august lock with homekit and in hass via bluetooth?
setting track_new_devices: true is now populating macs in known_devices
So in the general case, you can only connect by homekit to one controller, so it’s hass or your apple home app not both. You can usually use the manufacturers protocol in parallel without restriction tho.
I think august doesn’t work with homekit_controller sadly, but I think they do work natively without it
So basically, what you said should be fine
im an august expert
yup, I do it
Bluetooth shows up, so does homekit in my HA
and my zwave, and wifi, lol
it's september now 😛
@idle basin I'm trying to get my August Smart Lock Pro connected via bluetooth because I've been having issues with zwave, but I can't get it to show up. I've been able to connect two Wi-Fi Smart Locks via bluetooth, but not the pro
thats the 4th gen, correct?
by two wifi locks, you mean assure locks?
or do you mean august locks with bridge
is it seeing bluetooth at all? and you can't configure it? or not at all?
as far as I know it isn't seeing it
the locks I have working are the august wifi ones (the smaller ones)
I believe its 4th gen, yeah
other than looking for devices in yale access I'm not sure what else to do https://cloud.drackett.com/qSRG2sCv
I've tried with a esp32 bluetooth proxy like a foot from one of the locks without any luck
check diagnostics for the proxy and see if the mac address of the lock is in there
if you don't know the mac address of the lock you can find it in the debug logs for yalexs after setting up the august integration
Does the ble device tracker detect an advertisement immediately when one is received from esphome proxy or does it have to scan through some list at some interval.
The wifi ones are wifi built in or a ble proxy? To clarify. You are not using the ble integration for those?
Its near real time (maybe a few milliseconds delayed from the network overhead)
Been comparing detection time of it vs esphome ble presence
Still not sure why ibeacon never goes away.
So I've just switched over to HassOS only on a laptop. Says bluetooth is working fine but it can't detect my (non-Matter) Eve Energy 2006 plugs when previously on a docker installation on my Mac in a venv it detected the same plugs fine. What should I do?
I saw the Bluetooth tracker integration but not sure if that's relevant
Eve energy plugs do in general work with haos, but the really really old eve stuff is challenging on Linux Bluetooth. It has lots of characteristics and is slow. So Bluez can time out trying to enumerate them. Not much HA can do about that (if that’s what’s happening).
Other than that, most common reasons for devices not being discovered are (a) already paired (b) range on your Linux Bluetooth is pants.
I’d factory reset it and if that doesn’t help, get it within a few inches to rule range out
My oldest eve energy was connected to HA via an Eve Extend for years before native HomeKit Bluetooth. You need iOS to configure it. But it’s a viable option, if you don’t want to landfill a working plug.
You should ignore that integration really
Oh and this assumes the Bluetooth hardware in your laptop isn’t trash of course
If it’s not on the Bluetooth documentations high performance list, we’d be very suspicious of it
Hi There, is there a way to use an automation to set BT devices to active or passive?
I am using Bluetooth for those and it’s working without issue, I just can’t seem to get these pros to show up
bingo - i got a new usb bluetooth dongle and it's working fine now
@jade wing you still around?
you can't get them to show up at all? yale or august? you disconnect z-wave? And do you have a wifi bridge to connect it to wifi once?
I didn't try disconnecting z-wave yet
but I'll try that next
they are currently connected to wifi through a connect
disconnect z-wave, make sure you have logged in through august app, then I would try disconnecting from the connect
ok
Does Home Assistant support controlling Philips Hue via bluetooth because I keep getting prompted for an IP address, but i dont have a hub
i suspect its actually referring to a home assitant server but having a whole server seems overkill when theres one device i need to control via bluetooth
And if that is the case, are there any FOSS apps which due
The hue integration is for the hue hubs
And not sure how to parse your message. Have you got the home assistant app on your phone but not the server??
HA is a server, the phone apps are just wrappers around it’s website
You can run it on a pi 4
HAOS makes it as painless as running a typical closed source iot hub
If you have Ha or HAOS then there are loads of ways to integrate the bulb. The official hue hub can be connected to HA by homekit or matter or the hue integration. Or you can connect it via zigbee with zha or zigbee2mqtt with your own zigbee dongle instead of their hub.
If you are running HA all of those would be a better choice than Bluetooth in terms of range and responsiveness, which probably means there hasn’t been much need for Bluetooth hue.
hiya is there a way to add a bluetooth yeelight to home assistant? i have the m.2 smart bulb.
i found a HACS integration for bluetooth yeelight but it looks like it only works for a specific lamp https://github.com/hcoohb/hass-yeelightbt
Hi, I'm trying to add LYWSD03MMC through Xiaomi BLE Integration and I haven't been successful
I have been using the passive BLE monitor HACS integration, but I bought a XMTZC05HM so I need to use the Xiaomi BLE Integration from now on
the XMTZC05HM was picked up immediately, but LYWSD03MMC is nowhere to be seen
Any ideas?
oh the Xiaomi BLE integration just says "No devices found on the network"
Nevermind, I'm a clown 🤡
I forgot I have ignored this device when it was auto-discovered
because I was using the HACS integration instead
hello everybody,
Is there any way to get a bluetooth speaker to transmit sound via homeassistant or the simplest way is through Google or Alexa?
There is this weird thing with the iBeacon integration; formerly my devices with companion apps were picked up (Galaxy Watch5, Android Phone & Devices) - now they are not anymore. Clearly they are advertising, my Tesla Model 3 is picked up, but not picked up anymore. Either just using a Bluetooth USB Stick, or just ESPhome. Both pick up the iBeacon for the Tesla Model 3 though.
There is (was) discussion that this was due to an underlying change in the dependency on the altbeacon lib (here: https://github.com/home-assistant/core/issues/80357) this would explain why my test-environment running on HA Blue still sees them (as they were originally added there before the now live environment). Any suggestions on how I could fix this?
So the iBeacon for the Tesla still works right now?
Yes, it does.
I vaguely remember that not transmitting a name was off spec
And if it’s explicitly excluded it was probably for a reason
(That integration had a lot of code to deal with broken devices while not tanking a whole cpu core)
I suspect given that issue there’s not an answer for you here
I have the same vague memory. Whereas the companion app on android phone/tablet doesn't seem to advertise a name, the companion app on my android watch does. Or at least, so does my watch. The tesla also doesnt advertise a name, but is detected.
I guess that that ticket is covering multiple issues then
From October you can track BLE devices by their IRK (Identity Resolving Key) without needing an app (assuming device makes sufficient ambient broadcasts).
I don’t know how you get that for an android device
I assume if you can get it on iOS you can on android
I don’t have any other ideas that are or will be in code short of making sure iBeacon devs have sufficient logs
Anybody used Bluetooth based smart plugs? I came across these at my local dollar store that touts no wifi or hub required and can be controlled with an app. https://imgur.com/a/uGPw04I
I'm wondering if these can be integrated with Bluetooth
not aware of any bluetooth outlets that are supported out of the box, but it should be possible in theoretical sense if you feel like writing an integration for them.
Cool! I'd love to do so, any suggested starting points?
So for controlling bluetooth devices in HA we use a library called Bleak. I guess first step is to use that and see if you can control it outside of HA.
And then have a look at an integration like led_ble to see how HA bluetooth integrations work
Thank you! Will try that and report back.
anyone ever tried to connect "Storz & Bickel" vape devices to HA? they work on BLE (Volcano Hybrid and Crafty/Crafty+) i really wanna control and monitor them via HA 🙂 any initial pointers / half finished projects will help
So for the companion app the same code/library is used on Phone/tablet/watch. Its actually up to the device if it wants to advertise the name or not. Although the library provides a way to set the name its usually not taken because teh device choses not to send it.
haha i think there may be a way to add it as a device. There is a library that may be able to help parsing the data https://github.com/Ernst79/bleparser not sure about controlling it but i thnk the temp readings can probably be picked up similar to Govee as those report temp readings
Unfortunately every manufacturer has their own protocol, so a library that can parse govee temp readings probably only useful if govee make e-cigs
That’s why home assistant is sponsoring BTHome, so there is a standard for doing that stuff
well FWIW I did see my own volcano in bt debug logs, I mentioned Govee as an example of what might to look for
there is the theengsgateway
not quite sure thats what you want
I was looking for an integration that had an entity in the switch platform and used the new Bluetooth stack in ha
There is homekit but that’s not a good example for a beginner dev
(Specifically with a built in integration so it’s been through our code review)
Any Bluetooth users able to replicate /var/lib/bluetooth/<device>/cache using all the inodes on HAOS’ overlay FS:
https://github.com/home-assistant/supervisor/issues/4490#issuecomment-1705722104
No. Is there a pid leaking them? (Only time I’ve run out of inodes was when something was unlinking files but not closing the file descriptor) or are the genuinely a gazillion files?
There are genuinely 25k files in the cache. I live close to a busy road and it picks up all the traffic
The Linux/bluez default is to always cache, apparently. Yes sounds more appropriate for you
But I don’t know if it will affect performance of other devices
(Lots of bug reports from bleak devs around the whole thing, including cases where =yes broke stuff)
I wonder if there is a way to just rotate the cache
I couldn’t see anything like that
There were bugs like this https://github.com/bluez/bluez/issues/191
Where the cache was expected to be removed but wasn’t
I'm having trouble with LYWSD03MMC devices (flashed with pvvx) in HA working OK to start with, then (after a reboot/battery change, I think) the device in HA shows up as needing to be "reconfigured", and the integration does not accept the bind key (which worked when the device was initially detected).
Oh, using bthome v1 protocol, with advflags.
Saw a similar issue posted against the xiaomi integration that required some delete/restart/wait workaround but since it's a completely different integration (and presumably different encryption setup) it's probably(?) not related.
It feels like maybe the bthome integration is trying to test the bindkey against a stale advertisement packet instead of a current one, perhaps? I have a bt adaptor on my server and multiple esphome proxies, and I'm testing right next to some of the proxies (the bt adaptor is about 10m+ away).
ha core logs gives me:
2023-09-10 03:43:06.276 WARNING (MainThread) [bthome_ble.parser] Decryption failed:
2023-09-10 03:43:13.749 WARNING (MainThread) [bthome_ble.parser] Decryption failed:
2023-09-10 03:43:36.174 WARNING (MainThread) [bthome_ble.parser] Decryption failed:
HA 2023.9.1, proxies on 2023.8.1
Hmm trying to chase it down with the debugger gets to line 511 in aead.py (from the hazmat crypto lib) getting lib=57 reason=102 reason_text='cipher operation failed' but I'm well out of my depth here.
Add support for sonoff s-mate and r5 (ewelink-remote sub-devices)
Looks like part of my issue is that the device had reverted to the pvvx custom ad format instead of bthome, and I think there's a bug in the discovery/option flow where it never updates to the latest service info received, so continues to try decrypting the broken packet instead of trying new ones as they arrive.
It’s not a bug, more of a limitation because of performance concerns. Great care is taken not to overload the main loop with a firehouse of Bluetooth callbacks.
I think If you remove an integration it should notify the code Bluetooth manager that a MAC address should get discoveries again.
We could potentially detect that a MAC address is broadcasting a different protocol and delete the config entry (in this case BTHome) (this would be assuming you meant to change protocol and hence integration) but that would be annoying AF if it was a mistake and now all your entity ids and names are messed up. Possibly history and automations too?
I don’t think the pvvx format is even supported of course
Cheers. Yeah, removing entries would be Bad, I think - it should imo handle gracefully any borked data if good new data comes through, and not wedge up.
What would you like it to do?
The encryption key did not work so I assume it asked for the right one
I think I've found a fix for the stale data issue (which I think is a problem in one of the other integrations) by adding this to be beginning of async_step_get_ecryption_key:
# Refresh the device info, since new adverts might be
# in a different format (eg device config changed, we
# received a corrupted packet, or user updated the bindkey etc)
for device in async_discovered_service_info(self.hass, False):
if device.address == self._discovery_info.address:
self._discovery_info = device
However something's not right on for my setup because even though it's now sending the correct service data through to the call to .supported() I'm still getting a failure to decrypt.
I see what you are saying
There should be an API call that takes the mac address
That api is o(1) not o(n) I think
Very likely 🙂 I just grabbed what I could see 😄
I think even if there isn't a try/index would be quicker than a foreach.
Yes, that's the one - I saw (what I think is) a similar issue report there where the workaround was restarting HA, letting it sit for x minutes and trying again or similar.
There are a bunch of issues with stock that make this annoying
For some devices they won’t broadcast while the web tool for setting the bund key is still open
Then they don’t broadcast for 20 mins after that
Yikes, that's nasty!
But that api would make the other devices work better
Does Supported takes a service info in BTHome ?
Or do you have to drive the parser manually first
(On phone pushing a pram atm..)
Yeah, it looks like it does it's super's supported(), and then super().supported() calls _start_update (which I figure happens in the instance). I was wondering if there's an issue with scope there somewhere that my newly-assigned self._discovery_info isn't being seen.
Oh here’s one gotcha
Not all service infos are usable
And the APIs only returns the last one
Example
Some devices broadcast what they are every 30s
But only broadcast data every few minutes
Any they sent sensor data then identity as 2 broadcasts one after other
Which is why during initial setup there is an api that takes a callback and processes multiple service infos until one is usable
hmm. From what I can see I get back a structure that has a dict of all recently received service_data for that mac.
and _start_update iterates through them all until it finds one it can use.
I’m talking about at the ServiceInfo level
You get a service info with a long mfr data
Then a service info with a short mfr data
Do you mean a BluetoothServiceInfo object?
Yeah
It has a dict of service_data - which currently has only one entry but I've seen it with multiples.
Git grep async_process_advertisements
Hmmm can't paste a screenshot...
That is how we avoid the problem in Xiaomi
We don’t do it in the reauth case
In the reauth case we have already see a broadcast with the new key so it’s not needed
(Normally)
Basically if your firmware sends a BTHome packet then anything else after as a seperate packet then your fix will be racey
And probably lose most of the time
Which is why async_process_advertisements exists
Wouldn't that only apply to super-sleepy devices like the xiami firmware that does nothing for minutes on end, so the older adverts get expired from the cache? The devices I'm working with advertise every couple of seconds, by the time a user interacts with the reauth dialog it's likely sent a few packets, and the gamut of packets it sends is likely in the discovery info by then
Not to say it wouldn't be a new potential bug, but not one that (imo) prevents fixing the existing one 🙂
Or actually, that would be a bug that already exists but we don't get to see it yet XD
Yes and no
The bug applies if there are 2 broadcasts of different types close together
What you are describing is a bug separate from the bug I am trying to fix - are we on the same page there? Just want to clarify if we're discussing the best way to craft the fix after the initial bug is solved, or if we are not seeing the original issue from the same perspective.
So let me try again
Because my setup is not working, and it doesn't appear to be due to a race condition because my device doesn't send multiple ad types
You are getting the latest service info
Yes?
And still getting a decryption error
Yes?
(except when I am corrupting its flash or otherwise being daft!)
With the patch above, I can see it sending the latest info through to the supported call.
But that fails? Is it with a decryption error?
But I am still getting the decryption error, but I am not sure yet what the cause of that is.
So what I am saying is a theory for exactly the situation you are in
I do get 2023-09-10 14:29:15.283 WARNING (MainThread) [bthome_ble.parser] Decryption failed:
Right
So if you started with a stale a service info
And then fed it a wrong service info
It would potentially ignore it or not have anything to decrypt
It might still be using stale state
The Bluetooth code doesn’t merge broadcasts from the device
So if it sends 2 broadcasts and you have the latest one, it might not be the one with the BTHome payload
That may be, but I am looking at a case where I do have the bthome payload.
That screenshot I posted shows the service_info which has the packet I want in it, and it fails to decrypt (which might be because the data is borked, but it is a bthome packet)
sorry, a bthome service_info... thingie 😄
I'm not saying you're not right about the situation you're describing, just that it doesn't match the situation I am seeing as far as I can tell.
Hey it’s just a theory
I can just see small gaps between where we are
Eg in xiamoi the situation I’m describing you get 2 service info’s that are both xiaomi packets
One has the encryption bit set and one doesn’t
And the api you are using would retain the wrong on of the pair
I don’t know why their firmware does that and maybe pvvx saves so much battery by not doing that
the btome integration iterates through the service_info's and only processes the ones that are useful.
I wouldn’t rule it out without testing it given a lack of other theories is all I’m saying
You are still not getting me. Sorry, I’m on my phone.
It is a long shot
All good, I really appreciate you taking the time to help me. I'm pretty green on this so I can easily be off in the weeds at times 🙂
You getting the encryption key wrong is more likely than my theory
But I am debugging in realtime via vscode and I can see the data being passed in is the correct stuff.
agreed
Then I can only assume you encryption key is wrong 🤪
bahaha touche!
I spent a few hours at first trying to solve it only to eventually work out that I must have borked the flash on the thermometer and it had reverted to sending a different ad format altogether!
The change I posted above definitely does address part of the issue (each option_flow attempt now sends fresh payload data while previously it was stale) but it's not the whole story, yet.
That fix in theory only helps if the encryption key changes between the flow starting and you submitting the encryption key. Did that happen?
Yes
And you see yourself hitting the InvalidTag code path in the parser?
yes.
I need to check my device's config again though in case it's borked - since the flow is "working" how I expect it to and it's the decryption that's failing. Previously the decryption was failing but due to the flow not working how I expected it to 🙂
yeah
sigh. I just connected to the device, read all the settings, all good, wrote them back, all good... and now the config flow works... yay?
🤷♀️
I'm guessing something funky going on with what order one writes the config to the device affects whether it loads the new key or perhaps starts adv with whatever was in the flash beforehand (or an all-zero key, perhaps). So looks (to me at least) that the change does fix the issue with re-auth against stale broadcasts, and I expect I'll hit the same issue over and over as I re-flash and reconfigure the other 15 thermometers 😕
And you have to do this every time you change batteries?
I actually think it might be good for the re-auth flow to retry with the saved bindkey before asking for the user to input one, in cases where the reauth was triggered by a corrupted packet or other transient config issue. But not sure if there's a good place to do that.
yet to be seen. I shouldn't have to, should only be if I am reconfiguring the device or flashing the firmware.
Fingers crossed
indeed!
So I don’t know if there’s even an api to cancel a reauth
I suspect the place to do it is in the flow - on first run (ie user_input is none) grab the updated service_infos, check if the existing bindkey works, and if so call the create_entry
Otherwise return the flow form
It won't prevent the device going into reauth but at least it saves the user from having to dig around to find the bindkey again.
If there’s an API to do it I’d want to do it inside a processor attached to the coordinator. So that you can cancel the reauth without the user seeing it.
But I guess you’d want to do it your way as well in case they click on the Ui in the meantime
If a valid advert arrives the system could certainly handle it well before the user would ever be aware of it.
the discovery card would simply disappear.
The odds of them being mid-flow when a good packet arrives are probably quite low.
(by which I mean the period of time the user has the bindkey modal form open)
Ha! Oh joy... after a reset the device appears to start encrypting with a random key, but if I connect to it I can read the orig key from it ok, and if I write it back it starts using the key correctly. Sounds like I might have a bug to log with pvvx 🙂 Will test with another device but it would explain the confounding nature of the issue. Good news is that my "fix" meant that the reauth "just worked" when I re-entered the bindkey into HA, while my production system is still stuck refusing to reauth because of the stale advert.
(part of why I am hitting this is because I am using an external power supply when reflashing the things, because a battery that is too flat to reflash will still run for months under normal use)
Has anyone had bluetooth issues since upgrading to 2023.9? I went from 2023.8.3 to 2023.9.1 and my AirThings BLE sensors all got wonky. The integration created all new entities, but those new entities all failed to communicate shortly thereafter. Additional restarts made my bluetooth adapter stop working until I rebooted. Everything looked OK briefly after the reboot, but all of the AirThings BLE sensors went unavailable again shortly thereafter. This is across three different devices, I'm restoring from backup now, I'm just curious if anyone else has heard of anything like this.
Would it make sense that disabling the bluetooth integration (which leverages the onboard BT adapter from my Beelink SER5 Pro) would improve connectivity to the HomeKit edition Nanoleaf Essentials?
If that's the case would I need to buy a bluetooth adapter to improve performance?
There was a bug in the code that lets crappy Bluetooth dongles sort of work.
Some dongles crash a lot
My realtek one crashed every 10 minutes for example
The auto recovery code tries to power down the radio and back on through the bluez stack, and I think if that fails it tries a usb level reset.
That wasn’t happening
So .9.2 might fix it
If it does, that means you probably do want to think about getting a better dongle long term.
No, the Bluetooth integration is used by homekit
If it’s not there and there are no other proxies or dongles, homekit won’t work for Bluetooth devices
It’d be like uninstalling your mouse driver and then trying to use ms paint
An external Bluetooth adapter might improve performance, but there will still be a Bluetooth integration for that new dongle
(I forgot to check if you were using those bulbs with homekit over Bluetooth or homekit over thread, but that also shouldn’t be affected by the Bluetooth integration unless your Bluetooth dongle is causing a lot of interference for your thread network)
This is somewhat confusing. My adapter is from the high performance list, and I didn't have any problems prior to that upgrade (nor am I having problems after the downgrade). Is it possible that the code thinks the dongle is crashing when it isn't because I have way too many devices? OTOH, if the bluetooth dongle was crashed (or incorrectly detected as such), why were my bluetooth-only homekit devices still appearing as available? I plan to add more proxies, but I'm leaving the dongle connected for a faster boot and because it's a long range dongle...
There are so many variables with this stuff it’s hard to know. Are you running HAOS? Do you see any missing firmware in dmesg output?
Unless .9.2 has fixed it for you it might still be a different bug.
If it has fixed it and your dongle is on the good list then it’s probably a firmware issue.
Looks like the docs call out firmware for the entire BCM section
As for homekit, again it depends. Homekit tries to avoid polling. Where as I think airthing depends on polling (or at least an active connection)
So it would take homekit longer to realise there was a problem
Yes, I'm running HAOS. The polling thought makes sense, I've definitely seen AirThings stuff go unavailable and come back. It's still weird, though, because one of the airthings is near a proxy already, and it was also showing unavailable.
That having been said, the bluetooth integration page has been updated dramatically, and it turns out my device is a Realtek adapter (I'm pretty sure it was on the high performance list when I bought it, but it's not now). Given that it's Realtek, this bug is probably the culprit.
In any case, on my Yellow, 9.1 is still shown as the latest when I check for updates, so I guess I'll wait for 9.2 to show up and maybe think about replacing that adapter.
As far as I know it's HomeKit over Thread, but that's what I'm having a bit of trouble determining. I've got a thread going here that someone else said you might be helpful in: https://discord.com/channels/330944238910963714/1150639047493034004
oh yeah. realtek are pretty much bin on sight and have been since the release after the bluetooth integration landed. some of them don't even have the RST pin wired up so can't be auto-recovered
I can't see any reason for a Bluetooth adapter over a proxy these days
Maybe not for you, but a lot of people do
idk if this is the right section. I am using a Raspberry Pi 4 with Smart Pi 7" as a fancy smart dashboard / alarm clock for my night stand. I'd like to be able to utilize the BT built into the Raspberry Pi to monitor incoming calls on my iphone via Bluetooth. Perhaps flash my night stand light if the phone is ringing (connected via BT to the Raspberry Pi).
I'm trying to connect a Mi Flora (https://www.aliexpress.us/item/3256804456107091.html) to my home assistant. When I try to enable the Bluetooth integration I get the alert "No unconfigured Blouetooth adapters found". When I try to add the Xiaomi BLE integration, I get the alert "No devices found on network".
What do I need to do to get these connected? Am I missing a step?
Do you have a Bluetooth dongle or proxy connected?
I don't, I think? I put my HA server on a virtual machine on a PC in my living room. Ostensibly it should be able to connect to Bluetooth?
Obviously nor
kk, so I need a USB dongle? Is that because the virtual machine doesn't ahve access to the MB Bluetooth connector?
am I completely making that up? 😂
You need to passthrough Bluetooth device to the VM and hope it's a chip working with HAOS
kk, how do I do that? And that's in lieu of a dongle. If I get a dongle, I can just load the device in the VM right?
No, if you want to use a bluetooth device attached to the host, you must pass it through. When you do this, the host won't be able to use it. How you would do this depends on your hypervisor. A bluetooth proxy might be a much better option for you to bypass all of that, but you need to research first to make sure that your sensor will work with a proxy.
I've got a single device communicating over bluetooth (an old Eve Motion) so I don't necessarily want another device on the wifi network just to boost the bluetooth signal. Feels easiest to buy a $9 dongle that plugs in to my Mini PC and call it a day.
thats why god invented ethernet proxies
but i hear you, good point
What's the recommended ethernet proxy device?
Maybe search this channel for olimex to make sure that’s the right link
And it’s the EA variant you’d want
Or there this: https://blakadder.com/gl-s10/
@idle basin @fringe field So do y'all have ethernet drops in your walls or do you covertly run the ethernet yourself?
Depends. I don't have as many places as I'd like. I do have one on every floor as least. One of them is in my basement on top of the server, that's easy.
I have some wifi ones, that are really easy, especially if I'm unsure of needing a proxy there
Hi everyone, what dongle should I buy? I have access to eBay, AliExpress and Amazon. Thanks!
Any recommendations?
a bluetooth proxy ESP32
yes
I have like 10 esp32 laying around 😅
For those that with an Ethernet attached esp. Are you seeing a significant increase in received advertisements since there's no radio contention
I've been eyeing some poe-iso-ae for my proxies
And? Did they wink back?
I just bought a couple of the M5staccks
poe ones, i sont need access to the board or other things, i'd rather have a poe pxoy be plugand play with a case
ha, oops
240MHz dual core, 600 DMIPS, 520KB SRAM (without integrated 3D antenna, does not support WiFi&BLE wireless function)
Was about to ask why did you buy them?
I must have been drunk or something
I can see use them, for something else, but nothing comes to mind
so i cancelled the order. lol.
So it turns out the issue I described was most likely https://github.com/home-assistant/core/issues/99786 which was fixed in 9.2. I upgraded and things seemed fine for at least 12 hours, but since I found out my adapter was a Realtek adapter, I ordered the Sena adapter from the recommended list. It arrived and I installed it, removing the old one and configuring the new one. Things still seemed like they were working. Another 12 hours later, all bluetooth entities are unavailable, even my ESP32 bluetooth proxy firmware is showing unavailable and I wouldn't think that would be related at all. Restarting and rebooting don't resolve this. I'm going to try downgrading again. Are there any other new known bluetooth issues that I might not have come across? I'm also curious if/how I can get dmesg output with HAOS, as IIRC, the shell add-ons are going into a container that might not be the dmesg you were asking about...
In case it's relevant, I only noticed the ESP32 proxy firmware entity missing because even the bluetooth devices that should have been communicating through the proxy were showing unavailable. Also, the bluetooth-only homekit devices were working better after I installed the Sena adapter right up until nothing was working.
FWIW, downgrade (and reconfigure sena since the backup to downgrade was made before it went in) brought things back again. The unavailable state of the esp32 firmware appears to be a normal thing when no updates available (I was looking in wrong place to check version to be sure it was connected).
No other issues im aware of; my Bluetooth has been working fine. Im on 9.2 and have dongle and 2 proxies. Actually added 7 more Bluetooth devices and they’ve been solid for about a day so far (since I added them I mean) and no other obvious problems.
i have home assistant in proxmox and I made the passthrough so that HA discovered the bluetooth correctly but for some reason, it always show this in the Bluetooth device:
hci: no devices or entities. hci0: Failed to start Bluetooth: adapter "hci0" not found
Sometimes Bluetooth pass through to vm is wonky. Lots of people have given up and either gone to esp Bluetooth proxies, passed through en entire pci-E usb card through to the vm (instead of just a usb port) or gone bare metal.
But sometimes an error like that (which is from Linux’s Bluetooth Daemon) can mean your Bluetooth dongle itself is struggling
Realtek ones can crash every few minutes under moderate use in Linux.
If that’s the case, all you can do is replace it.
One of the CSR-based ones from the well-supported list in the docs cost me all of $14 NZD (about USD$9), so I definitely recommend people that option
I'm on a Beelink S12 Pro with N100 CPU. It's not Realtek as far as I know
Realtek was just an example of the most unstable chipset we see. Integrated ones also problematic. Some that dell use (forget vendor) won’t work unless windows has configured them first and power hasn’t been lost. That’s why we have a list of tested devices in the documentation.
Ideally all the ones bluez “supports” would work, but the kernel drivers are not consistent
is there a way to check the vendor? I'm on proxmox and nothing shows
I don’t know about proxmox
On Linux you can find clues with dmesg (search near places it mentions hci0), lsusb, or maybe at a push lspci
I just ordered this device. Which hypervisor do you use?
I installed proxmox. I never used before, installed it 2 days ago. I have HA, Jellyfin and other stuff there. It works like a charm (except the bluetooth doesn't work in HA, it's recognized but doesn't work)
I will use Unraid because I am a noob
Also, I cancelled my S12 Pro and ordered EQ12 because of the DDR5 and dual NIC
this brings me to a question: what dongle do you guys suggest to use in HA? I tried one from TP-Link that I have on my PC and it works fine but if there is any better suggestion....
I was thinking about that one also but it was more expensive
Only £40 more
Where?
I had the idea of the eq12 to "replace" my router but it's not recommended to use everything in the same box. The DDR5 is better, that's for sure but not that much for the price difference in my case
The recommendation I usually hear is: invest in a few ESPHome Bluetooth proxies instead if you can. Much more bang for your buck, though it will require slightly more work (e.g. many best options are PoE devices)
The docs have a list of “high performance” adaptors. those have all been tested with HAOS. It also explains the various scenarios where esphome is best and where usb Bluetooth might have a slight edge.
Trying to add esp Bluetooth proxy, put bluetooth_proxy: | active: true in my esphome config but not sure next steps. Config is valid. Am I supposed to see Bluetooth devices pop up as entities under this esp device now?
I have the esp showing up as a device but doesn’t seem to detect any Bluetooth?
Which devices do you expect to see?
My phone, my stereo maybe
I just read I’m supposed to also install the Bluetooth integration, but when I try it says I have no adaptors
you dont see adapters with a proxy
k so I was hoping to config this esp32 as a bluetooth proxy, which would then let me track bluetooth devices in my home like my phone. So I added bluetooth_proxy: | active: true to the esp32, and the guide said i'd just start seeing bluetooth devices showing up in my HA notifications
is that correct?
You can set up integrations that require Bluetooth but they will only appear as a notification if their associated integration has auto-discovery
For other devices without a native integration there is this https://www.home-assistant.io/integrations/bluetooth_le_tracker
yeah but should I be able to detect bluetooth devices without adding any integrations?
just the esphome device?
I think so but I’m not certain
Try seeing if you have a known_devices.yaml with BLE devices in there
no, not that I can see
Oh, you need to set up the BLE tracker integration first
Do that, then restart and see if BLE devices exist
What are you looking to do with Bluetooth?
So add the ble tracker integration into configuration.yaml?
The ble tracker integration says you need the Bluetooth integration, the Bluetooth integration says you need a Bluetooth adaptor. I don’t have a bt adaptor, I only have a proxy
Try it anyway, it may work without the Bluetooth integration set up explicitly
If you want to track iOS devices you'll need 2023.10.x and https://next.home-assistant.io/integrations/private_ble_device/
Would that work on some other non iOS devices too?
10.x is beta channel I guess?
Unfortunately I think my problem stems somewhere further up the chain. I'm not seeing any bluetooth detection at all from my esp
I have an external antenna connected to it and have experimented with interval and window times
According to https://www.bluetooth.com/blog/bluetooth-technology-protecting-your-privacy/ IRK is a standard thing, so I should think this would work for any device where you are able to extract the IRK, but he documentation currently only shows how to do so for Apple stuff.
I think the 10 designates October. There may be a beta you can try, but I should imagine the documentation's release blurb implies that the feature will be included with the October launch.
Yeah I suspect something else is wrong with my setup. Going to try a hard reboot
Yes, it works for any “resolvable private address” when you can get the IRK. It will never work for non resolvable private addresses, and even if it worked it’d be a waste of time for the other 2 types of address (which are static and can be tracked with the existing ble tracking integration).
It’s annoying to get the IRK though. Espresence has a thing where you pair your device to the esp and it dumps the irk. But it needs mqtt and only works for things that initiate pairing. It uses a different Bluetooth stack to us too which means we can’t implement the same thing on our stack.
It’s not in a beta yet. Will be in the beta on the last Wednesday of the month. So a week and 2 days to go.
If you do a diagnostic download for the ESPHome integration you should get a json blob that includes information on what is or isn’t going on. Have you confirmed that doesn’t see any Bluetooth addresses?
Have you tried turning on debug logs?
I haven’t done that for the integration, but I turned the logs up on that esp specifically
And I saw more activity in the log, but nothing that looked like it was spotting any bt devices
anyone have advice on installing the recommended sena with truenas & home-assistant trucharts app?
^^I see there are a lot of issues passing usb deviced to apps, going the VM installation route
Can I use a Raspberry Pi as a bluetooth proxy? It's plugged in to my printer right now and therefore always on
Sort of but also not really easily
You’d need to be using an external usb dongle
The thing you need to look up how to do is usbip
It’s a way for one Linux device to forward a usb device to another Linux device
Bluez would be tricked into thinking the remote pi connected dongle was actually a local one, and you’d get another Bluetooth integration appear
It was tested when the new Bluetooth stack first landed but there is no Ui around it. I’ve never done it myself, you are on your own doing it.
And simply because there are less people doing it, it will probably be flakier and less robust than just having more esp Bluetooth proxies.
Alright makes sense. I was just curious if there was a simple program that I could run to do it.
No simple option no
So, probably a dumb question: is there such a thing as a stand-alone bluetooth hub? HA is on a repurposed computer in he back room, without Bluetooth capability (and kind of far away for good coverage anyway). It is a mixed HomeKit/HA setup, with a HomePod mini, Apple TV 4K, and an Aqara m2 hub, with a mix of thread, zigbee, and Wi-Fi devices, mostly. I bought some cheap presence sensors to try out, but I’m not sure what they’ll be connecting to.
Sounds like you're looking for a bluetooth proxy. See https://esphome.github.io/bluetooth-proxies/.
You may also be able to convert an existing ESP32 device, build your own, or use certain other devices.
Is there any guide on how to "pair" bluetooth devices with bluetooth proxies? I've got a few ESP32s with bluetooth proxies installed, but I'm not quite clear on how to get it to recognize BLE devices?
It captures BLE advertisements and sends them to HA which then notifies you of newly discovered devices
And if that doesn't happen automatically?
Or maybe it's getting routed to someplace I'm not expecting to see them?
Then you don't have supported devices
🤔 Ok. I've tried my hand at connecting a few "unrecognized" Z2MQTT devices with unknown profiles. Any similar source on BLE devices?
Thanks! I’ll check it out.
I've got HA installed on a Debian VM on TrueNAS. I've got the dongle passed through as a device (qemu-xhci). It's recognized and I can run hciconfig -a and service bluetooth status and that all looks fine (posted below).
But when I run hcitool scan I can't find any devices. It shows Scanning ... but nothing populates.
Any suggestions on how to get this working?
@flat dove I converted your message into a file since it's above 15 lines :+1:
@flat dove I converted your message into a file since it's above 15 lines :+1:
OMG, I think moving it to the back USB hub worked...!
I had been debugging that Scanning ... not populating, thinking it should show up there (shouldn't it?). But I just went to try the Snooz integration (requires bluetooth) again and...IT WORKED?! Whatever, I'll take the win
They can be very sensitive to interference. Usb3 is problematic. External drives are problematic. We normally say to use an extension cable. Power can also be an issue.
Bluetoothctl probably a better debug tool, as it’s bluez we need to work
That’s not really how Bluetooth works. The code that is contained in a customisation/profile in z2mqtt is contained in an integration in HA Bluetooth. And because there is even less standardisation with Bluetooth there’s a heck of a lot more code needed.
ended up just being the USB bus on the front of my case. Everything diagnosed the exact same when I had it plugged in there vs. the back, but the back USB bus allowed me to discover bluetooth where the front did not. 🤷
I didn't even have it plugged into the extension at first when it started to work, just did that to add range/get rid of interferance as you said
Where would one start with reversing a bluetooth homekit lock? I'd like to add my Schlage SENSE lock to HomeKit and have a esp32 bluetooth proxy, but I also want to be able to set the codes on it. This is only possible by manually programming it, or using the Schlage Home app and the lock resets manually programmed codes when pairing.
I am running HAOS on an ODROID, picked up a UGREEN Bluetooth 5.3 dongle.. Trying to get my Switchbot Blind Tilt to work.. It gets discovered with I go to add the Switchbot integration, but then the blind controls become "Unavailable" after that. The other entities, such as battery level, light level, continue to update, but the actual cover functionality never works. The dongle and the blind tilt are basically in the same room together, so I don't think it is a signal issue. Any ideas?
Pick and adapter on the high performance list or a proxy. I don’t think the ugreen 5.3 is supported. Might actually be listed as specifically not supported
If it uses the standard HomeKit methods, you would need to add support for the lock services in aiohomekit and than expose them in HA's homekit_controller integration as custom services. This is better discussed in #devs_bluetooth-archived if you plan on doing the development
interesting... I think I bought this straight from a link on the Bluetooth docs page. Will double check. Thanks!
Nope, yep.. the one I bought is not on the supported list. Oof.. ID10T error.. thanks for your help, @oblique oak
hey has anyone had any luck getting the ibeacon integration to pick up the beacon created by the android app? it seems to refuses to. the passive ble monitor will pick it up, but it breaks the regular bluetooth integration
I think it’s a known issue. Don’t have a link to hand but there is an open issue on github and possibly a work around code edit floating around.
https://github.com/home-assistant/core/issues/80357 (found it in discord search)
That issue probably has multiple issues annoyingly but one that stood out was that the name of the beacon can’t be unset, by design. https://github.com/home-assistant/core/pull/81599#issuecomment-1306114964
And some people said (a) that’s supported in passive ble and (b) that the Android app doesn’t
thanks, i did a little more messing and i figured out the following things
- ibeacon integration ignores ibeacons without a name (and i guess the companion app doesnt give the beacon a name?)
- switching passive ble integration from passive to active stops the custom integration from breaking other bluetooth integrations and will work as an ibeacon replacement
- ibeacon devs wont add toggle to discover ibeacons without names (or toggle to enable/disable discovery)
last one is the most confusing on for me
i looked into the docker editing that you mentioned, but im not particulaly familiar with docker, so i decided not to mess with it 😅
also i had read you have to edit the docker container every update if you go that route
I am running homeassistant on a virtual box machine with a Ubuntu laptop as the host. When using Ubuntu, Bluetooth works perfectly fine however when I am trying to use it with home assistant, it doesn’t work. I tried playing with USB settings and motherboard settings in virtual box settings and I got nothin. Any help would be appreciated
basically virtual box USB passthrough not working
Screw it this sucks im switching to a respberry pi
Ive been pulling my hair out trying to get bluetooth working on HAOS installed on a repurposed HP NUC... I've found the broadcom BT firmware, but cant figure out a way to get it on the HAOS, theres no wget and curl doesnt produce anything. What commands can I use in HAOS terminal? Any ideas how I can get this fixed outside of buying a new CSR BT device?
Boot to a USB device with a live linux distro that includes those tools?
Hi, I need some help because bluetooth_le_tracker integration fails with the following message : Error setting up platform legacy bluetooth_le_tracker
and the following information: Logger: homeassistant.components.device_tracker
Source: components/device_tracker/legacy.py:319
It seems that my bluetooth interface is running well : I discover all the devices with the terminal command bluetoothctl. Can you help me to understand where there is a missing point in HA?
The journal includes another message saying : No Bluetooth LE devices to track! this is coming from this process: Logger: homeassistant.components.bluetooth_le_tracker.device_tracker
Source: components/bluetooth_le_tracker/device_tracker.py:132
one thing after another... I replaced the BT card with a realtek, didnt need firmware... HAOS finds it and no errors, but it wont find any other BT devices around when I scan
@grave kraken I converted your message into a file since it's above 15 lines :+1:
What devices are you expecting to find? How are you scanning?
trying to find my bluetti AC200M power generator, right beside it that is BT discoverable
using bluetoothctl to scan on, but nothing shows up
I think that error means your known devices file is empty and track_new_devices is false
Bluetoothctl scan failing used to be a sign of Realtek usb devices that had crashed
BT discoverable doesn't mean supported in HA
I have it going to a bluetti-mqqt app that sends it to HASS MQTT broker
this all worked in HA CORE but then I decided to go to HAOS for the sake of simplicity
That's an addon that sends MQTT data to HA, doesn't have anything to do with Bluetooth in HA
meh I might just go back to HA CORE... HAOS has been all but headaches for me... ! although it was SUPER nice to add mosquitto-mqtt, mqtt-broker and bluetti-mqtt with a few clicks of a button
Are you hoping to have more than “it’s there” and maybe it’s battery %?
I run automations for it... eg if battery is under 20% and in between 7pm to 7am (cheapest TOU) then turn on AC for an hour,.... or if its close to solar time, then dont turn that AC and wait for solar to recharge, etc.
Do the addon logs show any errors
no errors in logs, just doesnt discover anything
If bluetoothctl isn’t working the dongle is trash
just opened it up again, maybe the BT antennas came out of place, as I busted them changing out the card lol
Realtek is junk that crashes every few minutes in some cases
Ha normally restarts it by simulating usb hot plugs / resets
Which doesn’t work on the really cheap ones that don’t even connect their reset pin
hmm I guess Ill have to get a CSR bluetooth.. tried to go as cheap as possible without buying more stuff lol
All the ones on the supported list in the docs were tested with haos
The ones that need firmware there is a caveat in a big old warning block
ya problem is I live in Canada, so they're like $30-40 each, which is really BS
Perhaps you could have more luck with a bridge running on a ESP32
Yeah
ya looked into that ESP32 bridge... maybe could just throw it into my cabinet
The Bluetooth maintainer uses those in his house over usb dongles
Atleast you wont depends on HAOS compatibility with random BT sticks
ahhh YESSS! the antenna fixed it!
Im getting overloaded with BT messages
found it!! awesome... thanks for helping me talk this out!
who would have thought that the antenna would completely disable the BT, I;d thought it just increase range, but not completely not find anything
anyone familiar with the ugreen CM309 adapter? It's not finding any bluetooth devices: "discovered_devices_and_advertisement_data": [],
seems like there are more people that have the same problem with this dongle: https://github.com/home-assistant/core/issues/94496
Realtek devices are terrible
They crash multiple times an hour
You should get one from the list of high performance adaptors in the docs if you want it to be reliable
Or get some ESPhome Bluetooth proxies
yeah 😦
this one should be in the "KNOWN WORKING HIGH-PERFORMANCE ADAPTERS" list right?
BT-UB40
the asus bt400 worked a treat every time I used it, including putting it on a pi and use it in ha. its about the same price, no regerts there
In the latest core update, something changed so that my custom bluetooth integration no longer works. Yet, I don't see anything in the changelog. Any Idea what could have caused that from the last core to the current? Sadly, the log is so big that it does not even open. Let alone scroll.
So what happened? Removing the antenna improved things? I recently tried making an esp bt proxy. It is a board that uses an external antenna. Without the antenna it struggles to connect to wifi, so I installed the antenna. However, it detects absolutely nothing BT
I originally didnt bother connecting the anteneas (Main/Aux, because one of the connectors broke off) on the Wifi/BT card and just slapped it in... it could be reconigzed but it couldnt discover anything BT nearby... I thought without the antenas it could still discover nearby BT (which my devices are RIGHT beside it) with its radio.
I opened up the mini PC and reconneted the main and then taped the AUX, not sure which one worked, but I tried to have both contact and then powered it up again, viola it started discovering the oodles of BT devices nearby.
it is a wifi/BT laptop card, I never got my wifi recognized (not that I care, since its connected via ethernet).
The log says only "Error Connecting, Operation already in Progress" Since I don't really love fixing this integration everytime something in core changes, is there a documentation how to rewrite it using the API from core?
The documentation page titled 'building a bluetooth integration' just has a list of best prectices, but no hint on how to get started: https://developers.home-assistant.io/docs/bluetooth
Ah probably not relevant to my issue then. I have a sole antenna and I can tell it’s working based on the wifi signal improving when I connect it
Usually thats a problem with the adapter itself.
So, what changed since last week (core 2023.9.0 to 2023.9.2)? I am using the integrated adapter that comes with the Raspberry Pi 4.
Did you try powering down completely and then powering back up
The pi 4 Bluetooth isn’t connected by usb so we can’t automatically restart it if it’s got stuck
yes, that's what I did to get the log readable. Before reboot it was too big for the webinterface.
And did you try downgrading to .0 to prove that this fixed things?
downgrading fixed it, yes. And this time it stayed working after re-upgrade. I hate working with hardware. And software.
If i have no BT adapter on my HA machine, Can I still use BT stuff with a ESPHome device running BT Proxy?
you should be able to use an ESPHome proxy without needing to have a local BT stick
Hey yall i'm getting errors on HA due to my bluetooth adapter
But its still working? 🤔
bluetooth: hci0: failed to restart LE scan: status 31
bluetooth: hci0: unexpected event for opcode 0x2005
bluetooth: hci0: command 0x200c tx timeout
and repeats
Ha resets it when it detects a crash
So lots of Realtek users think they have working Bluetooth but they do not 😂
Having some issues with the Bluetooth proxy I can't seem to figure out. I have a several inkbird sensors and several Bluetooth proxies. One gl S10, and two m5 atom lites. Everything seems to be fine, but randomly one of the sensors will be unavailable. It looks like it's still broadcasting though because the signal strength keeps updating even though the temperature is unavailable. Not sure the best place to ask.... Anyone seen that?
I have inkbirds and proxies and I’ve not seen that. Sorry.
is the signal strength decent or borderline?
Decent .. -89
I have 1 of the m5s about 10 feet away
Like I said what's really odd is that it's getting packets... I turned in debugging for the Bluetooth in home assistant and I can see packets from that device. And the rssi updates. Just not the temp
That's a graph of the temp and the signal strength
Getting signal strength every few seconds... Just no temperature
Hi, I'm running Ha os in a vm which does not have any bluetooth nor audio in it. Is it possible to completely disable those components from HA ? thanks
Even if you disable to HA integration bluez will still be there. The drivers will still be there. But both should be fairly inert. Do you have a specific goal or requirement you are trying to achieve?
ty for the input. Not really but I'm getting some errors in the logs that said 'setting of bluetooth took over 10 seceonds" at startup, so i thaught i might disable it to avoid that.
So in the case of Bluetooth you should just be able to delete the integration in the integrations ui and then you can ignore it so you don’t get pestered to add it back
Exactly what i did, ty
I mean... my bluetooth devices are still working and getting activated by automations
Weird stuff
I mean it’s not really
Either the device is crap and some stuff is timing out but it keeps on trying
Or ha is resetting so often you don’t notice there’s a problem
The auto reset code broke a while back and so many people came out to say their devices had stopped working.
But their devices were never truly working
The auto reset code was just making them think it was working
If your device is erroring like that and it’s not noticeable it’s great but you definitely have hardware/firmware/driver problems
Hi all, I have been trying to get bluetooth proxies working with some switchbots working for quite some time. I even got the GL-S10 to see if my other esps were the problem. Seems the issue still remains
it seems they constantly disconnect
[14:53:24][D][esp32_ble_tracker:214]: Pausing scan to make connection...
[14:53:24][I][esp32_ble_client:064]: [0] [D6:D1:7A:A9:54:BC] 0x01 Attempting BLE connection
[14:53:25][I][esp32_ble_client:144]: [0] [D6:D1:7A:A9:54:BC] Connected
[14:53:25][D][esp32_ble_tracker:246]: Starting scan...
[14:53:28][I][bluetooth_proxy:278]: [1] [FD:A4:66:1B:45:4B] Connecting v3 with cache
[14:53:28][D][esp32_ble_tracker:214]: Pausing scan to make connection...
[14:53:28][I][esp32_ble_client:064]: [1] [FD:A4:66:1B:45:4B] 0x01 Attempting BLE connection
[14:53:29][D][esp-idf:000]: W (34107) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x3e
[14:53:30][I][esp32_ble_client:144]: [1] [FD:A4:66:1B:45:4B] Connected
[14:53:30][D][esp32_ble_tracker:246]: Starting scan...
[14:53:33][I][esp32_ble_client:081]: [0] [D6:D1:7A:A9:54:BC] Disconnecting.```
[14:53:33][D][esp-idf:000]: W (38277) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16
[14:53:33][D][esp-idf:000]: W (38280) BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x16
[14:53:33][D][esp-idf:000]: W (38282) BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x16
[14:53:33][D][esp-idf:000]: W (38285) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16
[14:54:32][D][esp-idf:000]: W (97226) BT_L2CAP: L2CAP - LE - cannot start new connection at conn st: 1
[14:54:32][I][esp32_ble_client:064]: [2] [FD:A4:66:1B:45:4B] 0x01 Attempting BLE connection
[14:54:32][D][esp-idf:000]: W (97248) BT_L2CAP: L2CAP - LE - cannot start new connection at conn st: 1
Ok good to know. Thank youu! Nothing important is connected so will just keep an eye on it.
It’s probably something broken with dbus and it can’t check to see if the system has Bluetooth within the timeout
Make sure you disable the config entries for the ones you might think are a problem
I mean that would be all of them...cant paste the whole thing, but I only have three switchbots that I think I've paired properly. When the proxy starts up, it connects, then disconnects, and it seems to stop working after that. I am noticing some BLE mac addresses I don't recognixe that it starts to connect to, but not sure what those are or how to stop it from attempting a connection
getting this in normal logs: Bluetooth Proxy ce9b84 [c8:f0:9e:ce:9b:84]: None - 51:F3:88:FD:70:FF: ESPHomeClient bleak client was not properly disconnected before destruction
Hello, I recently opened a feature request that asks if support can be added for the sonoff ewelink-remote sub-devices (S-Mate, S-Mate2, and R5) to work with the BTHome integration https://bthome.io/ via the Bluetooth device that runs the home assistant server, Also I am asking to add this support to esphome so these Bluetooth LE sub-devices can be added to the Sonoff devices that support ewelink-remote control, or any esp32 device? https://community.home-assistant.io/t/add-support-for-sonoff-s-mate-and-r5-ewelink-remote-sub-devices/614342
Are you asking if it's possible or just think someone here will add the support if you ask?
Do you have the data on the ewelink protocol that is used?
Yea, I am asking if it's possible
Usually, I don't have any of these devices but all that I know it's a Bluetooth LE, right?
So it can work with home assistant BTHome Integration via Bluetooth
How do you know it's BLE?
I know these devices use a protocol that's part of Bluetooth LE and work with SONOFF devices that use ESP32. https://sonoff.tech/product-review/product-insight/whats-the-ewelink-remote-control-4-advantages-compared-with-433mhz-rf-you-may-concern/
"The remote control way, which is not what we know 433MHz, but is part of Bluetooth, is unique to eWeLink, we call it “eWeLink-Remote” control." does not mean its Bluetooth LE and means its proprietary for which you need some technical data to know how to decode it.
ask eWeLink
I am pretty sure this protocol uses Bluetooth LE😄
data > feelings
as it's saying "part of Bluetooth"
I don't have these devices yet, but I think it should work with any bluetooth device like esp32 and so on.
So I am asking if anyone has experience with these devices to consider adding support for it to home assistant and esphome.
i do and it is not possible without protocol documentation from ewelink
Do you have any of these devices (S-Mate, S-Mate2, R5)?
i do
Alright, did you try to investigate by testing with any Bluetooth device like esp32?
Or by flashing any firmware like tasmota or esphome?
i scanned with a BLE scanner and with hcitool. how does flashing tasmota or esphome fit into this?
Did you use your phone to scan the sub-device?
BLE scanner is the phone
And did it find it?
no
I think this sub-devices is being paired by pressing the buttons
right?
did you try to do that?
those are quite basic questions i'm not going to answer
how much experience exactly do you have implementing bluetooth protocols?
A little🙂
But I am asking about that to see if I can get some of these devices to use with esp32/home assistant via bluetooth
and you don't seem to take no as an answer
Most probably as they say it's part of Bluetooth, but maybe not the standard protocol cause it's something encoded and encrypted! However, I think it has a solution.
By the way, I found it saying that S-MATE’s signal transmission distance is up to 150m in open areas...do you know if a BLE can exceed 150m?!
good luck with them then
What do you mean?
Seems to be working now. Needed to add cache_services : false. Not sure why that was causing an issue.
That will make it much slower connecting. It might be that you have a bad partition table. Are you using esp-idf and have you done one flash with a serial cable ?
Yes and yes
I originally tried this out on a esp32wroom2 and flashed throught the btproxy website
when that wasnt working I switched over to the gl device, was able to open it up and flash, and still had that issue
even with both of them running at the same time. I basically used the default flash that the esp site provided. But in troubleshooting did notice the esp-idf was selected
re: esp flashing, given the frequency of firmware updates, should I ignore them when they aren't relevant (i.e. with no suggestion that bluetooth has improved between 2023.8.3 and 2023.9.3, should I ignore the 2023.9.3 firmware update detected by the esphome addon for my bluetooth proxies that don't do anything else and are already running 2023.8.3)?
If you went down that route I’d also watch out for esp-idf bumps that might contain updates to underlying Bluetooth stack
I don’t have a really strong opinion otherwise. Id say I flash most major releases. Just because regressions and/or breaking changes tend to be more manageable with faster/frequent deploys. I haven’t had any die yet.
Hmmm... Based on the changelog, I'm not sure what counts as a major version (they had 1.x for years before numbering them based on date). I don't even know where to look for potential bluetooth stack updates based on that advice and review of the most recent versions. When you say "I haven't had any die yet" is that with you updating them at least monthly? That might be a good idea anyway, just to keep them in sync with the add-on...
Esp-idf just released a new version a few days ago
It will likely get bumped with the next esphome release
When we bump it we usually change the Bluetooth stability notification for esphome to tell people to update if it contains important bug fixes
It looks like this release does as there are multiple disconnect hang fixes
would these fixes have anything to do with that cache problem?
yes there are hash fixes for services as well
no idea if it will help though for this specific issue
can we look up which ble node picked up a private ble device?
distance is all over the place for me too but also the state doesn't change to away
Yeah it’s an attribute on the device tracker for now
(There is a MAC address for the ble proxy and the current MAC address)
Should take about 5 minutes
The maximum is about 20 minutes
Well
If your device is weird and broadcasts very infrequently but with a predictability it could be longer.
It’s building on the core Bluetooth stack to decide something is away. There are 2 timeouts. The first is based on the devices broadcast interval. For an iPhone that is sub 30s. Mine spends a fair bit of time at sub 1s. So your device can be away within seconds. But the actual background task that “reaps” expired MAC addresses and fires callbacks runs once every 5 minutes. That’s a hard timeout in the Bluetooth stack, and for performance reasons.
In practice though over the last month with an iPhone it’s about as fast as apples notification that I’ve left something behind.
(It should notice your return in seconds however)
apparently turning on airplane mode isn't enough to test this 😅 and the resulting predictability after this state made it take at least 10 minutes to report away.
the watch which I've tried just now by turning straight off took 5 minutes.
whats interesting is that two iphones here have 0.0 to 0.2m at max distance while my watch reports 1.5 to 2.6m which would actually be quite accurate if multiplied by 10
yes, detections happen before the devices even show a unlock screen
I see the same thing with distance
Might mean that tx power isn’t being reported properly
I was thinking about how Bluetooth HomeKit Devices always worked like magic right out of the box, which had me wondering if the HomePod Minis I have staged throughout the house had anything to do with it. Lo and behold, it is exactly that!
https://doitforme.solutions/blog/apple-homekit-homepod-mini-bluetooth-range-extender-bridge/
I presume that having HomePod Minis paired with HASS via the Apple TV integration does not allow us to leverage this BLE function, right? You'd need to do the hacky serial key excavation to have it paired directly to HASS via the HomeKit Device one?
thread/matter is the way
Even with dumped encryption keys you couldn’t do that.
Bummer. It means that there's a very comprehensive mesh of BLE across my home, that I just can't tap in to from HASS.
Thread is indeed magic, but it has higher per item costs. I look at older HomeKit BLE devices that go used for $10-$15 a pop and wish I could put 'em into use.
I guess I could add them to HomeKit and then create automations that report their state to HASS... If it's somethin simple like a motion sensor
I used to do that with person tracking. It wasn’t amazingly reliable.
I’m currently using esphome proxies with my HomeKit ble devices
It’s more reliable than HomeKit over thread right now 🙂
Before that I used to have eve extend which was pretty reliable
Actually my smoke alarm is still connected to that thing
I'm at the point where if I'm buying a DIY hub, I'd probably go Zigbee because then you have dirt cheap sensors from alibaba that can connect to a Sonoff dongle.
It's $31 and then you've got your whole house covered...
Whereas Proxies mean doubling up on devices in each room. "I've got a BLE sensor in the kitchen so I'll need a BLE proxy. I've got a BLE sensor in the garage so I'll need another BLE proxy". Am I wrong?
I have zigbee for most of my stuff
But 2 proxies and a Bluetooth dongle for HomeKit purposes
Can see most of the house with that.
Lose coverage at the bottom of the garden in the shed
I think that's it then. The $31 for a sonoff adapter is about the same price of any Thread accessories, then I'll have a much wider range of options for cheap sensors.
I'm looking to put a door sensor on a dog food bin to track when he's been fed. But it's not worth buying a $35 thread door sensor, you know? When I come up with quick projects I'd rather have generic options that don't cost an arm and a leg
Don't buy the Sonoff Zigbee sticks - both are known to have issues
(if you have one and it works, don't necessarily replace it, but don't buy one new)
What's the recommended Zigbee stick then? ConBee II?
Hell no
#zigbee-archived can guide you, but any current EZSP (ZHA) or CC2652 (Z2M or ZHA)
So.... The Private BLE seems to be a godsend, but I am having a hard time getting the IRK for the correct devices... I have extracted the IRK for 3 devices associated with my iCloud account, but how do I know what device corresponds to what IRK? Now I have three Private BLE devices in HA, with distance calculations and all, but I have NO IDEA what devices those are...
Any guidance?
So when you got the IRKs from MacOS
The detail page you opened
It would have had the MAC address of the device
For me, it was something like “Public 01:23:45:67:89:ab”
That should match what is in your phones “about this phone”
Or the equivalent for your watch
That was my thesis as well, but I have no matches from the "Public XX:XX...." on any of my devices....
my devices got assigned seemingly random mac names aswell
nothing I could compare with, I just renamed them upon adding
I'd be fine with renaming them, but I don't know what device I am adding at any given time...
Shrug
The macOS UI had the right MAC address for me
Ha never sees the real MAC address so we can’t help
What HA version were you on when adding your devices?
you know, when you get the IRKs
Haha! 👍
the "Public XX:XX:XX..." in your keychain corresponds to your phones bt mac
In my case it doesn't... 🤷♂️
I identified one of the devices now by moving them between my BLE proxies and watching the estimated distance change...
Is there any other way than through the MacOS Keychain to access the IRK?
If we knew better ways they would be in the docs
Accessing the irk would make it easy for “bad” apps to track you in physical locations, so it’s fairly well guarded
Understandable!
espresense gets it after pairing, right? is there something available without setting up that whole thing?
will need to get foreign icloud devices
eh, guess I'll give it a try I see it has a webui maybe I don't even need to integrate any of that to get the keys?
yes, figured that out now I at least need to make it connect to mqtt
Maybe I could set up some sort of honeypot ESP32 using Espresence to gather the IRKs?
keychain.app is heavily missed on ios devices, on the other hand what does android even offer? 😛
One data point might be useful
Work iMac and personal iPhone. Different iCloud accounts. Was able to manually pair iPhone to work iMac and get its irk.
So I imagine that might be a way to get irks for family devices
I read in the docs about that way to get the IRK, but I was unable to find a way to pair a phone to my Mac... Haven't touched my mac in ages, so what am I missing?
I don’t think I did anything special
Iirc had Bluetooth settings open on phone AND Mac
And then started the pairing from the Mac side
Maybe
where is that distance calculation coming from?
It’s the same one ibeacon uses but it’s using tx power from bluez/blue droid rather than from the beacon.
Given the difference between watch and phone, suspect that might not be accurate and will need to add calibration.
But will never be accurate
Well they are using the wide band chip for that
They also can calibrate for their own antenna
aha, I thought this was all bluetooth
A little heads up...
I now set up an Espresence node and had it post the IRK of a known device to MQTT, after manually pairing said device to the espresence node.
When adding that IRK to HA in the Private BLE integration, it creates a "Private BLE Device xxxxxx".
As I understand it, the "xxxxxxx" should correspond to the devices BLE mac address? But it doesnt. It seems randomly generated...
Before launching, it might be a good idea to look into this, and maye warn users there is a bit of work involved when it comes to identifying what devices are added, in particular if you have many devices in your home....
No
As I said before
Ha never sees the real MAC address
So the ha ui could never show something that corresponds to the devices MAC address
Never ever
Sorry, my misunderstanding! 👍
Let me rephrase...
It would be a good idea to say a few words in the docs about how users should expect to identify devices. As it is now, it is VERY hard! 🙂
Yes it is very hard
can confirm, works fine this way. the pairing needs a little forcing
Awesome
Toddler walked in mid sentence 🫨. I’d definitely like to add more to the docs (especially about the limits of the sensors). But there’s a limit to what we can do. If you can’t find your MAC address in the keychain app then shrug. Good luck. Enjoy taking each of your apple devices for a 10 minute walk round your local area.
I had one IRK that I couldn’t identify and eventually figured out it was a MacBook that was power napping (so woke from sleep erratically then went “away” again).
Didn’t even know that would show up in my list so it didn’t get to have a walk to the park 🤪
What kind of forcing are we talking about here?
I read somewhere that apple devices send out even when turned off because of low battery.
Did i dream that up? Is this going to be visible with that tracking?
Had to press the pair button at the same secodnd or so. Third try was it
you will get the same pairing code presented on both devices, only able to confirm
came here to ask that, but also to say this is magical, and means I can take out one of my remaining homekit/HA hacks if i get it to work 🙂
The Bluetooth chip is in theory powered when off, but how that impacts broadcasts I don’t know.
nice, have a phone to try that out
That’s weird. I think iPhone showed a code and Mac let me type it in? Latest iOS but probably old macOS (was an older iMac)
tried with ios 17 and sonoma
Any idea on family members' Apple Watches?
I'm guessing you don't say a*rt*g for copyright reasons, does it also work for those?
Probably not
I can’t get irks for the other find my devices I have (various AirPods)
No, other than giving them a login on your Mac and making them log in with their iCloud account
np. just wondered.
That could work! 👍
I have so many random uuids in my keychain, sure they are not in there?
Not sure no
will have to get their package to look up the mac I guess
But when I tried to connect my AirPods to my Mac some new records did appear
They were in a different format
I got the impression there is another irk like protocol
With better encryption
But I was looking for irks so didn’t investigate
oh, pressing ⌥ while showing the bluetooth menu in macos gets you the mac addresses
nope, they don't appear to be in the keychain at least not with their mac
yep something weird is in use here
LinkKey
MagicAccEncKey
MagicAccIRK
and some other stuff
MagicAccIRK is what I saw indeed
I am trying to track some mobile phones with bluetooth. I used to do this with https://www.home-assistant.io/integrations/bluetooth_tracker/ but that doesnt work anymore since a few updates ago. There are now a few other options I tried BLE tracking, and iBeacon tracking using ESPHome. BLE tracking doesnt seem to work with phones and iBeacons are very unreliable in my experience (using companion app on all the phones to send out the beacons). Does someone have suggestions on what else to try?
Android or iOS?
Love the new private BLE feature. Bravo devs! Just hope it gets easier in the future.
do you want to easily get tracked?
is the current source attribute always the nearest node (with latest reception of broadcast?)
I'm basically viewing them in auto lists per esphome node with templates, just to confirm if this is already kind of room/node presence
Kind of but with caveats
Let’s say you had an olimex with external antenna and one of those dinky m5stacks that looks like a usb flash drive. They are next to each other. Your phone is a few metres away. Because of the better antenna it would look closer to the olimex.
alright I only have crappy esp32 devkit v1 something something
thats what I use in frontend, its crap but gets the job done https://paste.debian.net/1294073/
The next problem (again mitigated by having crappy esp32s) is that the source is coming from the underlying Bluetooth stack. It’s not optimised for presence/location it’s optimised for having a stable node<->device link. Flip flopping would be bad. So there is a bit of stickiness built in.
In practice walking between my kitchen proxy and office dongle, they do change as you’d hope.
it does work for me also, within ~minutes
would be nice to be able to name the source nodes though, is there no way to find the esphome node name with the source mac inside ha?
It might be, but it’s not (obviously) on the advertisement data that we get. So I need to squirrel around with Bluetooth api calls on every advertisement received. I wasn’t sure I could keep it O(1) without extending the Bluetooth api a bit. (On my list to have a look)
I just went through them and made a dictionary out of it that I use in the template now, no biggie
why does the source show 0c:8b:95:a8:44:ec
while the esp logs show
[C][esp32_ble:238]: ESP32 BLE:
[C][esp32_ble:240]: MAC address: 0C:8B:95:A8:44:EE
(the last :ee and :ec parts)
No idea 🤷♂️
Ugreen has been a problem in here in the past @candid quail. Pick one from the list on the Bluetooth documentation or get esphome proxies.
If you can’t do that, at least avoid things that use Realtek
(Which the ugreen stuff we’ve had problems with did)
Hi guys, migrating my query from general:
I'm hoping to get a bluetooth dongle.
My server sits on a shelf in my garden office, which is lined with rock wool insulation, plasterboard and wood cladding. The house is 3 meters away and fairly new build with brick walls. A candidate for a bluetooth project I'd like to test is all the way through this house, about 10 meters away. My instinct is that bluetooth just isn't really a solution here.
It's also my understanding that if I want to take advantage of some of the newer features of bluetooth in the future, I need to make sure I'm buying the right version, what are the requirements I should be looking out for? 🙂
So yeah, you probably want to look at ESPHome proxies.
You can connect them in your house by Ethernet or WiFi
There are some commercial options (like the gl.inet) which you can disassemble and flash and they aren’t hideous. https://blakadder.com/gl-s10/
Oh interesting, yes, that would certainly be doable and I have I Raspberry Pi Pico W which I believe includes bluetooth for that.
In the office though I still need a basic dongle for the server thanks to the new Ikea Idasen Desk integration that I'd like to take advantage of 🙂
Has to be something which supports esp-idf - don’t think pico would work
Ah, I don't know what that is so I'll stick that in my notes to learn about.
For your desk, just look at the official home assistant docs
There’s a list of dongles that were tested with Haos
Oh nifty, thank you muchly 🙂
Just don’t accidentally look at the Realtek section.
Most of the people in here that have “working” Realtek actually have a device that crashes multiple times an hour that Ha then resets so they only lose a small amount of sensor data
And don’t worry about Bluetooth 5. It’s going to be a long time before e have devices that require it and the underlying bluez stack supports it and the abstractions between us and bluez support it.
Ah, so when I'm seeing all these 5.0, 5.1, 5.3 etc, I'm safe with any of them? I understand my Fluval Fishtank uses something called BLE, but I'm not seeing BLE in the listing names.
is that the macbook itself?
https://paste.debian.net/1294082/
was added fine in ha
Interesting! My MacBook somehow ended up with the same kind of record as phone and watch
oh wow it shows 400m distance
lol
the first which goes over 10m
I think that’s the fallback if the calculation breaks
“Oh this seems to break physics, cap to theoretical maximum”
Would be interested in the signal strength and tx power for that one
If it’s on the approved list it supports BLE
looks like I had 2 different keys on 2 macbooks, could add them both. one still shows 400m while the other is a classic 0.2m.
I shutdown the first macbook now lets see if something goes away as I have no idea which one is which
yep, one disappeared. lets try the other
Hi all, I would like to join the discussion about private BLE. I was looking forward to this integration. I currently use espresense to track the location of devices in various rooms. However, I was annoyed that the tool was not really well integrated with the home assistant areas. My question is, to your knowledge is it planned that in the future you will also be able to get the information of the area in which a device is located? Deriving it perhaps from the proxy area? Do you think this is already feasible with a template? Tnks!
nope, the 400m one (supposedly my macbook air m2) does not get below 400m and also does not change to "away"
it could also be a appletv? or some homepod?
I could however get to track my macbook air 2013
yes, its the macbook air m2 which shows 400m
heh, after the reboot its at 0m
so yes you can add macbooks that answers that, they just take a veeery long time to disappear
but why the heck do the MACs report 1-2 digits different than what the esp logs show thats a weird one
read the chat log upwards, pretty much what I'm trying to do sort of
should get you something like
Just to add a +1 to what jc2k said, for your future reference - ESPHome has great support for Bluetooth proxies. I just set some up using M5Stack Atom Lites to extend the range of my HA's Bluetooth to cover some BTLE plant sensors. There's an off-the-shelf config you can flash onto the device and have it working immediately. The Atoms seem like great hardware for this, they're tiny and cheap.
aaand its back at 400m , it went "away" with Battery<5% but I was still using it until 2% so there is something to speculate
Hi! Full transparency - I’m the author, and I added this primarily for answering the “am I home” question, not for room presence, hence with the user experience isn’t well optimised for that. It’s not something I’ve done or am interested in for my home/use cases (yet). I’m not against work to make that user experience better, but it’s probably not something I can do on my own (time constraints).
Because it’s not an area I’m interested in insights like using the area of the proxy hadn’t occurred to me. I’m looking forward to hear what the community can imagine..
That said there are problems with using this for room presence. We are using what core considers the “best” proxy. That is a good approximation for nearest but there are cases where it might not be. Eg A large antenna might have a better signal than a small antenna despite being further away.
And for the same reason there might be some stickiness where the source won’t flip quickly because while it now is closer to another proxy it still has a good signal to the old one. (Flip flopping between proxies is a problem for most use cases)
If these turn out to make room presence not possible, there is always the option to duplicate what our core Bluetooth stack does but optimise for tracking performance rather than connection stability and cpu usage. But we’d want to try and do that in a way that iBeacon and even the basic ble tracker could benefit from, so not necessarily a quick and easy thing.
I like the idea of having a sensor that shows the area that you are in, with here/near/far as a state attribute. If we can do that without it eating cpu (there are lots of beacons to process, and quite a bit of api indirection to get to the area name).
We probably also need to support calibrating somehow, but short of calibrating for each device-proxy pairing I’m not sure how much it would help
Hey, so i have tried to add bluetooth to my docker home assistant instance, but can't seem to get it working, i've added - /run/dbus:/run/dbus:ro to my docker-compose file under volumes and restarted home assistant. Logs say that it still can't find the DBus Service for the device..
On some distros its /var/run/dbus
i've found folders in /var/... and /run/... how do i know which to use?
with hciconfig i've found a device under hci0
So one of those will be a symlink
ok, seems like on ubuntu it's /run/...
unix 2 [ ACC ] STREAM LISTENING 25179 /run/dbus/system_bus_socket
so on the mainsystem bluetooth works, but somehow it doesn't get linked through to the docker home assistant
i seem to get that error a lot hci0 (xx:xx): FileNotFoundError while starting bluetooth: [Errno 2] No such file or directory
Does bluetoothctl work on the host?
And “scan on” blasts your screen with data?
Oh it’s a veritable blast wave on my host
Apart from when the dongle is dead and it sees the tv once a minute
Just checking my config 1s
if i put my phone into searchmode it gives me info about that instantaneously
so i have debian
i'm on ubuntu
it looks like i just mapped the socket file through
/var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
let me try that
ok, looking at search for last time i mentioned that file and found: #bluetooth-archived message
you need a privileged: true in your container definition
ok - hopefully with both of those changes it will work for you. it did in that previous chat.
and network_mode:host if that maybe has something to do with bluetooth too
it's a really old config, one of my first, did it with the HA tutorial on their page
nah, didn't change it
still the same error
what does bluetoothctl say inside the container?
`Waiting to connect to bluetoothd...dbus[129]: arguments to dbus_connection_get_object_path_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5969.
This is normally a bug in some application using the D-Bus library.
D-Bus not compiled with backtrace support so unable to print a backtrace`
ok
mh just read a post to install dbus-broker
didn't fix it, same error inside the docker container
sorry, wife happened.
dbus-broker is a faster dbus broker, and pretty important to keep your cpu usage in check, but shouldn't impact it working at all
i probably need to check your docker-compose to see if anything stands out
Welcome to the Home Assistant Discord.
Please remember to read #rules and the welcome message that the bot (that'd be me) DMd you.
Every channel has a topic that explains what's on topic, and provides other information. Many also have pinned messages that can help you.
When you're done reading this, head over to #the-water-cooler and say hi, or the the relevant channel if you need help (if you're unsure, start in #general-archived).
yes you can dm it.
I am trying to setup bluetooth on my unit. Bluetooth dongle is attached and passed in Proxmox to my HA VM. When I setup Bluetooth integration in HA Iget following message "No unconfigured Bluetooth adapters found. There are 2 ignored adapters."
I have a nodeMCU esp32 chip which I set up with ESPHome and it is working fine and I added a new "Private BLE Device" (my Apple watch) and it seems to be working, however I am not sure if it is reporting the distance to the nodeMCU esp32 chip or my NUC which also has bluetooth set up and is downstairs (the nodeMCU is upstairs in my office). Anyone know how it works?
If you have both correctly configured then it will use both
If you look at the “extra attributes” on the device tracker it will tell you the MAC address of the proxy or dongle that found it
We are looking into some options to make this more obvious
We’ve found Bluetooth passthrough to be problematic. To the point where people have bought dedicated pci cards and passed the entire card through.
That said, in your case “2 ignored adapters”…
Means ha found your Bluetooth
And offered to set it up
In which regard problematic?
And you pressed ignore
There should be a “mystery meat” / “hamburger” / “…” button on the integrations page that can turn the filters off and show you ignored stuff
Problematic as in more instances of random hangs or problems recovering when it does crash
Understood
Ah ok thanks for confirming!
macbook really doesn't want to stay home
where can I look that up?
oh I just saw they were disabled again for the new devices
can tell you tomorrow
400m, 4dBm power, -84 dBm signal
0.0m, -127dBm power, -66dBm signal
I restarted the macbook,
Now its
0.0m, 12dBm power, -72dBm signal
it does behave like any other device though, nodes report the same sightings as my iphone
Follow up question here: the attributes note Source = "Bluetooth LE" and provides a current (my iphone?) and source MAC address. I have a BT usb adaptor and many Shellys running as BLE proxies. Checking my iphones attributes, the Source MAC does not = the BT adaptors MAC address so does that mean the source is one if the shellys?
Yes the “current” MAC address is the MAC address your phone was last seen using
And the source MAC address is the mac of the proxy or dongle.
So if it doesn’t match your bt dongle it must be a Shelly
Thanks for confirming... To ask a dumb question: anyone know how to find the BLE mac adress of a shelly?
One way is to look in the diagnostic report for the Bluetooth integration. That has a section for every scanner.
You should be able to search for the Mac’s in there
Bingo.. didnt think i would ever say this. My watch is being monitored by my washing machine.
well.. the washing machine shelly.. but thats what its named 😄
I guess it would be quite simple to add a sensor showing the "room" of the BLE stick or proxy for the device?
Maybe maybe not.
There’s a bit of indirection that might hurt cpu given the number of broadcasts we are processing
I’m going to look into adding an area sensor but would be good to do the same for iBeacon maybe standardise something.
with the new private ble devidce integration, is it possible to get the irk on android?
@clear stratus we only know whats in the documentation, sorry.