#bluetooth-archived

1 messages · Page 4 of 1

fringe field
#

Yes

shy narwhal
#

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?

fringe field
# shy narwhal ok, i got it configured.. how can i then see which devices have been detected by...

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

shy narwhal
#

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

fringe field
#

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

#

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

shy narwhal
#

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

faint eagle
#

Does the scan internal for bluetooth le tracker do an active scan or just listens for new devices and updates every 12s? (Default)

fringe field
#

my neighbours toothbrush is visible to my instance

#

my other neighbours tv

#

etc

fringe field
#

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?

faint eagle
#

Ok. I've seen scan internal mean different things been implementations so wasn't sure. Esphome logs say scanning even if on passive

shy narwhal
#

i just don't understand how this all ties together

fringe field
#

you probably can always see bluetooth devices

#

theres a lot of bluetooth junk when you start using this stuff

shy narwhal
#

well, actually not in this environment.. it's a horse stable.. the only ble devices there should be humans

faint eagle
#

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)

shy narwhal
#

but of course.. there could be some sensors or some random stuff.. but the idea was to just whitelist that

fringe field
#

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

shy narwhal
#

ok, i was just looking for a way to determine if a building is empty (of humans) or not

fringe field
#

then detecting known devices with stable mac addresses

shy narwhal
#

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

fringe field
#

yes

#

im just saying thats not what the integration is meant for

shy narwhal
#

do you have any other suggestions on how to solve this? preferably with ble

fringe field
#

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.

shy narwhal
#

hm

fringe field
#

otherwise, i think some of the mmWave sensors are meant to distinguish between people and animals, though how well i don't know.

shy narwhal
#

the problem with those sensors is that it requires some kind of LoS

faint eagle
#

Maybe there is a WiFi integration that returns # of detected or associated clients?

shy narwhal
#

the problem with that is that not everyone is connecting to the local wifi

faint eagle
#

Yeah would have to be seen vs associated

#

This could be a neat feature for the ble trackers. Number of things seen

fringe field
#

yeah, that would be a good diagnostic sensor too (first question after turning on shelly bluetooth is always "is this working").

faint eagle
#

Maybe with esphome you could write an automation on ble advertise set a binary sensor to true

shy narwhal
#

ble advertise = some device seen?

fringe field
#

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

faint eagle
#

Good call on timeout!

faint eagle
#

hmm, trying out bluetooth_le_tracker and not seeing anyting new being added to know_devices

#

via esphome proxy

rotund sail
#

That doesn't use known_devices.yaml - that file was deprecated years ago

faint eagle
#

ah ok so the bluetooth_le_tracker works, but doesnt use known_devices

rotund sail
#

Any new, or "recently" updated device tracker integration (last few years) won't use that file

faint eagle
#

ok, let me see if i can find where they listed when discovered

rotund sail
#

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

faint eagle
#

ah-ha! thanks for checking

fringe field
rotund sail
#

Nah, just the non-LE was broken by that

#

Well, is still broken

#

Maybe LE was too, but that was fixed

fringe field
#

Yes, by porting it to the new stack

rotund sail
#

Makes me wonder why the other wasn't too shrug

fringe field
#

New stack is LE only I think

rotund sail
#

Ah

glossy valley
fringe field
#

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

glossy valley
#

Thank you! I was hoping they would perform the function of an active proxy, since this is specifically selectable under configuration in HA.

fringe field
#

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

glossy valley
#

And thus ESPHOME proxy can do the latter while Shelly can't, correct?

fringe field
#

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

peak cedar
fringe field
faint eagle
#

well , im seeing advertisements from the esphome proxy with debug logs in HA but no new devices added to known_devices.

fringe field
faint eagle
#

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

jade wing
#

does anyone know if you can use an august lock with homekit and in hass via bluetooth?

faint eagle
fringe field
#

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

idle basin
#

im an august expert

idle basin
#

Bluetooth shows up, so does homekit in my HA

#

and my zwave, and wifi, lol

willow solstice
jade wing
#

@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

idle basin
#

thats the 4th gen, correct?

idle basin
#

or do you mean august locks with bridge

#

is it seeing bluetooth at all? and you can't configure it? or not at all?

jade wing
#

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

#

I've tried with a esp32 bluetooth proxy like a foot from one of the locks without any luck

oblique oak
#

check diagnostics for the proxy and see if the mac address of the lock is in there

oblique oak
faint eagle
#

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.

idle basin
oblique oak
faint eagle
#

Been comparing detection time of it vs esphome ble presence

#

Still not sure why ibeacon never goes away.

frigid compass
#

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

fringe field
#

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.

fringe field
#

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

rigid pollen
#

Hi There, is there a way to use an automation to set BT devices to active or passive?

jade wing
frigid compass
idle basin
#

@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?

jade wing
#

I didn't try disconnecting z-wave yet

#

but I'll try that next

#

they are currently connected to wifi through a connect

idle basin
#

disconnect z-wave, make sure you have logged in through august app, then I would try disconnecting from the connect

jade wing
#

ok

safe moon
#

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

fringe field
fringe field
#

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.

wraith yarrow
#

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

potent tusk
#

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"

potent tusk
#

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

warm surge
#

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?

austere spire
#

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?

fringe field
austere spire
fringe field
#

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

austere spire
fringe field
#

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

olive gull
#

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

fringe field
olive gull
fringe field
#

And then have a look at an integration like led_ble to see how HA bluetooth integrations work

olive gull
#

Thank you! Will try that and report back.

hexed furnace
#

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

neat meadow
neat meadow
fringe field
#

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

neat meadow
fringe field
#

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)

frozen shore
fringe field
frozen shore
#

There are genuinely 25k files in the cache. I live close to a busy road and it picks up all the traffic

fringe field
#

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

fringe field
#

(Lots of bug reports from bleak devs around the whole thing, including cases where =yes broke stuff)

frozen shore
#

I wonder if there is a way to just rotate the cache

fringe field
#

I couldn’t see anything like that

#

Where the cache was expected to be removed but wasn’t

short osprey
#

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

short osprey
#

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.

noble ermine
#

Add support for sonoff s-mate and r5 (ewelink-remote sub-devices)

short osprey
fringe field
#

I think If you remove an integration it should notify the code Bluetooth manager that a MAC address should get discoveries again.

fringe field
#

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

short osprey
fringe field
#

What would you like it to do?

#

The encryption key did not work so I assume it asked for the right one

short osprey
#

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.

fringe field
#

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

short osprey
#

I think even if there isn't a try/index would be quicker than a foreach.

fringe field
#

I don’t maintain BTHome but xiaomi ble has the same bug

#

Maybe

short osprey
#

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.

fringe field
#

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

short osprey
#

Yikes, that's nasty!

fringe field
#

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..)

short osprey
#

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.

fringe field
#

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

short osprey
#

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.

fringe field
#

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

short osprey
#

Do you mean a BluetoothServiceInfo object?

fringe field
#

Yeah

short osprey
#

It has a dict of service_data - which currently has only one entry but I've seen it with multiples.

fringe field
#

Git grep async_process_advertisements

short osprey
#

Hmmm can't paste a screenshot...

fringe field
#

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

short osprey
#

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

fringe field
#

Yes and no

#

The bug applies if there are 2 broadcasts of different types close together

short osprey
#

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.

fringe field
#

So let me try again

short osprey
#

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

fringe field
#

You are getting the latest service info

#

Yes?

#

And still getting a decryption error

#

Yes?

short osprey
#

(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.

fringe field
#

But that fails? Is it with a decryption error?

short osprey
#

But I am still getting the decryption error, but I am not sure yet what the cause of that is.

fringe field
#

So what I am saying is a theory for exactly the situation you are in

short osprey
#

I do get 2023-09-10 14:29:15.283 WARNING (MainThread) [bthome_ble.parser] Decryption failed:

fringe field
#

Right

short osprey
fringe field
#

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

short osprey
#

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.

fringe field
#

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

short osprey
#

the btome integration iterates through the service_info's and only processes the ones that are useful.

fringe field
#

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

short osprey
#

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 🙂

fringe field
#

You getting the encryption key wrong is more likely than my theory

short osprey
#

But I am debugging in realtime via vscode and I can see the data being passed in is the correct stuff.

fringe field
#

Then I can only assume you encryption key is wrong 🤪

short osprey
#

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.

fringe field
#

That fix in theory only helps if the encryption key changes between the flow starting and you submitting the encryption key. Did that happen?

short osprey
#

Yes

fringe field
#

And you see yourself hitting the InvalidTag code path in the parser?

short osprey
#

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 🙂

fringe field
#

yeah

short osprey
#

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?

fringe field
#

🤷‍♀️

short osprey
#

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 😕

fringe field
#

And you have to do this every time you change batteries?

short osprey
#

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.

short osprey
fringe field
#

Fingers crossed

short osprey
#

indeed!

fringe field
#

So I don’t know if there’s even an api to cancel a reauth

short osprey
#

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.

fringe field
#

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

short osprey
#

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)

devout hearth
#

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.

frozen sage
#

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?

fringe field
#

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.

fringe field
#

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

fringe field
#

(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)

devout hearth
# fringe field If it does, that means you probably do want to think about getting a better dong...

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...

fringe field
#

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

devout hearth
#

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.

frozen sage
fringe field
idle basin
#

I can't see any reason for a Bluetooth adapter over a proxy these days

hidden oasis
#

Maybe not for you, but a lot of people do

shadow leaf
#

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).

arctic elk
#

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?

iron frost
#

Do you have a Bluetooth dongle or proxy connected?

arctic elk
#

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?

iron frost
#

Obviously nor

arctic elk
#

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? 😂

iron frost
#

You need to passthrough Bluetooth device to the VM and hope it's a chip working with HAOS

arctic elk
#

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?

devout hearth
frozen sage
idle basin
#

but i hear you, good point

frozen sage
fringe field
#

Maybe search this channel for olimex to make sure that’s the right link

#

And it’s the EA variant you’d want

frozen sage
#

@idle basin @fringe field So do y'all have ethernet drops in your walls or do you covertly run the ethernet yourself?

idle basin
#

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

warm helm
#

Hi everyone, what dongle should I buy? I have access to eBay, AliExpress and Amazon. Thanks!

warm helm
#

Any recommendations?

iron frost
#

a bluetooth proxy ESP32

warm helm
#

Thanks!!!

#

Can I have multiple proxies?

iron frost
#

yes

warm helm
#

I have like 10 esp32 laying around 😅

faint eagle
#

For those that with an Ethernet attached esp. Are you seeing a significant increase in received advertisements since there's no radio contention

oblique oak
#

yes

#

which is why I've spent days optimizing the performance there 🙂

faint eagle
#

I've been eyeing some poe-iso-ae for my proxies

iron frost
#

And? Did they wink back?

idle basin
#

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)

iron frost
#

Was about to ask why did you buy them?

idle basin
#

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.

devout hearth
# fringe field If it does, that means you probably do want to think about getting a better dong...

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.

devout hearth
#

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).

fringe field
#

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.

civic siren
#

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

fringe field
#

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.

vale sentinel
#

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

civic siren
fringe field
#

Ideally all the ones bluez “supports” would work, but the kernel drivers are not consistent

civic siren
#

is there a way to check the vendor? I'm on proxmox and nothing shows

fringe field
#

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

noble sentinel
civic siren
noble sentinel
#

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

civic siren
#

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....

civic siren
noble sentinel
civic siren
#

I got my S12 Pro for 144$

#

it's at 138$ now lol

#

the eq12 it's 263$

noble sentinel
civic siren
#

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

civic siren
#

it's price without vat, btw

trail sphinx
fringe field
chilly kraken
#

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?

iron frost
#

Which devices do you expect to see?

chilly kraken
#

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

idle basin
#

you dont see adapters with a proxy

chilly kraken
#

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?

fossil warren
#

You can set up integrations that require Bluetooth but they will only appear as a notification if their associated integration has auto-discovery

chilly kraken
#

yeah but should I be able to detect bluetooth devices without adding any integrations?

#

just the esphome device?

fossil warren
#

I think so but I’m not certain

#

Try seeing if you have a known_devices.yaml with BLE devices in there

chilly kraken
#

no, not that I can see

fossil warren
#

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?

chilly kraken
#

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

fossil warren
#

Try it anyway, it may work without the Bluetooth integration set up explicitly

iron frost
#

Would that work on some other non iOS devices too?

chilly kraken
#

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

devout hearth
devout hearth
# chilly kraken 10.x is beta channel I guess?

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.

chilly kraken
#

Yeah I suspect something else is wrong with my setup. Going to try a hard reboot

fringe field
# iron frost Would that work on some other non iOS devices too?

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.

fringe field
fringe field
#

Have you tried turning on debug logs?

chilly kraken
#

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

flat dove
#

anyone have advice on installing the recommended sena with truenas & home-assistant trucharts app?

flat dove
#

^^I see there are a lot of issues passing usb deviced to apps, going the VM installation route

frozen sage
#

Can I use a Raspberry Pi as a bluetooth proxy? It's plugged in to my printer right now and therefore always on

fringe field
#

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.

frozen sage
robust forge
#

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.

devout hearth
#

You may also be able to convert an existing ESP32 device, build your own, or use certain other devices.

north palm
#

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?

iron frost
#

It captures BLE advertisements and sends them to HA which then notifies you of newly discovered devices

north palm
#

And if that doesn't happen automatically?

#

Or maybe it's getting routed to someplace I'm not expecting to see them?

iron frost
#

Then you don't have supported devices

north palm
#

🤔 Ok. I've tried my hand at connecting a few "unrecognized" Z2MQTT devices with unknown profiles. Any similar source on BLE devices?

flat dove
#

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?

spark cairnBOT
#

@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:

flat dove
#

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

fringe field
#

Bluetoothctl probably a better debug tool, as it’s bluez we need to work

fringe field
flat dove
#

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

burnt vessel
#

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.

weary rapids
#

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?

oblique oak
#

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

oblique oak
weary rapids
#

Nope, yep.. the one I bought is not on the supported list. Oof.. ID10T error.. thanks for your help, @oblique oak

clear stratus
#

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

fringe field
#

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.

#

And some people said (a) that’s supported in passive ble and (b) that the Android app doesn’t

clear stratus
#

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

kind temple
#

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

kind temple
#

basically virtual box USB passthrough not working

kind temple
#

Screw it this sucks im switching to a respberry pi

oblique oak
#

You might be better off with an ESPHome proxy

grave kraken
#

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?

devout hearth
trim shuttle
#

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

grave kraken
spark cairnBOT
#

@grave kraken I converted your message into a file since it's above 15 lines :+1:

fringe field
grave kraken
#

trying to find my bluetti AC200M power generator, right beside it that is BT discoverable

#

using bluetoothctl to scan on, but nothing shows up

fringe field
#

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

iron frost
grave kraken
#

this all worked in HA CORE but then I decided to go to HAOS for the sake of simplicity

iron frost
#

That's an addon that sends MQTT data to HA, doesn't have anything to do with Bluetooth in HA

grave kraken
#

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

fringe field
#

Are you hoping to have more than “it’s there” and maybe it’s battery %?

grave kraken
#

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.

iron frost
#

Do the addon logs show any errors

grave kraken
#

no errors in logs, just doesnt discover anything

fringe field
#

If bluetoothctl isn’t working the dongle is trash

grave kraken
#

just opened it up again, maybe the BT antennas came out of place, as I busted them changing out the card lol

fringe field
#

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

grave kraken
#

hmm I guess Ill have to get a CSR bluetooth.. tried to go as cheap as possible without buying more stuff lol

fringe field
#

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

grave kraken
#

ya problem is I live in Canada, so they're like $30-40 each, which is really BS

iron frost
#

Perhaps you could have more luck with a bridge running on a ESP32

fringe field
#

Yeah

grave kraken
#

ya looked into that ESP32 bridge... maybe could just throw it into my cabinet

fringe field
#

The Bluetooth maintainer uses those in his house over usb dongles

iron frost
#

Atleast you wont depends on HAOS compatibility with random BT sticks

grave kraken
#

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

hasty anvil
#

anyone familiar with the ugreen CM309 adapter? It's not finding any bluetooth devices: "discovered_devices_and_advertisement_data": [],

fringe field
#

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

hasty anvil
#

yeah 😦

#

this one should be in the "KNOWN WORKING HIGH-PERFORMANCE ADAPTERS" list right?

#

BT-UB40

cosmic raptor
#

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

digital pike
#

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.

chilly kraken
grave kraken
# chilly kraken So what happened? Removing the antenna improved things? I recently tried making ...

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).

digital pike
# digital pike In the latest core update, something changed so that my custom bluetooth integra...

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

chilly kraken
oblique oak
digital pike
fringe field
#

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

digital pike
fringe field
#

And did you try downgrading to .0 to prove that this fixed things?

digital pike
wispy spindle
#

If i have no BT adapter on my HA machine, Can I still use BT stuff with a ESPHome device running BT Proxy?

trail sphinx
#

you should be able to use an ESPHome proxy without needing to have a local BT stick

rare spire
#

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

fringe field
#

Ha resets it when it detects a crash

#

So lots of Realtek users think they have working Bluetooth but they do not 😂

elder star
#

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?

fringe field
#

I have inkbirds and proxies and I’ve not seen that. Sorry.

iron frost
#

is the signal strength decent or borderline?

elder star
#

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

winter lion
#

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

fringe field
winter lion
#

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.

fringe field
#

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

winter lion
#

Exactly what i did, ty

rare spire
#

Weird stuff

fringe field
#

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

minor orbit
#

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
rare spire
oblique oak
oblique oak
minor orbit
#

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

noble ermine
#

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

iron frost
#

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?

noble ermine
noble ermine
#

So it can work with home assistant BTHome Integration via Bluetooth

iron frost
#

How do you know it's BLE?

noble ermine
iron frost
#

"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.

noble ermine
#

So it's not a bluetooth?

#

Then how does it work?

iron frost
#

ask eWeLink

noble ermine
#

I am pretty sure this protocol uses Bluetooth LE😄

iron frost
#

data > feelings

noble ermine
#

as it's saying "part of Bluetooth"

iron frost
#

sure, then a BLE scanner should find it

#

does it?

noble ermine
#

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.

iron frost
#

i do and it is not possible without protocol documentation from ewelink

noble ermine
#

Do you have any of these devices (S-Mate, S-Mate2, R5)?

iron frost
#

i do

noble ermine
#

Alright, did you try to investigate by testing with any Bluetooth device like esp32?

#

Or by flashing any firmware like tasmota or esphome?

iron frost
#

i scanned with a BLE scanner and with hcitool. how does flashing tasmota or esphome fit into this?

noble ermine
iron frost
#

BLE scanner is the phone

noble ermine
#

And did it find it?

iron frost
#

no

noble ermine
#

I think this sub-devices is being paired by pressing the buttons

#

right?

#

did you try to do that?

iron frost
#

those are quite basic questions i'm not going to answer

#

how much experience exactly do you have implementing bluetooth protocols?

noble ermine
#

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

iron frost
#

and you don't seem to take no as an answer

noble ermine
#

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?!

iron frost
#

good luck with them then

noble ermine
minor orbit
oblique oak
minor orbit
#

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

devout hearth
#

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)?

fringe field
#

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.

devout hearth
#

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...

oblique oak
#

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

minor orbit
oblique oak
#

yes there are hash fixes for services as well

#

no idea if it will help though for this specific issue

cosmic raptor
#

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

fringe field
#

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)

cosmic raptor
#

hm, it just stays "home" forever

#

oh now its gone to "away"

#

that took some time

fringe field
#

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.

fringe field
#

(It should notice your return in seconds however)

cosmic raptor
#

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

fringe field
#

I see the same thing with distance

#

Might mean that tx power isn’t being reported properly

frozen sage
#

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?

cosmic raptor
#

thread/matter is the way

fringe field
#

Even with dumped encryption keys you couldn’t do that.

frozen sage
#

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

fringe field
#

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

frozen sage
#

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?

fringe field
#

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

frozen sage
#

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

rotund sail
#

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)

frozen sage
rotund sail
#

Hell no

#

#zigbee-archived can guide you, but any current EZSP (ZHA) or CC2652 (Z2M or ZHA)

trail raven
#

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?

fringe field
#

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

trail raven
#

That was my thesis as well, but I have no matches from the "Public XX:XX...." on any of my devices....

cosmic raptor
#

my devices got assigned seemingly random mac names aswell

#

nothing I could compare with, I just renamed them upon adding

trail raven
#

I'd be fine with renaming them, but I don't know what device I am adding at any given time...

fringe field
#

Shrug

#

The macOS UI had the right MAC address for me

#

Ha never sees the real MAC address so we can’t help

trail raven
#

What HA version were you on when adding your devices?

fringe field
#

August?

#

(I wrote the integration)

cosmic raptor
trail raven
#

Haha! 👍

cosmic raptor
#

the "Public XX:XX:XX..." in your keychain corresponds to your phones bt mac

trail raven
#

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?

fringe field
#

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

trail raven
#

Understandable!

cosmic raptor
#

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?

fringe field
#

The docs say it posts the irk to mqtt

#

So I didn’t even try to set it up

cosmic raptor
#

yes, figured that out now I at least need to make it connect to mqtt

trail raven
#

Maybe I could set up some sort of honeypot ESP32 using Espresence to gather the IRKs?

cosmic raptor
#

keychain.app is heavily missed on ios devices, on the other hand what does android even offer? 😛

fringe field
#

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

trail raven
#

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?

fringe field
#

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

cosmic raptor
#

where is that distance calculation coming from?

fringe field
#

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

cosmic raptor
#

interesting

#

given how precise apple devices can locate other devices

fringe field
#

Well they are using the wide band chip for that

#

They also can calibrate for their own antenna

cosmic raptor
#

aha, I thought this was all bluetooth

trail raven
#

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....

fringe field
#

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

trail raven
#

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! 🙂

fringe field
#

Yes it is very hard

cosmic raptor
fringe field
#

Awesome

fringe field
# fringe field Yes it is very hard

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 🤪

trail raven
cosmic raptor
#

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?

cosmic raptor
#

you will get the same pairing code presented on both devices, only able to confirm

trail herald
fringe field
cosmic raptor
#

nice, have a phone to try that out

fringe field
cosmic raptor
#

tried with ios 17 and sonoma

trail raven
#

Any idea on family members' Apple Watches?

trail herald
#

I'm guessing you don't say a*rt*g for copyright reasons, does it also work for those?

fringe field
#

Probably not

#

I can’t get irks for the other find my devices I have (various AirPods)

fringe field
trail herald
cosmic raptor
fringe field
#

Not sure no

cosmic raptor
#

will have to get their package to look up the mac I guess

fringe field
#

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

cosmic raptor
#

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

fringe field
#

MagicAccIRK is what I saw indeed

oblique cave
#

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?

alpine grove
#

Love the new private BLE feature. Bravo devs! Just hope it gets easier in the future.

cosmic raptor
cosmic raptor
#

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

fringe field
#

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.

cosmic raptor
#

alright I only have crappy esp32 devkit v1 something something

fringe field
#

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.

cosmic raptor
#

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?

fringe field
#

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)

cosmic raptor
#

I just went through them and made a dictionary out of it that I use in the template now, no biggie

cosmic raptor
#

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)

fringe field
#

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)

candid quail
#

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? 🙂

fringe field
#

So yeah, you probably want to look at ESPHome proxies.

#

You can connect them in your house by Ethernet or WiFi

candid quail
#

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 🙂

fringe field
#

Has to be something which supports esp-idf - don’t think pico would work

candid quail
#

Ah, I don't know what that is so I'll stick that in my notes to learn about.

fringe field
#

For your desk, just look at the official home assistant docs

#

There’s a list of dongles that were tested with Haos

candid quail
#

Oh nifty, thank you muchly 🙂

fringe field
#

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.

candid quail
#

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.

cosmic raptor
#

was added fine in ha

fringe field
cosmic raptor
#

oh wow it shows 400m distance

fringe field
#

lol

cosmic raptor
#

the first which goes over 10m

fringe field
#

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

fringe field
cosmic raptor
#

yep, one disappeared. lets try the other

sand light
#

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!

cosmic raptor
#

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

cosmic raptor
#

should get you something like

wooden otter
# candid quail Oh interesting, yes, that would certainly be doable and I have I Raspberry Pi Pi...

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.

cosmic raptor
fringe field
# sand light Hi all, I would like to join the discussion about private BLE. I was looking for...

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

chrome harness
#

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..

fringe field
#

On some distros its /var/run/dbus

chrome harness
#

i've found folders in /var/... and /run/... how do i know which to use?

#

with hciconfig i've found a device under hci0

fringe field
#

So one of those will be a symlink

chrome harness
#

ok, seems like on ubuntu it's /run/...

#

unix 2 [ ACC ] STREAM LISTENING 25179 /run/dbus/system_bus_socket

fringe field
#

That’s the symlink?

#

Ok

chrome harness
#

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

fringe field
chrome harness
#

yes

#

Agent registered [CHG] Controller 98:43:FA:6A:3C:67 Pairable: yes

fringe field
#

And “scan on” blasts your screen with data?

chrome harness
#

wouldn't say blast, but it gives me informations

#

of new found devices

fringe field
#

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

chrome harness
#

if i put my phone into searchmode it gives me info about that instantaneously

fringe field
#

so i have debian

chrome harness
#

i'm on ubuntu

fringe field
#

it should be close enough

#

depending on the level of bonkers snap stuff

chrome harness
#

not using snap 😅

#

apt-get all the way

fringe field
#

it looks like i just mapped the socket file through

#

/var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket

chrome harness
#

let me try that

fringe field
#

you need a privileged: true in your container definition

chrome harness
#

it is

#

already had that in there

fringe field
#

ok - hopefully with both of those changes it will work for you. it did in that previous chat.

chrome harness
#

and network_mode:host if that maybe has something to do with bluetooth too

fringe field
#

shouldn't do

#

i certainly don;t do that

chrome harness
#

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

fringe field
#

what does bluetoothctl say inside the container?

chrome harness
#

`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`

fringe field
#

ok

chrome harness
#

mh just read a post to install dbus-broker

#

didn't fix it, same error inside the docker container

fringe field
#

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

chrome harness
#

can i dm you my config?

#

but tbh not really something special in there

spark cairnBOT
#

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).

fringe field
onyx grove
#

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."

wind lodge
#

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?

fringe field
#

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

fringe field
#

That said, in your case “2 ignored adapters”…

#

Means ha found your Bluetooth

#

And offered to set it up

fringe field
#

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

fringe field
cosmic raptor
#

macbook really doesn't want to stay home

fringe field
#

lol

#

is tx power changing?

cosmic raptor
#

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

cosmic raptor
#

0.0m, -127dBm power, -66dBm signal

fringe field
#

Ok -127 definitely feels wrong

#

Hmm

cosmic raptor
#

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

rigid pollen
fringe field
#

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

rigid pollen
fringe field
#

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

rigid pollen
#

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 😄

rigid pollen
fringe field
#

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.

clear stratus
#

with the new private ble devidce integration, is it possible to get the irk on android?

fringe field
#

@clear stratus we only know whats in the documentation, sorry.