#bluetooth-archived
1 messages · Page 7 of 1
Yes.
hi all, one question regarding bluetooth_tracker
I am failing installing since bluez is not available
it seems a confirmed issue
any advice for it?
It’s hard to answer without knowing more
Bluez is basically part of the Linux Bluetooth drivers
ack
If you are running HAOS then it’s that your dongle or Bluetooth isn’t compatible
Or it has severely crashed
I am trying to use it since bluetooth_le_tracker is not detecting my phone
Ah
I am running HA over rpi4
On the built in Bluetooth ?
Doesn’t work with proxies either so terrible really
I mentioned what I use. Works great.
I know android users try to use iBeacon
However they turn up here with problems a fair bit
do I need to install an app on the phone?
For Android yes. For iOS no.
ack
thx
what do you suggest?
or maybe I can just get some simple ibeacon device
I use private ble device and an esphome proxy at the front of the house. Turns on our alarm when we are all out. Turns it off when we get back. Turns the outdoor lights on if I arrive in dark. Works great.
Would be a complete non starter with legacy tracker because it would have a range of less tag one room
It’s an integration.
oh ok
Modern BLE devices sometimes have encrypted random addresses
If you know the encryption key, you can detect them despite the randomness.
That’s how we can do device trackers for iOS devices (they don’t work with the ble tracker)
Unfortunately we only have a way to get the encryption key on macOS right now.
You might find some help at the Bermuda project
ack, thx
I have a fireplace which can be controlled with an Bluetooth App this app is awful and I would like it to control with home assistant is it possible to the commands or some sort of a way to intercept these commands?
It’s not impossible, but there is always doubt that the underlying Bluetooth characteristics are any better than the app you want to replace. You would need know enough python to write your own HA integration. If that sounds like you, there is a #devs_bluetooth-archived
can you share your YAML for this automation?
There’s not much to share. State trigger for when the device tracker switches to the home or away states. Turn a light on.
ok i guess i couldn't figure out what to use. i see an estimated distance sensor and i see a "diagnostic" as Home in Private BLE Device
so wasn't sure if you are doing if estimated distance is above 30 feet, run automation etc
so basically, when not "home" it goes to "away" state?
Something like that
It might be “not_home” or something
You have to keep in mind that “home” means in range of one of your proxies or dongles, so even with 4 proxies there is still a dead zone in one corner of my house
And there is a timeout that is fixed which is how long it takes HA to notice a device has gone away.
yea i guess in my setup it says "900s"
It takes about as long as apples “find my” alerts when you forget your headphones somewhere
i guess it might vary as lets say you in like 500s since last interval when you leave home, it will "activate" in 300s right?
is that dependent on the device or the bluebooth adapter?
Device. There is a secondary timeout in HA so it’s never that quick at arming my alarm, but the disarm and turning the porch light on is basically as I reach the bottom of the drive
what devices do you use? i have iphone 15 pro and apple watch ultra and they are both 900s
Ah then something is wrong with your setup
14 pro and non ultra Apple Watch
Wife has a less pro phone and it’s similar
If you are seeing 900 I’d guess Ha hasn’t seen enough packets to lock on to an interval
Even so it should lock on within a couple of seconds for an iPhone given the amount of crap they broadcast
What Bluetooth dongles/proxies you have again?
I’d be interested in seeing a signal strength graph. We have had trouble with intel drivers in the past. Though nothing as bad as realtek.
Are there gaps in the graph?
My watch is -58 in a different room to any proxy. Though phone is -74 in same place 😂
i'm like literally 5 feet from the device
Im interested in if the driver is dropping packets
But you know people tell me they are 1’ away all the time and don’t tell me about all the usb3 stuff or whatever so I generally ignore half of what people tell me 😅
One person had not got the antennae correctly attached to their internal Bluetooth card
So you know discord is pain
USB 3 is bad for ruining the signal. If there were gaps in your signal strength gap it’d be worth ruling out. But if it’s fairly steady in the 70s 💪
yea i'm getting an extender for my enroute zigbee dongle
I’m more suspicious of the device itself or its driver. Think I’ve heard similar for Intel in the past. Beoadcom and CSR here (+ proxies)
That loooks.. yeah. Not great.
No. Only by getting a different dongle.
hmmm well i guess back to the drawing board.
just curious, why not simply use the built in location feature in HA?
Not entirely sure which location feature you mean. But device_tracker is the best we have for this.
i think there is a feature for tracking the location of your phone right? i think it might be "device_tracker"
That’s what private_ble_device provides
A device tracker is an entity with 2 states - home and not home 😂
i think its via the "mobile app integration"
it literally has my "address"
so i figure it i say, not at "current address" run automation?
Think I misunderstood your question
So I want local first
I’m not going to have the mobile app send my location over the internet back to HA
Even if it only sends it to my instance, some app tracking my location with 1m precision is creepy (to me)
That’s why I use the Bluetooth device tracker
So that’s why i do it this way and not through the app integration.
Plus arrival automations works even if my phone doesn’t have internet. Theoretically your phone can still broadcast some beacons in an off state or super low power state.
makes sense. appreciate the insight
so i guess you dont use the app and just login via the browser when remote?
I do, but I’ve blocked some of the tracking features.
I don’t not trust the app, but it’s about data minimisation (one of the eu data protection principles)
There can’t be a whoopsie with my data if I don’t let it be collected
Is there a way to allow HA to take a bit longer to connect to bluetooth proxies? I'm frequently getting errors like this:-
2024-04-04 01:42:54.931 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547179842240] Error ESP_GATT_CONN_FAIL_ESTABLISH while connecting: Connection failed to establish - it looks like its not the BT side that's failing but the connecting to the ESP32 ?
@steep valley I converted your message into a file since it's above 15 lines :+1:
I can not Post a Picture from the Bluetooth Error in Home Asstistant
I will try:
https://imgur.com/Gr48vLh
and
https://imgur.com/Z7Iedvj
Please use imgur or other image sharing web sites, and share the link here.
Image posting is blocked in most channels to discourage people from sharing text as images. Sharing text as images assumes that everybody sees the world as you do, which isn't the case. Some people are colour blind, or have visual impairment that means they can't make sense of an image of text.
Have you followed the instructions for the Bluetooth integration?
Read them again and look for the step about the dbus socket.
Also the step about dbus-broker
HAOS Bluetooth will probably work better than stock Linux because things like the dbus-broker change are baked in. The bluez version is often newer. Etc
No.
There is a instruction manual for Bluetooth? Sounds good.
Have you a link to them? Thank you !
Every integration in home assistant has its own page on the home assistant website
Just go to the integrations section of the home assistant website and search for the one called Bluetooth
I found the fault:
volumes: - /run/dbus:/run/dbus:ro # Bluetooth - ./volumes/homeassistant/config:/config # - /home/pi/media:/media
Here in the row with the #bluetooth-archived i removed the # ans then it was running
Original:
volumes: # - /run/dbus:/run/dbus:ro # Bluetooth - ./volumes/homeassistant/config:/config # - /home/pi/media:/media
pretty sure I know the answer is no but want to check - I have 4 switchbot curtains that require active connections. I want them to open at the same time. 3 open simultaneously, one opens after. Guessing it's due to only allowing 3 active connections per proxy? But, I have 2 proxies + the actual bt of my device all within 10 ft of the 4 curtains. So it seems like they're all trying to connect to the same proxy vs 3 using the actives on one, and 1 on another. Any thoughts on how to investigate or troubleshoot?
Enable debug logging for homeassistant.components.bluetooth
It will show you which one it’s selecting
It should not select one, if all the slots are in use
thanks
I wouldn’t be surprised if there’s a race there, if you try to do them all at once, it might not know that the slots are going to be used so it might be too late for it to be marked as used before it tries all of the same one since it’ll have the best signal
If that turns out to be the case, we could try to make it race safe, but it may be difficult to do since it’s the remote, ESP that marks the slot unavailable, not Home Assistant
I'll play around and see if I can get some useful logs but that scenario makes sense
worst case I can redesign the automation to add delays between individual devices vs. just using a group like I am now. It might turn out that the short delay is faster than simultaneous due to the race condition
You might want to enable logging for bleak_retry_connector as well
It’s possible that it starts to back off because it runs out of slots, and it doesn’t know that if it tried again right away, there is another device that you could connect via
ok added both to my config file
got a bunch of logs now, but not sure what I'm looking for
If you send them over, I’ll take a look
pastebin work? Not sure if there is anything sensitive in the bt logs
pm is fine
I am a bit lost regarding BLE. I am getting raw BLE messages (bytes) from a passive Bluetooth device exposed over MQTT. How do I feed these to let's say xiaomi_ble or Home Assistant in general? The messages still need to be decoded and parsed somehow, but I don't know where to start. Could somebody point me into the right direction?
That’s not something that’s supported
So no wonder you are lost 🙂
Home Assistant has support for esphome Bluetooth proxies connected via the native esphome protocol, usb Bluetooth dongles, Shelly devices connected by its native protocol, and I think there’s another commercial vendor too.
It can in theory handle usb dongles that are physically remote using usb over ip (Linux driver) or usb over Ethernet hardware
It is very tightly optimised to deal with many proxies at once, and can do GATT as well (roaming within your house so that you always connect with the best proxy).
In my case it's a Shelly device. As far as I understand it pushes the BLE information either through a websocket or MQTT. It is however the very same information. So there is still nothing I can do with this in Home Assistant?
If you use the native shelly integration it will just work
Though it won’t support GATT and I dont know if its as heavily optimised as esphome
The thing is that native Shelly also does not work with MQTT.
No
If you decide you want your devices to work though, that is how, that’s all I’m saying.
Someone could probably make an integration that fed Mqtt advertisements in there like it was a vitual Bluetooth proxy
Though it would be more annoying to write than normal (stream of data containing data from multiple physical sources would need splitting back out into N virtual proxies so that the logic that Ha has for things like proximity detection and callback avoidance / event deduplication work)
Checked the logs. Sorry I forgot that the logger is now in habluetooth so you'll have to turn that one on as well
you need just habluetooth? Or leave the others on as well?
leave the others in because matching the messages to the times will be helpful
alright, updating the config and I'll pull another log in a few mins
so its working just as designed based on the log
here is the root of the problem
the ESP can only actually only establish one connection at a time
so probably 2 establish quickly since 3 get assigned to the one with 3 slots free
an one gets assigned to the other one with slightly worse signal
and the other 2 get in line behind the one with the 3 slots with the best signal
Any suggestions on what I might be able to do to reduce the slowness? Like would adding slight delays perhaps help?
i just set up my bluebooth proxy using this: https://esphome.io/projects/?type=bluetooth
it shows up in my integrations page as an ESP32 device but when i go into the ESP32 add on an option shows up to "Adopt" it. Do I need to adopt the esp32 ble proxy via the esp32 add on?
You don’t need to adopt it into the addon
The addon is for managing the configuration of the device and updating the firmware of the device
I ran proxies without the addon and instead updated the firmware myself with the ESPHome command line, only recently switched to the addon
It’s definitely worth learning how to update the firmware though
Another silly question - can espresence be also used for ble expansion? Or will it only do presence detection?
If they wanted to they could implement a Bluetooth proxy in Ha, but they haven’t so no it’s either or
Bermuda might be an alternative
hmmm interesting. got 5 esp32's so lots of trial and error over the next few weeks 😄
sad i'm paying more for the cable/charger than the esp's 😆
Low level user here. Please ELI5 😂
I have a FAN, that connects via bluetooth to its remote.
I'm trying to use HASS to connect/control the FAN entity via bluetooth
the FAN is in pairing mode, but it doesnt seem to be appearing in HASS
other bluetooth devices such as switchbots are working perfectly fine and discoverable
Generally speaking, HA doesn't pair with devices. There are exceptions, but ultimately, what matters is that an integration for your device exists. Most likely this is not the case. No integration, no connecting the device to HA.
Thank you that makes sense. Is it possible to pair stuff up much like how normal BT devices work?
Able to throw me some links on how to do it?
Any scenario where things need paired would be documented by the relevant integration. For instance, if you were using bluetooth HomeKit devices with the HomeKit Device integration, you would pair them using its method, but that isn't going to work for other devices.
Yup understand
Where i'm coming from is, how do i integrate them myself (for devices without any known published integrations)
I guess review #devs_bluetooth-archived because even though I thought I'd seen some recommendations and advice in here I could link back to, I can't seem to find them. I know GATT and BLUEZ are mentioned a lot, and I think it's generally suggested to start by looking at an integration similar to what you want to create, but presumably that channel is for exactly this sort of stuff.
To add to ^, Good starting pointing is to learn how to control your fan with “bleak”. That’s the library HA uses.
I have an ledvance bluetooth lamp. Is there any way to cannect it with Homeassistent
See above
What matters is whether there is an integration
If your device works with homekit you are in luck (some ledvance stuff does)
Welcome to bluetooth hell
does esp32 bluebooth have an option to show "network map?
Is it possible to snif a Bluetooth remote and to use this to send to the device trough home assistant?
Is there a protocol document for bluetooth proxies? - I want to add that functionality to a device that also does other things but if I have a protocol I could happiliy implement it.
There’s not really a protocol to document.
ESPhome Bluetooth proxies run over the ESPhome web socket, so I think there will be a proto file for that maybe? But you probably don’t want to implement the ESPhome protocol if you are not ESPhome.
One of the integrations has to poll a http endpoint on a gateway device to capture recent advertisements iirc
So the expected path is that you’d e.g implement a scanner in the integration for that device - https://developers.home-assistant.io/docs/core/bluetooth/api#registering-an-external-scanner
If your application is in python, you can use https://github.com/esphome/aioesphomeapi, https://github.com/Bluetooth-Devices/bleak-esphome, and https://github.com/bluetooth-devices/habluetooth to talk to a proxy as if it was a local adapter using a bleak client
at some point when I finish out the coverage for bleak-esphome I'll add some docs but right now you'd have to look at all the current usage to figure out how to do it
That gets me halfway there - I can register a scanner, and request scan data over http, is there any resource on how I'd support on not just scanning but allowing home assistant to request a bluetooth connection / send a GATT message via my integration?
oooh, I might be able to get an understanding of how those integrate with HA, and just inject my own transport mechanism in, maybe 🙂 - are any of those actually HA integrations though? First glance makes me think they're clients for ESPHome devices, and that's what I'm changing, I need to create an integration that provides a bluetooth adapter to HA, but talks to my devices, probably with a simpler protocol - I just need to find devices and send gatt messages
Bdraco refactored a bunch of this out of HA so that you could use esphome Bluetooth proxies more easily outside of HA, but it was originally inside HA. The bit inside Ha is here - https://github.com/home-assistant/core/blob/dev/homeassistant/components/esphome/bluetooth.py
Thanks for the pointers, I think that's a decent amount to go on 🙂
Hello everyone! I am looking for a solution with HA to the following use case:
I live in an apartment at 7th floor of a building. When i arrive at floor level entrance from outside, i can manage to open the main building door from HA via ring intercom.
But to do that, i need to take at least my mobile, unlock it and push something on HA.
I was thinking to use a small BLE beacon, one of those with a small button, that you can use also as tracker, connected to my mobile. So that i don't have to take my mobile but just push the button of the beacon which is on my keyring.
I couldn't find any solution to get the button trigger signal to the mobile, so that it could open the HA switch. If i am inside the home, any ble reader (esp32 or so on) can get the signal and it works... but what about when i am down and not in the range of my aparment?
I've got three MiFlora devices that work with the Xiaomi BLE integration. Two of them have successfully connected but the third refuses to show up in HA.
I'm able to connect to the device from my phone and read the values and it even shows up in bluetoothctl from HA as well. Anyone have any pointers as to why it might not be showing up in the Xiaomi BLE integration?
I don't know but things like firmware version would be good to compare between working and non working
All on the same (latest) version
Using a USB dongle or proxy?
Using a dongle, not sure which one tbh but it's been working fine for forever
Do they passively emitdata or require an active connection
Yeah. Especially if it works in the app
Try taking one of the working ones offline and see if this third one starts working?
Doesn't seem to be so far
I'm Assuming you've moved the sensor around. Is the dongle on a USB extension cable?
It's attached directly to my server in the front usb port
And yup moved it all over
put the battery in and out to force it to broadcast as well
2024-04-22 00:32:42.712 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (00:1A:7D:DA:71:15) [connectable]: C4:7C:8D:6C:15:11 AdvertisementData(local_name='Flower care', service_data={'0000fe95-0000-1000-8000-00805f9b34fb': b'q \x98\x00$\x11\x15l\x8d|\xc4\r\t\x10\x02\x00\x00'}, service_uuids=['0000fe95-0000-1000-8000-00805f9b34fb'], rssi=-75) match: set()
Put the bluetooth integration in debug mode and it's definitely seeing the device
Xiaomi BLE integration on debug mode says absolutely nothing
I just found out my scale connects to the Xiaomi BLE integration as well
Just paired it and it worked right away
But still no sign of the mi flora
Sounds like you've done everything that I can think of. Maybe someone else will come along with more ideas.
So, I have a question related to a bluetooth ESPHome device I added to my HA setup:
Is there an easy way to confirm the bluetooth signal and capabilities of a device that was flashed using this guide: https://esphome.io/projects/index.html ?
I used a simple ESP32 WROOM board https://a.co/d/j0mzxMI
Followed the directions and flashed the software on to the device. I plugged it into a wall socket that is relatively centrall located. But I am not smart enough to know how to check the logs/determine if it's actually operating as a bluetooth proxy and helping me to extend my bluetooth range in my house...
How can one test signal? Can I find a way to unplug the proxy, scan for bluetooth somewhere, and then plug the proxy back in and see a noticable "different" strength? I apologize if that's a silly question ad not how Bluetooth works, but I'm just trying to understand if my plugged in proxy is actually doing anything and how best to test. Thanks ahead of time!
I hope so! Was kinda hoping they would add themselves overnight but nope...
I can see all four Flower Care devices in Bluetoothctl but only two of them were picked up by Xiaomi BLE
bluetoothctl remove [mac] removes the devices so it no longer shows up under bluetoothctl devices
Then reinserting the battery makes it show up again
So the bluetooth dongle is definitely seeing the device, it's just not being communicated to the Xiaomi BLE integration
https://github.com/home-assistant/core/issues/91237
It seems like I'm not the only one with issues here, but people are saying it's related to the Linux kernel. I'm however running Home Assistant OS in a vm so I can't really downgrade the kernel or anything afaik. Fully rebooting the vm also doesn't seem to do anything
It usually is range, interference, bad Bluetooth chipset, wrong fw version, wrong kernel
Which is what you will find in Google
And I don’t think it’s the case for you
Quick question, have you tried restarting Ha?
Sometimes they don’t show on the discovery page but do show if you go onto the “add integration” button and choose the Xiaomi ble integration. Not a bug but a side effect free of some performance trade offs that had to be made, iirc.
The other surprisingly common gotcha is that they accidentally ignored a Bluetooth device.
Make sure “show ignored integrations” is ticked in the discovery filter.
Some of the problems we have with Bluetooth on Linux is with bluez not completing “discovery”. Not much we can do about that, esphome is usually much better for devices that are hitting those sorts of problems.
Or you could try setting the Bluetooth integration to passive mode (should be fine for Xiaomi devices).
And theres definitely no ignored or disabled integrations in your setup?
Welp that was the problem
Apparently all other MiFlora devices were ignored for some reason
Yeah that was it ahaha
I've been searching through the source code and everything to find what could possibly cause all of this but apparently it was just ignored 🙃
It's discovering them now 💛
Great stuff!
Thank you so much past / current you haha
That's great!
So, I have a question related to a bluetooth ESPHome device I added to my HA setup:
Is there an easy way to confirm the bluetooth signal and capabilities of a device that was flashed using this guide: https://esphome.io/projects/index.html ?
I used a simple ESP32 WROOM board https://a.co/d/j0mzxMI
Followed the directions and flashed the software on to the device. I plugged it into a wall socket that is relatively centrall located. But I am not smart enough to know how to check the logs/determine if it's actually operating as a bluetooth proxy and helping me to extend my bluetooth range in my house...
How can one test signal? Can I find a way to unplug the proxy, scan for bluetooth somewhere, and then plug the proxy back in and see a noticable "different" strength? I apologize if that's a silly question ad not how Bluetooth works, but I'm just trying to understand if my plugged in proxy is actually doing anything and how best to test. Thanks ahead of time!
Alternately, is there a way people generally check logs to see if a bluetooth proxy can see devices?
i'm tempted to just retry the flashing of the ESP32 and trying again...
You might be able to read from #bluetooth-archived message
tbf, I don't remember, but this sounds similar to when I wasn't sure mine was working.
Oh man! Thanks! That looks definitely similar to what I'm after, Ill go take a look! Thanks @devout hearth !
Hello. I'm trying to setup Xiaomi BT temperature sensors (LYWSD03MMC). I could connect from android app, and see temp, but not from HA. I added devices in HA, but they show only signal str.
The integration works by listening to broadcasts from the device. But not all broadcasts are the same. And they don’t have the same frequency. If you only see signal strength then you have see at least one advertisement from the device, but not one containing a value. Or perhaps you did, but the encryption key is wrong (that will create a task in the repairs dashboard).
That device is a little bit annoying because it only broadcasts sensor data every 15-20 minutes.
And if you do it wrong, you have to wait that whole time to try again.
The app uses a different method that uses more battery, which is why it works there
First of all, what does the signal strength look like?
Have you entered an encryption key yet, and was it accepted?
And what Bluetooth dongle do you have?
You mentioned key, do i need to reflash it with the pvvx tool?
No
You can use the pvvx tool to generate a key
Or there are other methods to leak them from cloud services
dongle: edup bt 5.1 B3536(814)
It looks like that’s a Realtek 8761B
Realtek can be quite painful to use for Linux IoT (some models crash every few minutes)
Ha does a good job of restarting them when the chip crashes, but it means you might see gaps in your data. And if you have a sensor that doesn’t broadcast often like the one you have, it magnifies the issue
I used the pvvx tool to change the firmware on mine, and set the beacon type to BTHome
Oh, you won’t get beacons from the device at all while it’s connected to the pvvx tool. So if you used it to get a key and then left the tab open it won’t be broadcasting any data until you close the tab.
TL;DR - you won’t see any data until you enter an encryption key. HA will create a repair task if it sees any encrypted packets and doesn’t have a valid key. You’ll be able to enter the key there. If you don’t see that, then HA isn’t seeing broadcasts with data from that device. Make sure your dongle isn’t crap, make sure your signal strength is good - -70 is good, -80 might not cut it for this sensor (but would be fine for BTHome probably) and -90 probably not good enough.
Oh and it won’t broadcast data if no key is set at all, so you’ll likely need to make one with pvvx first.
Thank you! It helped a lot. I was able to get token/keys for one of the termometers from my phone.
I'll try to get new BT adapter. Which chipset/model would you recommend? 2 floor house.
and is there difference which bt version? 4/5/5.2?
Read the Bluetooth integration docs
Someone has tested a big bunch and written it up
CSR and Broadcom chipsets are best
You probably aren’t going to get full house coverage
But you can get esphome devices to extend the range
5 and 5.2 dongles are pointless
The Linux drivers don’t really have a userspace interface for any of the new stuff
And none of our integrations need 5 specific functionality
Ok, thx
Is there a reason why some bluetooth locks are instant and others aren't?
I just got a Switchbot Lock Pro to replace my Ultraloq U-Bolt Pro. Both only have built in bluetooth, no wifi or anything else.
My U-Bolt has always been instant the moment I use the app, fingerprint, or code. The gears turn immediately.
The Switchbot Lock Pro always has some delay. Mostly around 2 seconds although it can be near instant or have worse delays sometimes.
Depends on lots of factors and is not surprising.
When we first did naive Linux Bluetooth based HomeKit it took near a minute to establish a connection, but was more like 5 on macOS.
It will depend on how many GATT characteristics the device has, how many GATT calls are needed to unlock from a cold start (for homekit it’s 3 or 4 for example), how often the device sends out beacons and when we last saw one (bluez won’t let you connect without a recent beacon). The antennae design can have an impact. Some only work well within half a metre of the vendor app because the power levels are small for security.
It’ll typically be much faster if there is an existing gatt connection that is reused, but those tend to time out fast.
Using HomeKit as an example again, the connection involves a fair bit of crypto so can be slower if the lock has a weedy chip
The more technical stuff you said is over my head, but overall it gives me an idea about why it is this way so thanks.
Not sure if this part matters, but it does take longer for the U-Bolt to make that BT connection than the Switchbot.
But when it is connected, controls are instant. Even when controlled remotely.
That fits with all the stuff I said. BLE is pretty quick when you have a GATT connection setup.
But they expire in less than a minute for many devices and on top of that only the best dongles can manage even 5 active GATT connections.
I think esphome (especially wired) can be faster than Linux here, though I might be misremembering.
Wired esphome proxies can certainly outperform Linux
And connect times vary enough between dongles that we call it out in docs - one vendor is best for connect times and one is best for simultaneous active connections.
I'm already have 4 BT proxies spread around my house. I'd definitely add another one just to have it right beside the lock.
Unfortunately the Lock Pro isn't supported yet in the Switchbot BT integration yet. Hopefully it doesn't take too much longer.
is this were i would ask questions around espresense?
Not really
The developer for https://community.home-assistant.io/t/bermuda-bluetooth-ble-room-presence-and-tracking-custom-integration/625780 is sometimes in here though
Hi all, after update to 2024.4, some of my BTHome devices stopped working. They do not report any data to HA (via btproxy). However, some other devices (the exact same model and firmware) keep working flawlessly. I tried a reboot, integration reload, and rebooting the bt proxy but nothing helped. Did anyone alse have the same problem?
the switchbot lock pro still not work on home assistant with bluetooth connection?
I have the Lock Pro and it's still not supported yet.
does it work with the hub mini or just the hub mini 2?
If you want it in HA via Matter then you need the Hub 2 or the Hub Mini Matter.
I'm using the Hub 2. It works but response can be really bad since my Hub 2 is far away.
i will wait for the bluetooth integration on HA
Response is pretty good if you have the Switchbot Hub nearby.
But yeah it's much more expensive than a esp32.
ok, i have the first switchbot hub mini
i can use it before the integration on ha
the hub mini, the first one
nuki 3.0 is better than the switchbot pro?
I'm American so we don't have that over here.
I'm guessing both work fine though so it's about aesthetics and options.
the lock pro is fast opening and closing the door?
No, there is a bit of delay. When I unlock with a fingerprint or fob, it normally takes about 2 seconds before the gears start moving.
I think it's caused by the wall though since the keypad is detached.
I see near instant results when using my phone or the Hub 2 a few feet away inside the house.
ok, inside the home when pressing the button to open the door is fast to open the door?
It's consistently the fastest way to lock and unlock because it's the only method that's local to the Lock.
Every other method uses BT and varies a bit from like 1 to 2.5 seconds.
But mostly around 2 seconds when using the keypad from my experience.
I like the Lock Pro, but admittedly this is kind of annoying for me since I'm coming from a smart lock that was near instant all the time.
2 seconds is fast, i saw a video and i think is fast
2 seconds is perfectly fine, it's just that I spent 3 years with a lock that was basically instant.
Maybe .5 seconds at most before the gears start turning.
compared with nuki, for example, is much more cheaper
i will just wait the Bluetooth integration on HA to buy it
If you get it, I think you'll like it.
thank you for your help
No problem 👍
hi, just wondering what I need to connect Adaprox switchbot/fingerbot directly to HA, I guess through BLE.
I put a bit more of my finding on this reddit https://www.reddit.com/r/homeassistant/comments/1clcg29/how_to_connect_adaprox_device_to_home_assistant/ . But in short, I think it's a knock off version of tuya, so I can connect to Tuya (only fingerbot, and not the switchbot) but I would like to see whether I can directly control them through HA since I believe they are connecting to things through BLE
They make a zigbee version of that fingerbot and it works in HA. It should work better since it's Zigbee, so just get that one instead.
yeah I'm aware. Just that I have a bunch of these lying around for quite some times (brand new too 😭 ) and I wanna do something to make it worth it
It doesn't seem like you can connect them through bluetooth. Sounds like you'll have to buy a gateway, and then it works through the cloud.
I hope they release a bluetooth bridge for Tuya devices at some point. They already have a bunch for zigbee devices.
I'd buy one since I have a bluetooth doorknob that I'd like to get into HA locally.
why don't you think it can be connected through bluetooth? I mean gateway is just another bluetooth receiver device, right?
I did a quick google search and didn't find any results saying that it can be done.
Does anyone know if the hass_nuki_bt integration works with the Nuki smart lock 4.0?
maybe a bit obscure but can i plug this into the computer that is running my hass vm and use it to run hass_nuki_bt?
https://www.interdiscount.ch/fr/ordinateurs-et-jeux/câbles/câbles-et-adaptateurs-informatiques--c524000/intertronic-dongle-adaptateur-usb-a--p0013800035
You need to figure out what chipset it uses. There’s a good chance it’s Realtek and they are rubbish for IoT on Linux.
When it’s not a Realtek dongle the next most common problem is the hypervisor bungling the passthrough. We’ve had people getting a dedicated pci-e usb card to do pci-e passthrough before, because usb passthrough was so unstable. We’ve also had people go bare metal because of it.
Also you need to think about range. Can’t say for yours but I know some locks that have an effective range of about 1m for security reasons (and battery reasons).
I've been using Shelly Blus as bluetooth proxies for some xiomi sensors which have been working great. However, I recently added an Airthings Wave + and for some reason I can only get HA to pick it up using a bluetooth dongle and not with the Shellys. I'd prefer to use a proxy so I can place the Wave further away from my server. Any ideas?
You need to use esphome Bluetooth proxies for that
Shelly’s are one way
How so? Why would airthings need something other than read?
Xiaomi uses Bluetooth advertisements to broadcast sensor data to anything in range. Airthings uses Bluetooth GATT. It is only reading from GATT, but it has to send a command to air things to read a value. Or to subscribe to a value. So it’s not “writing” any values, but it does need to ask the air things questions if that makes sense.
Interesting. Thanks that helps. Are there turnkey esphome proxies that are are in like a usb stick form factor? Everything I've seen seems to be like a board with a usb cable
I have something like that from m5stack. Can’t remember the name off hand.
Or there is a gl.inet board that is better in a few ways but unfortunately you’d need to do some soldering the first time you set it up
Other than that I think there are some 3d printer templates for the olimex POE boards 💪
Or you might be able to migrate a Shelly to esphome
All of my Shelly’s run esphome but I don’t have any esp32 ones so I don’t know what your options are there.
I've been getting a lot of The proxy/adapter is out of connection slots or the device is no longer reachable errors for my desk light lately but I'm not sure why. I only have one BT device connected to HA (Yellow hardware, external BT adapter). Was working fine for the last 3-4 months since I've installed things. Could it just be new interference or something ?
That could do it. Could also be the dongle failing in a weird way. Some of them are very crashy, could be that Ha is recovering it but it’s still in an easy to break again state. Hopefully the integration you are using has a signal strength sensor. You should be able to see interference on that fairly easily, and gaps would indicate HA intervening with a crashy dongle
Hey everyone. I have some bluetooth devices (temp sensors) connected to my home assistant but i'm having troubles with them always being not available, no matter how close or far away they are positioned. all of them are unavailable from time to time. Any ideas to help me debugging this?
from that info, primary suspect would always be bad bluetooth dongle
e.g. realtek based dongles (and that covers a lot of them) crash every few minutes when doing iot stuff under linux
It's an onboard bluetooth chip (m2)
HA recovers crashed dongles so it sort of works, but you see gaps in data like you do
Can i increase the recovery speed?
no
theres not a "crashed" event from the dongle
its still semi responsive, theres just missing data
(my first dongle would still be able to see my TV, in another room, but nothing else, even stuff right next to it)
we've had problems with some intel internal cards (linux driver regressions) - i think those should be fixed in HAOS, but if you aren't running HAOS you could hit them still i guess
I'm trying to find out which chip it is right now...
another common cause of trouble - trying to pass bluetooth from a hypervisor to a vm
don't know why but a lot of hypervisors suck at it
intel/ibt-1040-0041.sfi
passing through the entire pci-e device rather than the usb endpoint is meant to be better, but lots of people go bare metal to fix it.
i'm doing exactly that 🤔
and then my favourite - either the bluetooth antennae is internal or its not actually connected up
if its still not fixed after going bare metal and getting a broadcom/csr usb bluetoothh dongle on a long extension cable, then its usually the batteries (a lot of these cheap bluetooth sensors may as well replace their battery sensor with a random number generator)
i don't really want to go bare metal - i could maybe try to forward the pci device instead of usb device? not sure of my hypervisor is capable of that
well, the people that have done it got a dedicated card
I don't need the card on the host at all
because you don't want to passthrough the usb that your kb/mouse plugs into etc
it's only for HA
depending on your board, internal stuff might be plumbed into the same bus
Oh i can't post images in here. it's just a m.2 key-e module on a normal m.2 key-e slot
I've got a generic Nrf52810 BLE tag which I can see in the iBeacon android app. I've installed the iBeacon Tracker integration and added the UUID as allowed. Bluetooth is enabled but yet the BLE tag doesn't show up as a device regardless of what I do. I have restarted HA several times and the tag is right next to it. Any other ideas?
There are several heuristics it uses to try and stop HA getting DOS’d by bad trackers. I think a common problem is if there is no name. Don’t use it myself so can’t say more than that.
Thanks - I may need to try another tracker. The integration reads "To explicitly allow a list of UUIDs to be added even with an empty device name, add them via the integration options." so technically it should work....
So for my Switchbot Lock Pro, I moved the Hub to be within 3 feet of the lock. The weird thing is that I have the most inconsistent lock times when using a NFC tag from HA vs any other method.
It's fast most of the time and often nearly instant. But I've also been stuck at the door(and tested it) for 4-5 seconds waiting for it to unlock.
I got fed up with it and put a Switchbot NFC tag out there instead. In my testing, that and the keypad is not as fast at their peak speeds, but at least they're consistent(always 1.5-2.5 seconds)
Honestly I'm mainly ranting as I don't think there is an answer to this. But if there is, is this more likely a BT issue or Matter? I put it here because I thought it probably had more to do with BT.
Is this lock via switchbot hub connected via matter vs switchbot lock connected via home assistant Bluetooth?
If ha Bluetooth, why proxies or dongle are you using
It's the new Lock Pro, no support from the integration yet. So I'm using the Hub Mini Matter to get it into Home Assistant.
So matter in home assistant to bridge to lock vs what? Native Bluetooth in their app? iOS? Android?
The detached BT keypad and my android phone when using the native app.
Ok, I don’t know enough about those to say anything useful other than to agree that it’s just tough.
We know for sure the iOS Bluetooth stack is leagues ahead of Linux for example, and we know that esps port of bluedroid is better than Linux too.
There’s so many factors at play here. If it’s running matter on Linux then there’s a fair chance it’s running bluez and because there aren’t many examples of doing Bluetooth on Linux well I’d wager it’s slow naive bluez with the slow dbus broker. I think I’ve said before it took a lot of work to bring our homekit code down from 60s to a few seconds in bluez. And that’s only with replacing system components like the dbus broker. Involves a lot of trickery to get to that speed. Where as the same code on macOS was just fast out of the box.
If they are running something embedded like an esp32 for example, it’s common to share the radio between Bluetooth and WiFi. Which is why we encourage proxy users to go Ethernet - it can drop you below Linux speeds otherwise.
Okay, thanks for taking the time to explain again. I'm mainly just bummed because I finally have a local control lock inside HA. But using HA to control it is the most inconsistent method.
Hey everyone, are there some basic debugging steps i can take if HAOS does not detect my bluetooth? its a wifi/bt combo, the wifi works perfectly. it's an Intel(R) Wi-Fi 6E AX211 160MHz
It’s probably a driver/firmware issue. The “dmesg” command will probably give a clue.
I think i might have found the issue.. I passed through the pci device but it seems that the bluetooth part is another device i would need to pass through? could that be correct?
Yeah
It’s quite common for pci-e Bluetooth to actually be usb
Btw we get a lot of people reporting issues with usb Bluetooth passthrough on a hypervisor
Some people get a dedicated usb pci-e card and pass the entire card through which seems to work better than usb passthrough
Bluetooth: Core ver 2.22
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: BNEP socket layer initialized
Bluetooth: hci0: Reading Intel version command failed (-110)
Bluetooth: hci0: command 0xfc05 tx timeout
hmm
I might have a solution but i do not know how to execute root commands with haos :D
Please don't share images of text, share text as text
Please use a code share site to share code or logs, for example:
- https://dpaste.org/ (select YAML for the language, and consider picking a longer expiry)
- http://pastie.org/ (select YAML for the language)
- https://paste.debian.net/ (you guessed it, select YAML as the language)
Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.
Any idea why the Sena UD100-G03 (which is in the supported list for Home Assistant Bluetooth adapters) won't configure properly on Home Assistant OS? OS 12.3, Core 2024.4.3, Supervisor 2024.05.1.
It sits at Initialization for a very long time, and then eventually fails. This same dongle works fine on my HA Core install (within Arch Linux).
Might try upgrading to Core 2024.5.4 (since it's now available) and seeing if it persists.
Hello ! I would like more information on how I could setup ESPPresence. I currently have an old laptop running promox and virtualized home assistant. This laptop does have a Bluetooth 3.0 I think on it. Sadly I never managed to make it work (I can replace the module inside the laptop). Is a Bluetooth dongle required to make ESPPresence work ? I was thinking the Apollo Air 1 can listen to Bluetooth advert and say "hey I've detected this UUID" at xx m away trough the wifi connection already working.
Espresence isn’t part of HA and doesn’t directly utilise the Bluetooth APIs in HA so this might not be the best place to get help with it.
You also can’t use our own Bluetooth integrations at the same time - an esp can’t be one of their presence nodes and one of our proxy nodes,
there’s a custom component that doesn’t something similar and its developer is in here from time to time and it does work with our Bluetooth proxies. It’s https://community.home-assistant.io/t/bermuda-bluetooth-ble-room-presence-and-tracking-custom-integration/625780
You don’t need a Bluetooth dongle for that, Shelly’s or some ESPhome devices running as Bluetooth proxies is enough
Okay this is great information! I'm going to read to see if it match my needs ! Thank you very much !
If your needs are simple then a built in integration might be enough. For example, iOS devices are compatible with private_ble_device and that will tell you which proxy they are nearest. I use them to arm the alarm when I leave, turn the tv off, etc.
Yeah thats almost the same thing i want to do 😄
2024.5.4 seems to have fixed.
Is ESpresense still the way to go? I finally have it setup with 3 cheap 32's and I have some m5stamps on the way... But before I go through setting up Companion and the like, is the a better path to take? ESpresense just feels like it's been missing some love and attention for the last year
Depends what your needs are. See discussion above. It doesn’t leverage any of the Bluetooth work in HA (which is what this channel is about) or esphome.
https://community.home-assistant.io/t/bermuda-bluetooth-ble-room-presence-and-tracking-custom-integration/625780 might be enough for your needs, and uses stuff from the HA ecosystem. So you can use those esps for Bluetooth sensors st the same time as positioning.
If your needs are super simple you might not even needed that. I track iOS devices with private_ble_device (built in to HA) and it tells me which ESPHome proxy I’m nearest to
I was trying to do this with ble_rssi sensors in ESPHome but it doesn't currently support irk. It was merged into the dev branch 2 weeks ago but it's unclear how things get put in a release
If you need irk now can’t you use esphome Bluetooth proxy and then private_ble_device integration that’s built into HA? That’s supported irk for months and months.
Then Bermuda supports data from that integration if you need more than what is built in
As for esphome, I think it might have moved to a monthly release so I wouldn’t expect something new until June
(Other than bug fixes)
Tbh I didn't know that integration existed. Do you know if there are any differences between that and the ESPHome ble tracker? Seems hacky to use one platform for my android devices and another for iOS
Are there any simple/small/nice looking/can just plug in to an outlet (US) devices that I can make bluetooth proxies without having to pry them open and do more to them?
HA has a central Bluetooth manager. It’s better to use that when you have devices that roam between many esphome devices
It’s like having a mesh vs having lots of standalone hubs
I'll give it a go, thanks!
Hello!
I bought a Byintek K45 Smart Projector. It works absolutely fine except the fact I don’t know how to connect it to my HA. It has bluetooth remote, so I have two options:
- Try to sniffing bluetooth package from remote and try to reproduce it
- Try to disassemble remote and connect button to esp32.
I don’t really like both of this options, and would like to know if some other solution exists.
I am thinking about tracking 6 ble ibeacon tags to monitor the home/away state of 3 cars and 3 garbage bins in my driveway area. Could a single ESP 32 track all 6 tags? What models of iBeacon would you guys recommend?
I already bought one additional IR remote, and for some reason it controls only volume up.
It has Wifi onboard, but it works only when device is turned on.
i like bluecharm a lot
if it has ir you could learn the on/off from the existing remote. there are a few ways to handle ir. something like a broadlink or diy with esphome. (t if you want to go down that route there are plenty of threads and chats about it)
Yep, I know. But existing remote is bluetooth, without IR, and second isn’t work correctly
Got yA
Hi. I have several Xiaomi devices, including 4 thermometers and 2 cameras. I installed the Xiaomi Miot Auto and HA was able to identify all of the devices. However the thermometer shows "unknown" on the temperature. Has anyone a similar issue?
I’d doesn’t use the HA Bluetooth infrastructure so I don’t think you’ll find help in this channel
This is more for help with integrations like Xiaomi-ble which use your local Bluetooth dongle (or ESPhome Bluetooth proxies)
Hi!! I have a question... I´ve installed Home Assistant on a Raspberry Pi 3B+ and I have a temperature sensor from tuya (smart life)... in my mobile app I can see history and temperature/humidity but in HA I can´t see, say "No available"... does Raspberry bluetooth works as tuya gateway?
I don’t think anyone has made a tuya integration for HA Bluetooth.
Also the range on the pi Bluetooth is pretty low even if they did
thanks for your reply, then... how people add tuya or smart life devices to HA?
you mean Raspberry bluetooth, right?
Raspberry pi, yes
I don’t know about tuyA
I know that the regulars here think it’s trash, so I never looked into it
I think my heating might be based on rebranded tuya actually but it’s zigbee so that’s no help to you
You might have more luck in #integrations-archived
As I read in forums... I need a zigbee USB dongle connected to raspberry to connect tuya and smart life to raspberry... I think raspberry bluetooth is not compatible with tuya
oh, I post in # bluetooth , maybe is my mistake
If you have a zigbee based tuya device then there is #zigbee-archived
I´m not sure... I have a wifi switch and a temperature and humidity sensor... I connect them with smart life app in my phone... maybe it´s bluetooth, could be?
There’s a list here - https://www.zigbee2mqtt.io/supported-devices/#v=Tuya,TuYa
in iot app of tuya... discover my devices but show it´s offline.... but in my mobile app show me temperature and humidity... I´m confused
I don’t think we can help you in here, unless there is a specific integration you are trying and that integration uses the Ha Bluetooth code directly.
I bought it in aliexpress... say bluetooth communication... as I understand, bluetooth and zigbee are different systems, right?
Very different
as I know, first difference is frequency work
different frequency
Jc2k thanks a lot for your support and time... I try in #integrations-archived and #zigbee-archived
Don’t cross post. Start in #integrations-archived
yes, of course, I don´t post on both, I try as you say, in integrations
maybe my device is bluetooth because I linked it to my app phone through bluetooth
I can see history and actual reads on my phone
After some light google searching I do see https://github.com/PlusPlus-ua/ha_tuya_ble fwiw. But it looks unmaintained.
I generally don’t recommend new Ha users touch custom components, it can be a disappointing experience as they often aren’t kept up to date or do things that make your system slow and unstable. It can be tricky to debug them.
Indeed looking at the issue list that one has been broken for a while..
yes, you´re right... I was trying to setup some days before , searching in google... with no luck...
maybe my devices (aliexpress devices) could be tuya clones... I´m not sure.. but you clear me some doubts... I´m sure that my devices are bluetooth, not zigbee
Tuya make Bluetooth and zigbee devices so I can’t.
If you don’t have a hub or gateway device and your phone can control them, they are Bluetooth and/or WiFi.
yes, it´s bluetooth... I search in aliexpress order and say need tuya bluetooth gateway
Hi, does anyone have it installed or can I help you like Tuya ble, I'm trying to install a fingerbot and it's giving me the error 500 Internal Server Error
maybe I should be asking here, are bluetooth proxies able to forward bluetooth commands from HA for an active connection? Working on an integration and have one person (whos working on it with me) able to use a proxy on its own to connect to a device. I however have a yellow and my proxy connects and immediately disconnects after getting the service info which isn't ideal at all
I'm using an esp32 vroom as the proxy,
The ESPhome Bluetooth proxies support active connections. On a lot of my production systems I don’t have a local Bluetooth adapter and exclusively use the proxies the os level Bluetooth stack is better maintained on the ESP systems
The issue I have is my Yellow works fine and can send the required messages using self.client.write_gatt_char(UUID_WRITE_CHARACTERISTIC, data, True) but the proxy does not send through these gatt messages and just disconnects after getting the service info. I can't figure out why
if I activate my proxy I can no longer get data from the device. I'm trying to workout if its just a bad esp32 or something I've overlooked in my integration or.... who knows what. Information on how the active connctions work for esphome is very limited.
Are you testing with the logs for the proxy open? Does it just disconnect? Or does the proxy reboot?
yeah I had the logs open, it doesn't reboot.
let me go reconnect it again
now have it plugged directly into my laptop and have serial port monitor open, so if it does reboot I'll see it
it gets to here
ESP_GATTC_NOTIFY_EVT[0m
][esp32_ble_client:084]: [0] [90:38:0C:6E:EE:9E] Disconnecting.
BT_HCI: hci cmd send: disconnect: hdl 0x0, rsn:0x13
BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16
BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x16
BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x16
ESP_GATTC_CLOSE_EVT
[0m BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16
what controls when it disconnects? perhaps there is a timeout I've set too short?
So tested with another esp32 and it also connects but disconnects too early, which leaves the device in HA in an Unknown state
Hello friends, can anyone help me with tuya ble
What's the specific issue?
The disconnect should only happen if the device triggers the disconnect or the connection is lost for some reason. If you enable debug logs for aioesphomeapi you can see all the traffic sent to the esp
have anyone ever used GL-S10 Bluetooth IoT Gateway ?
It’s quite popular but you need to use esphome not the stock firmware. That requires soldering.
hmmm I'll probably need a video. But I think i got the gist
I have a BT proxy running in my garage and I had to unplug it to move it and now it is showing all the BT entities as unavailable. Any thoughts on my next move?
When I open my logbook I have this literally non stop logging of this alert
ble mac 12EF29EAA98E5BFAAC2B7EC87F63F258 changed to AC:4D:16:08:BE:EE
12:02:24 PM - 3 seconds ago
repeat several thousand times, still ongoing, different addresses
Quite literally thousands of these, and it won't stop, 3-5 happen every second. What's going on? I have no idea when this started I just opened my logbook and saw this happening and it's making it difficult to see just about anything in the logs.
I was fiddling around with the bluetooth settings, as I'm trying to pair a new bluetooth sensor, but I have never encountered this.
this stays the same ble mac 12EF29EAA98E5BFAAC2B7EC87F63F258
but the portion after "changed to" keeps changing to random addresses
are you on macos
any xiaomi devices? does the proxy show as online?
(and can you "ping" it from another device on your network)
No xiaomi. Proxy is showing as "away" not sure about ping ill have to check
proxy shouldn't show as away, that sounds like a device tracker, i think we must mean different things. can you post a screenshot?
Ugh my phone is not letting me share a screenshot. I'll upload one when I get home.
You’ll have to use an image sharing site, most users can’t post images directly
👍
so you were right that entity is a device tracker. I can see that and Safe Boot and Firmware for the device, and yes it is pingable. What would you need a screenshot of to diagnose further?
I just gave up on troubleshooting and reconfiged it
turns out it was an issue in the library I wrote, no errors, just eventually managed to track it down.
No I'm not
Anyone have any tips for connecting to ESpresnse from a Pixel phone? I have BLE transmitting in the app, and I can't see it on the Fingerprints tab
If its esphome based it connects to ha via websockets/http
So in short I don't think you can over Bluetooth if that's what your trying to do?
Oh I'm using ESpresense actually. I'm using it already for a couple Tile trackers and a smart watch, I just can't get it to recognize my phone, it's very odd
Hello there.
I have a BT problem haunting me for few weeks now:
My Bluetooth integration keeps restarting the controller entry after this error is shown:
https://imgur.com/a/73y2QET
I tried researching this. The only interesting things that I found is this "Known Issue":
https://github.com/home-assistant/core/issues/92379
But from what I read, this should be fixed for Yellow boxes.
oh I see now what you mean.
Can anyone tell me what is the correct way to increase the update interval for a sensor, when using esphome bluetooth proxy? It currently seems to update once a minute. I'd like to have it update every 30 seconds or maybe even less. I searched online and the recommendation was to use an automation to update the entity. That didn't work for me. I looked into the interval settings but that doesn't seem like it should be changed, since the defaults are 1100 seconds. I tried searching the discord but didn't have any luck. I am sure its just something simple I am overlooking.
You can’t for a lot of the Bluetooth sensors.
Update interval is more for things that scan or poll
okay thanks, also I am using iBeacon but I am wondering if its not maintained, should I switch to bermuda or bluetooth le trackers?
Most of the Bluetooth sensors are passive listeners and so see every radio packet
Some of my inkbirds update even more frequently than that
so that 1 minute interval is likely from the sensor broadcast? and not the bluetooth proxy reporting?
Yes
Ibeacon is maintained by one of the most prolific maintainers in ha. It is definitely maintained more than the ble tracker integration
okay so I can stick with ibeacon, good to know
Any way to get that into home assistant? Are these moddable to esp with a chip?
They're tuya Bluetooth
Maybe tuya cloud cutter supports it
I have sniffed a few Bluetooth commands and extracted the parts that I need what is the easiest way to send this trough home assistant
You need to write an integration that uses the bleak python library
After upgrading to 2024.6.0 I get this error in my custom component: TypeError: Too few arguments for <class 'homeassistant.components.bluetooth.passive_update_processor.PassiveBluetoothDataProcessor'>; actual 1, expected at least 2 Never had issue before. repo: https://github.com/jdeath/renpho
You’ll need to report that to the custom component
Was there a way to hook ultraloq Bluetooth version to HA (or with the wifi bridge)?
It's my custom component, sorry probably should have been posted in the dev channel. Just wondering what the fix is, since it did not throw an error before. All documentaiton I found says it still takes one argument.
Figured it out. Line PassiveBluetoothDataProcessor[Optional[Union[float, int]]] needs to change to PassiveBluetoothDataProcessor[str | int | None, SensorUpdate] . Not sure why there was not a note in the "Backward-incompatible changes" section that a function defination changed. Working correctly now and integration reads the BLE data. Found it in the oral-b integration, which I based mine on years ago.
That use to be my main front door lock. The only way I think you can get it into HA is to add it to Smartthings and then ST to HA.
Still requires the cloud obviously. Unless you have the Z Wave version, I think that's the best you can do.
So.. have kind of a bluetooth/homekit/homebridge question
I got an Aqara U100 lock, and so far i really like it. No interest in their hub but I am interested in the homekit homekey stuff. I have AppleTV and i also have my HA setup with home bridge. The bluetooth proxy of HA discovered the U100 and I set it up there as a homekit device...
I've seen people say it can't be added to homekit directly... But I have through the homekit integration... My Apple Home is all from Home Assistant...
That being said, I never see the lock appear in the HomeKit side of the house, but it's in HA and works and responds just fine...
Well, decided to add the lock from my iPhone indeaed of HA. I get homekey now but no HA.. its fine, this is fine, everything is fine...
HA supports some homekit locks directly. Which ones is hard to say, as some like to layer additional key material on top of the homekit protocol. They can be supported over Bluetooth and Thread, and I guess over WiFi but we’ve never seen that afaik. The key material is only needed for unlocking (you can still see the lock in Ha and trigger automations with it if you don’t have the key material). The keys come from vendor apps and the process is undocumented - the locks that don’t work now will probably never work.
We don’t support homekey at all, and I think that’s also unlikely to change.
It's a damn shame. It worked great direct to HA. Super fast, super responsive... Just no homekey. :/
But hey, can't have it all. 🙂
The homekit protocol only supports one device at a time, so we’d have to mitm a key exchange process to support it, and it involves 2 different integrations being tightly integrated in ways that would violate HAs coding standards
Hopefully there will be an equivalent feature over matter eventually
Now I'm just trying to figure out how to get the lock to show up in HA from HomeKit... It's the same house in homekit, i just addded it from the phone instead of from HA.
The market is in dire need of a good smart lock, i don't know why it's so hard.
the homekey stuff though, oh it's so good.
at least, it is so far with this lock.
Have you got both homekit integrations configured?
Yeah. HomeKit and Home Bridge, right?
No
oh, maybe not then
Homebridge is a third party thing
i dont, just homebridge it seems. oh, so my house is running on homebridge.
Homekit device and homekit (it is sometimes called homekit bridge)
The 2nd one makes ha export your ha entities iOS
yeah homekit bridge is poppijng all my HA stuff into homekit. this lock is the first thing that I've added from the iOS side. still same homekit home.
HomeKit device is where the lock first appeared, and I set it up there but it was never visible on the Apple side and HomeKey didn't work. But I could do everything from HA.
the only thing i see in homekit device is a bunch of cameras I have, but already have setup through a different route, and my lutron which is also setup through HA natively.
feels funny that the main hub...which should be HA...can't see it
I have an apple tv and an ipad that could be "taking over" hoekit is kind of a mystery to me.
none of it may be working the way i thnk it is
If you connect your lock over Bluetooth to Ha via HomeKit then no, your Apple TV and iPad are not involved
right, which i could definitely tell i did that the first time
It’s probably just that your homekit bridge integration has filters
Mine only exports bulbs for example
i threw a bluetooth proxy in the garage half hoping it would just "figure it out" 🙂
yeah I did check to make sure lock was there for exporting, but i don't have anything else I've added from the Apple side to know if it's a "two-way street"
If you click on configure you should be able to see which entity types are included and excluded and which entities are included and excluded. The stack is weird though. So I have thought I’d enabled stuff in the past but I hadn’t
You shouldn’t need to, but it’d be worth restarting HA after checking that
Oh and locks might need a dedicated bridge I guess
yeah. everything that's currently in homekit is provided by HA with the exception of my Ring Alarm and now the U100 Lock.
not a bad call
Some device types can’t be on a bridge
I forget which. I know tvs are on that list
So you make a 2nd instance of the HomeKit bridge integration and put it in accessory mode
Ah ok. well, it's working in the best place for it now. would be nice to see it in HA but I'll get by... i just want it all! 🙂
I'm trying to use Bluetooth and get following can anyone help? Thx #integrations-archived message
Assuming you do have dbus and bluez installed on the host, then I think your dbus path is wrong.
On some systems it’s under /run and some it’s under /var/run, and theres always a symlink from the wrong one to the right one
It looks like I use /var/run/dbus:/var/run/dbus
If you search /var/run/dbus in this channel you’ll see it comes up every few months. Sometimes it’s more than just that, but it’s usually not.
Looks like you are using docker run directly? (You mentioned -v). Don’t. Use a compose file.
Make sure you’ve also replaced the dbus broker like in the docs and that your bluez is as new as possible (using an old version of Debian on an odd sbc is a surprisingly common problem in here)
And the other common problem - make sure your Bluetooth dongle isn’t using a Realtek chip.
(Won’t cause your current error, I’m preempting the next error)
hi, I'm trying to use the BLE proxy to connected a BLE-YVC01 device. problem the ble proxy seems to be not as stable as I want. I'm using this :
packages: esphome.bluetooth-proxy: github://esphome/firmware/bluetooth-proxy/esp32-generic.yaml@main
Is there other way to create the BLE proxy with more stable connection to device ?
Hi Jc2k, thx for advice. I'm new to all this. which docs are you referring to? also in the pi gui i used the BT icon to connect my mouse since my mouse is bt .so is that relevant? I did confirm that your path to dbus is where mine is too. the command that I used to run is: docker run -d --name homeassistant --privileged --restart=unless-stopped -e TZ=Canada/Eastern -v /home/pi/hass:/config --network=host ghcr.io/home-assistant/home-assistant:stable ....should I update the yaml.configuration file and if so how? thx again
I can’t help you with docker compose, maybe ask in #installation-archived
But as a rule you shouldn’t be using docker run to run important things
You might be better off with HAOS as a lot of the hard stuff is taken care of for you
The built in raspberry pi Bluetooth is a bit problematic. IoT can be more demanding than a mouse.
We see a lot of users in here crashing their Bluetooth chip
And because it’s not connected by usb you have to cut the power to bring it back online
Yikes!! I don't want to run HAOS since I already have other things I use the PI for.
https://www.home-assistant.io/integrations/bluetooth/ has the stuff on dbus brokers and bluez versions. But it’s fairly invasive if you are new to this stuff
are you running in HAOS or docker container?
(In terms of future proofing it’s the same with matter and thread btw - that stuff requires kernel patches and meddling with your sysctl settings. So again, strongly recommend haos there)
Neither
And I spend a lot of time compiling kernels and debugging weird shit because of it
I have the same excuse as you (don’t want to dedicate a machine) but I really wish I could just run haos 🤪
I actually don’t run a bluez based Bluetooth dongle anymore though
I have 4 or 5 esphome Bluetooth gateways scattered round the house
Has anyone had issues in locating the Bluetooth ID for a Samsung device before? I'm trying to setup the bluetooth-based presence dashboard control with the ESP32-WROOM devices but I keep getting a random collection of Mac's all labelled Samsung and none match the MAC in the phone information!
I looked for Mac Address randomization as well but could not find anything on it for Bluetooth!
Most smartphones uses BLE Privacy features which includes MAC address randomisation
Too easy to track you wherever you go otherwise
If you are using built in homeassistant and esphome features like Bluetooth proxies you probably want the iBeacon app integration
Private_ble_device would be better, but we don’t have a way to get the IRK for Android yet.
https://github.com/agittins/bermuda might also be helpful, but the built in stuff is fine for eg turning lights on when you come home, arming and disarming the alarm etc.
Hello Everyone
I'm trying to set up Bluetooth on a docker installation without any luck.
I added dbus to the container volumes but I get an error in the Bluetooth integration. Can anyone help me with this?
volumes:
- type: bind
source: /run/dbus
target: /run/dbus:ro
I get this error in HomeAssistant:
hci1 (DC:A6:32:7D:98:43): hci1 (DC:A6:32:7D:98:43): DBus service not found; docker config may be missing -v /run/dbus:/run/dbus:ro: {ex}
Hello, I am trying to set up a bluetooth speaker on my home assistant, and I am using guides online. bluetoothctl wont discover my speaker, but my PC and phone can. What could be causing that? Thank you!
using HAOS
I had a dozen or so of the Xiaomi hygrometers and flashed them all to allow BLE. I installed the passive BLE monitor from HACS and it all seemed to work. I placed them around my house but realized that HA couldn't read the more remote ones and eventually were "kicked off" for being inactive too long. I then set up a Bluetooth Proxy with ESPHome and all of a sudden these flashed devices are showing up in my Xiaomi BLE integration.
So now of the 12 devices (all flashed at the same time with the same custom firmware), 9 of them show up in the Passive BLE Monitor and 3 of them (in range of the proxy) show up in the Xiaomi BLE integration. I have no idea why they are behaving differently and also not really sure which of the two is better
Passive BLE Monitor opens up your usb/internal bluetooth dongle directly in sniffing mode, it predates and does not use any of the core bluetooth code in HA. this means it is unable to use esphome proxies.
its maintainer actually maintains the Xiaomi BLE integration too.
because it bypasses BlueZ, passive ble monitor can be better if you have a really crap bluetooth dongle. but in every other way, the integration that is baked in to HA is seen as the future
your problems could indicate that the 2 integrations are fighting over your main bluetooth (in which case removing the custom integration and maybe restarting the entire machine to be sure) should fix it.
or your dongle is incompatible with bluez or unstable under bluez (realtek are especially prone to sucking at IoT on linux)
removing the custom integration and then getting more esphomes is probably the best outcome
Thanks for the background information, that's very interesting
I think I'm actually using a native bluetooth radio and no dongle in this setup. So maybe I don't need the passive BLE integration at all anymore...
I keep getting spammed with this in my terminal even though I disabled bluetooth both in the VMware, and in windows:
Any suggestions? (Feel free to @ me)
So a bit more context - some native radio's are connected by UART/serial, and that means we can't reset them from HA if they get stuck. We see a lot of problematic Pi's in here for this reason. the USB ones we can (unless they are especially crap)
The linux kernel will only have an hci0 to be spammy about if its found a bluetooth radio connected to your system. So my hunch would be VMWare is to blame here, and its passing bluetooth through even though you've tried to turn it off. there isn't really anything we can do on the HA side if thats the case.
Assuming you rebooted the VM after turning bluetooth off, and vmware hasn't turned it back on, then you are probably going to have to ask somewhere more vmware-y
Thanks!
Hello ! can someone help me setup my docker so I can access my RPI3B bluetooth please ? It seems I have a DBus error and even with the services working, I can't get it to work
please ?
Hey, I can't seem to get my Bluetooth to initialize.
Anyone seem to know the issue?
We’d need to see a screenshot of the error or logs to be able to help, plus more information on your setup. Haos? What Bluetooth dongle? Any proxies?
But if it’s HAOS, it probably means your Bluetooth doesn’t work under Linux (either at all or not very well). But without more information that’s a guess.
It's Home Assistant Container with access to my built in wireless card.
And you’ve followed the instructions about giving the container access to bluez/dbus on the host system?
And replaced the dbus broker?
Yes, it has access to both Bluetooth and USB.
Let me SSH real quick into the system.
Did you bind mount /run/dbus or /var/run/dbus
Ok right as I logged in, I get thrown a
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)
Then this
I used the default for installing.
Make sure you read the help for the Bluetooth integration
Any trick to getting Home Assitant to update a sensor status based on the BLE location using ESPresense? I've confirmed that the ESPresence sees the device but it's not updating the sensor. Automation to do so isn't even firing :/
Sorry can only help you with the Bluetooth that’s built into HA
https://github.com/agittins/bermuda might work for you?
Bonus, those esp32s are normal ha Bluetooth proxies with that setup so you can pick up sensors with them
so the sensors are in place and when i walk around with my phone and tablet, i see each one picking my phone up as I enter the room. Confident in their calibration/configuration there.
But the actual device tracker bit - it's not picking it up. So it's more of an automation issue i'd think then a bluetooth/espresence issue. Perhaps I'm wrong but i've been knocking my head against this problem for so long lol
Unfortunately espresence doesn’t use the Bluetooth subsystem in HA so not much we can do
I think the data comes in via #mqtt?
Dunno what the best channel for that is
ya it does come in via mqtt
I'm using /var/run/dbus as my BT.
Is there a way to manually set my Session Address?
Why do you want to do that?
It says it's undefined.
And I still haven’t seen the actual error you have
I can't send images.
Ok, after grabbing the tooltip from the Failed Setup, I see
hci0 (MAC): hci0 (MAC): Failed to start Bluetooth: passive scanning on Linux requires BlueZ >= 5.55 with --experimental enabled and Linux kernel >= 5.10; Try power cycling the Bluetooth hardware.
And you’ve turned off passive scanning now? (It’s a setting on the Bluetooth integration, think there’s a dialog box pops up when you click configure?)
It won't setup at all.
I don't have the ability to configure it.
It defaults to active so if there’s no option you can configure it shouldn’t be passive related.
Right back to my initial list of questions.
What Bluetooth dongle?
I'm using the built in wireless chip.
2017 HP Stream
MediaTek is what I saw.
Oh geez
Well they aren’t on our list of tested devices and I know that they are horrific at working with upstream for their socs so I’m not hopeful for you
So I should buy a USB one?
Or get some esp32s
I've been considering ESP32 for creating my custom alarm system.
Maybe add a Bluetooth node inside the keypad design.
If you want something with a good antennae, a case, and POE the gl.inet one is a good option. Needs a header soldering to flash it with ESPHome but sounds like that would be no bother for you.
I'll have to see if my father is still good at soldering.
I'm yet to train on that.
(Using Ethernet means more airtime for Bluetooth - the esp uses one radio for both wifi and Bluetooth, so Ethernet means it doesn’t have to share with WiFi)
Yeah, I'm trying to get a good PoE system because hardwired connection is more reliable.
Helps a little that I'm also adding in PoE cameras.
Hi everyone I'm uping my request from yesterday, can someone help please?
Have you read the docs for the Bluetooth integration? So you’ve bind mounted the dbus path from your host into the container? You’ve replaced the dbus broker? And you’ve met all the requirements for bluez and kernel versions?
And you know that the internal radios on the pi have poor range and if the chips crash there is nothing HA can do - you need to do a power cycle
(If you tick all the above, then we need the exact error to be able to help)
I've forwarded the dbus, yes but I've not seen the part where I should replace that
I didn't know about the pi's radios, I'm gonna look into it thanks, do you have the links ?
Hello, I would like your help to know how I can get the info of this product: https://amzn.eu/d/9SxZv7x, It’s ble and I don’t have thread and I don’t know if I ll start a thread mesh (I already got a full zigbee home).
hi! that definitely works with HA via the HomeKit Device integration (prviously known as homekit_controller)
you need a bluetooth usb dongle or if its more than a few metres away you'll need a esphome bluetooth proxy
my NAS is located at 5m from the device and a door between.
I got a esp32 not too far but I m not sure if the bluetooth proxy firmware is installed. I don’t know how to find it without manipulating it, it’s a handmade produt I bought.
its unlikely it does then, its something that you have to explicitly enable in your esphome config
Do you know a bluetooth antenna with a big range ?
im having an issue discovering devices using bluetooth proxy
the ikea desk is in bluetooth mode, and i setup a fresh esp32 as a bluettoth proxy
but i cant seem to connect / see it
any help would be really appreciated
What integration do you think can control the ikea desk?
Ikea idasen is a direct integration, from what I can tell
So https://www.home-assistant.io/integrations/idasen_desk? Thats a new one for me!
So if you get a diagnostic download for the proxy in Ha it should contain a list of all the MAC addresses the proxy can see
We need to check if your desk is in there, if it’s not then there’s a problem with either the proxy, the desk, or they are too far apart.
If it is there, then it’s more likely a problem with the integration. Maybe your specific desk has different firmware or something.
The desk mac I'd does show up in the bluetooth proxy list
But won't pop up in HA as a device to add in
I've tried everything I could think of (restarting HA, adding a new esphome proxy, turning off and on the desk), but to no avail
Is there anyway I can furthwr disagnose this issue at my end ?
I'm not sure where to start on this
Any guidance would be highly appreciated
Hey folks, I have small problem. I have a Victron Smart Solar Controller which is smack bang in the middle of Australia, It looks after solar/battery etc for a Starlink connection. Problem is, when the installer was there, he put the wrong settings into the charge controller.. Now I have an ESP32 WROOM sitting beside it listening to the BLE broadcast and reporting back to HA ... But I'm trying to find a way to connect to the Victron bluetooth with the app on my phone where I am, about 1500km away... Is there a way I can use a couple of ESP32s I think the one there is an S3, as a bridge?
i have been looking for ages now can can't find anything simple that lets me use my Raspberry pis built in bt to detect if my watch or an airtag is in the same room as it. i tried the ibeacon plugin but that never worked
there isn't anything simple
the airtag is using the find my network, which uses random BLE addresses and public key encryption so that only your apple devices can see where it has been
your watch, if you are using airtag's i guess its an apple watch. again, random BLE addresses. one half is entirely random, the other half is what you get if you encrypt the first half with a private key. it's a pain to get that key most of the time. if you have a macbook you might be able to dump the key for it. if you can, https://www.home-assistant.io/integrations/private_ble_device will work
Wow yeah that's a right pain probably will just sell them at thsi point
Oh forgot to mention my watch is a samsung watch 4
Moving away from apple so airtags are pretty useless and thought i could get some use out of them with ha
Don’t know how to get the irk for any android products so that’s also a right pain.
IBeacon is probably the right direction but you need an additional app on the target device to be constantly running in the background so not something that’s very nice..
Ah oof that will probably drain the battery I guess I may as well just buy one of those cheap ones of aliexpress
Thank you for your help
Does anyone know where I can override the default aioshelly BLE script 2.0 HA installs on shelly plugs with a custom one?
Hello :) i seam to have missed something when creating a bluetooth proxy using esphome and a esp32.
The device listed in the esphome integration, but not in the blutooth one, and since i disabled the hardware bluetooth of the ha box, i nolonger get any update.
Is there something i missed ?
device information does show bluetooth-proxy by esphome, but only have a firmware and safe boot entity
This all sounds as expected
The Bluetooth “integration” just provides support for usb/internal Bluetooth radios. Under the hood it plugs into the same shared code as esphome. I wouldn’t expect to see anything under the Bluetooth integration.
If you have something that is well supported like a Xiaomi or inkbird sensor for example, it would pop up as a discovery under its own integration.
With its own branding (logo)
There are some integrations (like for tracking phones) that require a bit more setup, it depends what you are trying to do.
But generally each type of device has its own integration, in addition to any esphome or Bluetooth integrations
sadly i already have all my integration and device set up, nothing new.
What is the event i should listen to in order to see if the device pic up anything ?
maybe i have a bad bluetooth thingy on the device 🤔
Depends on the integrations you have set up, my inkbirds send a lot of data so it would be obvious if things weren’t working
Same for my plant sensors
i mostly have xiaomy temp sensor, so they should have updated
Right so that integration doesn’t persist over a restart
So restart ha and see if you get data still
Or if they stay unavailable
i've turned back on the on device bluetooth right now to bring back the data, but yea i can do this :)
You can also look at MAC addresses in the ESPHome diagnostic data to see what it can see
do you have a doc or link about this ?
No diagnostic data is something devs use to understand bugs, there’s no docs on what it means for the users because it’s so advanced and also so variable between releases
But you can see MAC addresses if it’s working
Some of the default Xiaomi broadcasts are fairly slow. I think the temp sensors I have only update every 20 minutes
So sometimes you just need to wait
I can’t wait so I flashed mine with alternative firmware 😅
sorry, my work laptop jus failed on me
i had the opposite issue, 3 to 4 broadcast per 5s, battery drained super fast, i still haven't had time to look for other firmware ...
Do I have to do anything for ESP32 BT Proxy to act like a mesh, or do I just enable proxy on the devices I want, and it will handle which one to pick it up?
HA uses the proxy nearest to your Bluetooth device automatically out of the box
I hope this is the right section to ask, but is there a way to add and control mohuanled Bluetooth rgb led lights to home assistant?
Can anyone give me a hint why HA would fail to pick up my switchbot door sensors? Is there some undocumented trick to get them to show up? I've got all the temperature sensors showing up but not the door contacts.
Hey folks!
I've been going down the rabbit hole of Bluetooth sniffing and learning a bit about it. I've successfully managed to take some cheap devices I had and make them do things by pushing data with an app. How cool!
The big challenge though is the LCI OneControl system I have in my RV. It would be the Holy Grail for my HA install there. That controls lights, water pump, water heater, monitors tanks, you name it. It works via Bluetooth and uses a crummy unreliable app with 1 star. There IS some work done by others to integrate LCI OneControl using Node Red via the optional "connect anywhere" package, which connects the CANBUS system to a network, but my RV is not equipped with that and the hardware is several hundred dollars. (I'd just as soon rip it all out and switch to an ESP32 powered relay board if that were the case.)
I'm able to see, using the various apps, that there is BLE traffic coming from the LCI OneControl system. However, I'm unable to 'connect' or send any data. There's also a connect/pairing button on the control panel itself.
Can someone point me in the direct direction? Is this a security feature that is going to make spoofing the commands in Home Assistant not possible? Could it be possibly using Bluetooth Classic as well as BLE and; if so, wouldn't that mean I'm just out of luck? (I understand that it's not practical to do the same sort of sniffing and spoofing that's possible with BLE, using inexpensive commodity hardware, correct?)
Thanks in advance!
As an add to the above; Home Assistants "BLE Monitor" integration detects the LCI OneControl unit and appends a BLE prefix to the MAC address, which I believe indicates it agrees that it is sending at least some BLE traffic. I'm showing my ignorance here in not knowing what the 'connect' button does (other than how it interacts with the app; being necessary to pair the unit once in the app) or how that affects or hinders my efforts to have OneControl control that system.
Hi John - if you haven't already, step number one would be to get set up with a nrf ble sniffer (https://www.nordicsemi.com/Products/Development-hardware/nRF52840-Dongle), and get that working with wireshark. Then you can do a trace of the app talking to the system.
There are a few different ways that a vendor might choose to secure the connection between the app and the system (if at all), and sniffing the conversation should reveal what the next steps are.
I did exactly this to integrate my pool system controller into HA.
Hi #bluetooth-archived - I'm looking for a steer in the right direction.
I'm trying to work out how best to structure a new BLE custom integration (https://community.home-assistant.io/t/custom-component-nissan-leaf-via-lelink-2-elm327-ble/561961).
In particular, I am grappling with how to properly manage sparse availability of the remote BLE device.
The scenario:
- The remote BLE device is a car that is only occasionally available (when powered on, and in the driveway).
- There is no data in the GATT advertisements - it is necessary to connect and request stuff.
- When the BLE device is in range, I want the component to poll for updates.
- When the BLE device is out of range, I want the component to chill out and wait for the next chance to connect.
Given that there is no data in the advertisements, does that mean I should use a DataUpdateCoordinator, and manage all the connection logic and polling in there?
Does anyone know of an existing integration that more-or-less solves the same problem that I can leverage?
Yep; that’s exactly what I’ve done. But the apps I’ve used to attempt to send commands based on sniffed data aren’t able to connect or write data. And I’m not sure how to proceed regarding the security, how to identify it, and whether it’s possible to defeat it.
I'm curious on what Bluetooth devices do you add to HA? I am also curious if you still have to use app to connect to devices or can it be done with HA itself?
Anything that uses Bluetooth and has a compatible integration in home assistant will work. I have some Bluetooth temp sensors in my install, for example. The machine running home assistant needs to support Bluetooth Low Energy. If it doesn’t, using a dongle or an ESP32 works.
No; you don’t need to use the app anymore. In fact that’s the whole reason I setup HA in my RV. I had 9 different apps for various systems / monitoring / etc. Other than a couple of stragglers I’m still trying to integrate; everything is in HA now instead of having to find their specific app.
Perfect! I think im beginning to understand.
About ESP32 BT Proxies. I have 4 of them and two of them switch between the unavailable and unknown several times per day.
The other two show no activity at all. Does that mean two are working properly and the other two aren't?
Hey all, is there some way to run a scaled-down version of ha on a device to extend bluetooth range?
As far as I can tell, there is no such thing as a standalone bluetooth range extender.
Your best bet is going to be an amazing esphome Bluetooth proxy
Does that only work with other esphome devices or with any device using bluetooth?
Should work with any bt device if I remember correctly
Well, I was going to look into ESPhome anyways. One more reason to do it now.
Thanks for the hint.
It lets HA see broadcasted “advertisement” data and start BLE GATT connections from where the proxy is. It cant do audio for example.
It’s not an extender or repeater as such, so you don’t need a Bluetooth dongle for HA.
And some people get caught out by this: ESPhome can directly talk to some Bluetooth devices by itself. You don’t need that. If there is an integration in HA for a device, do not try to configure it directly in your ESPhome config.
My problem is range, the bluetooth range on the Pi5 sucks and due to dire warnings by the community I've refrained from running it on Wifi.
so it has to be placed where ethernet is, which is at the edges of the house.
Yeah, esphome can help with that. It’s just important to know that it’s not extending the range of your existing Bluetooth. It’s like having an entirely different Bluetooth dongle that’s connected over WiFi, not usb etc.
Some people miss the distinction and then worry that their normal Bluetooth dongle is unstable, when you don’t need one to begin with
Good point well made. So long as it gets status updates from my outlying sensors into ha, I won't dabble in how it does it.
(frankly, bluetooth waws once intended for printers and headphones and stuff. What we do with it today is pure adulteration. It was never intended as a network replacement)
Obviously technically the dire warnings apply to anything on WiFi. WiFi Bluetooth proxies are less good than Ethernet ones. So the community would ideally have you run Ethernet round your house and replaster.
Esp only had one radio so we switch between wifi and Bluetooth quickly
Works fine in general for me it’s just theoretically not as good as it could be
I should mention I live in Europe, in a real brick-and-mortar house, not a cardboard one with hollow walls. And if I took everything that isn't ideal in this house and changed it, I might as well tear it down and rebuild it. Elsewhere.
Same
How do you feel about remote home assistant from hacs?
I try to avoid custom components, they are less reviewed and make monthly upgrades less safe.
If I had a remote home assistant I’d connect to it over HomeKit because it’s built in
(Bridge on one side, controller on the other)
That sounds like it might miss a bluetooth packet if it happens at teh wrong time.
Luckily most things broadcast repeatedly because that happens all the time anyway
But it is the reason that Ethernet proxies are better
Like I saying practice it’s fine
Possibly. But are they far from your WiFi router? ESP32’s aren’t great at WiFi range, especially when they’re simultaneously using Bluetooth.
If your WiFi router supports mesh networking, consider adding a mesh device between the router and where your ESP32’s are.
It’s POSSIBLE they aren’t working. Check the logs. It’s also very possible they’re just dropping off the network.
If running Ethernet is an option, you can consider an Ethernet ESP32 device instead of WiFi.
Anyone know of a Bluetooth Hub that is also a speaker that can control locks and other devices that work with bluetooth, and can connect to HA and be used as a speaker for HA?
I know there is some that also has zigbee, but I want one that has a HA compatible speaker. 🤔
I don’t think such a thing exists. At least not unless you restrict “locks and other devices” to a single company
The problem is there isn’t really a shared standard for Bluetooth IoT. So any such hub would be limited to a vendors own products or something like HomeKit. And the only Bluetooth range extender I know for f for HomeKit is eve extend which is obsolete and doesn’t have a speaker.
Matter nearly fixed this but i don’t think they are going ahead with matter over Bluetooth now
If you restrict it to a single company the Xiaomi or tuya or someone might have had a hub but I’ve not seen one with a speaker
But it isn’t the native Bluetooth that works with HA
I'm using Google Wifi which is a mesh and I have 5 of them around my 1 floor 1600 sq ft house. So I shouldn't have any weak spots anywhere inside my home.
As for checking the logs. I'm a non technical user and have no idea what I'm looking at. I did do it anyways and yep, I don't know what any of that means lol.
At the very least I know some of them are working because all my Switchbot Bluetooth devices are being controlled with short wait times.
I was just curious if something was wrong with some of them since I'm seeing different things in the logbook.
If you see a bluetooth proxy go unavailable that means its lost the TCP connection between the ESP and HA. So common causes are either bad esphome configuration or bad wifi
if you are using your own own yaml, and not one of the "ready made projects", its critical you use esp-idf and not arduino mode. arduino mode can be crashy for bluetooth because of the memory resources it uses on the ESP chip.
its also important not to mess with the scan interval and window parameters
also some particular ESP's are just bad at wifi
i have some that no longer work with Unifi hotspots at all
All 4 of mine are "ready made projects". And though 2 of them often go unavailable, they change to unknown immediately afterwards.
are all 4 the exact same board?
and have you tried swapping them? does a "bad" one become a "good" one if swapped with a "good" one and vice versa?
Yeah I bought it from the same place on Amazon. But no I haven't tried swapping them. But I'll test that later.
Then what’s this..?
https://a.co/d/01tIJBhV
A Bluetooth and zigbee hub that only works with one vendors (tuya) products and doesn’t have a speaker.
@wooden vigil I converted your message into a file since it's above 15 lines :+1:
I have above message error when trying to integrate my led ble
Device name is MELK-OA10 99 (4499) - a ledbar from China
Hey all, I've got some trouble getting esphome bluetooth proxy to work.
Here's my config:
@lean crag I converted your message into a file since it's above 15 lines :+1:
It does show up as esphome device, but it doesn't show up as bluetooth proxy.
The only way I ever managed to get one to show up as bluetooth proxy was to flash it directly via the esphome website
What am I doing wrong here?
What are you looking for to know it’s a Bluetooth proxy?
@fringe field I did get it working in the end, but I still find it very strange. Given that I have managed (don't ask me how) to get two of them working and adopted, their respective yaml in esphome looks EXTREMELY different
Here's the other one:
@lean crag I converted your message into a file since it's above 15 lines :+1:
What is the recommended ESP32 board for use as a Bluetooth HomeKit proxy?
Just needs to sit behind a shelf next to a Level Bolt
Would be cool if there was some really slim smart plug or something that could be repurposed easily, so that it doesn't have to be hanging of a USB brick
but having a hard time finding ones that are esp32 as opposed to 8266
Hi! I have a ble temp & humidity sensor, it's tuya. I have bought a bluetooth usb adapter for the HA host pc. Tried to add it manually, but got an unkown error. Is it even possible?
If you don’t mind soldering, https://blakadder.com/gl-s10/
edit: found the integration, but it didn't find it automagically
by "it" i mean the sensor
new issue, it found some things, but after trying to set them up i get "Device is not registered in Tuya cloud"
Doesn’t have?
Is there one that does have a speaker..?
Hey all, I'm using esphome bluetooth proxies to connect some xiaomi ble sensors. These sensors periodically seem to go offline. The bt proxies show online in the web ui, but when I power cycle them, the sensors come back. The logs of the bt proxies look normal to my layman eyes, no warnings, no errors. Is there anything I can do to debug this issue?
btw, I've got one in the situation right now, so if there's anything I can do...
Shelly plugs should work too.
They are only partial proxies. Don’t support outbound GATT which would be needed for a lock.
Hrm, haven't tried that. But I thought they had an active mode too
They weren’t sure it was even possible when we first talked about what we could do with esphome, it wasn’t there in the initial Bluetooth release and the docs say
Shelly generation 2 and 3 devices not battery-powered can act as a Bluetooth proxy for advertisements. Active or passive listening can be enabled in the options flow.
You probably are thinking of active listening, which is where your Shelly broadcasts a beacon asking all nearby devices to broadcast beacons.
Hello everyone. I have a BLE enabled home inverter UPS, which communicates data to the android app and shares info like AC status, battery %ge, current load, voltage, past 7 day stats etc. How to extract these stats using a raspberry pi zero 2w by polling every x seconds and feed it into home assistant using MQTT?
The android app is proprietary and non-open-source. I decoded the apk using IntelliJ Idea to check the source code, but couldn't make any sense out of it, since I don't have any dev knowledge on Android development. I checked with the support team and the app developer team, whether they have exposed any API to access it, to which they denied.
I captured the BLE packets from my phone and opened the dump in Wireshark, I can see the packets being sent/received to/from the device, but don't know which attribute is doing what. I am completely clueless here, if anyone has expertise on this, please help. I'd really appreciate it.
OK, I need some help from the bluetooth gurus:
I'm trying to use an ActiveBluetoothDataUpdateCoordinator. I'm using it because I want to actively connect to the device as soon as the advertisement is discovered (the device is often out of range). This all works fine, except that the advertisement data never changes (there's no useful data in the advertisement data), so only get one single call to _needs_poll, and therefore the poll_method.
Once discovered, I want to poll at regular intervals. I tried multiple inheriting ActiveBluetoothDataUpdateCoordinator and DataUpdateCoordinator, but chaos ensued.
What's the right way to do this?
Don’t use the active coordinator at all
It’s meant for when most of the data is coming from the advertisement and polls are rare and short.
I think the dev docs have a guide for how to choose an approach
Off the top of my head airthings is similar to what you want
Indeed - this is how I first implemented it. The problem I'm trying to solve is two things:
- The device is often out of range (it's a car), so if using a DataUpdateCoordinator, I get rude messages on the log every poll. Maybe I handle this more gracefully? Not sure.
- When the device comes into range again I only have a short window of opportunity to connect and fetch data before the device turns off. With a DataUpdateCoordinator, I needed a short polling interval to be sure to get in on this window.
The ActiveBluetoothDataUpdateCoordinator seemed promising, since I get a callback when there is an advertisement, so no need to poll like crazy, just sit and wait for a callback.
Thanks for your help, I keep trying the DataUpdateCoordinator route...
Newer revisions using the IP101PHY chip have issues with severe packet loss and will likely not be reliable enough for your use.
This stopped me, i don't want to gamble getting a working unit :(
That’s out of date
what do you mean ?
the hardware got replaced again ? or the firmware fixed issue ?
Firmware fix
oh, well that's the best solution, because i didn't want to risk falling on the one bad hardware in between to ...
i should look at it again then
Thanks for the info :)
afternoon guys... I built a BT proxy some while ago... just because I had the parts... and placed it in another room as far from the HA box as possible in my home.. its working fine... it just got an update.. but it just occured to me I never even really tested it... its just sitting there... I've looked at its logs.. but theres nothing there... is there a way to see for example what BT devices its picking up? or any other indication of it working?
You can see the Bluetooth addresses it can see in its diagnostic download
ok.. got it.. thanks.
I can grep that but its not really that helpful... but then again not really sure what I was wanting - I suppose theres not much else for it to do... at least I know its doing its job.
What are the differences between ESPHome Bluetooth proxies and Bluetooth adapters ?
That’s a hard one to answer without knowing more about what you want to do. In terms of the Bluetooth stuff that HA can do by itself, there isn’t really one. A good ESPhome with Ethernet is better performing than a good Bluetooth dongle.
Proxies can’t do audio or serial ports
But there’s no HA integrations built in for that
You can use both at the same time in HA and Ha will pick the best one for the device you are trying to control
I used to do that but now I’ve got 4 proxies
I learned that you can commission matter devices with bluetooth adapter instead of using a smartphone. Can you do that with Bluetooth Proxy ?
No. Bluetooth proxies are used by HA integrations.
That new feature is part of an addon, not HA itself, so it can’t use proxies.
I’m not sure if matter and HA can use the same dongle at the same time - pretty sure it used to cause major problems and was why they removed the feature in the first place
I'm a big stupid idiot and bought three switchbot blinds and the gateway thinking if they work with google home, they're got to work with my setup, but now I can't seem to find a way to get them connected. it's asking me for a google home matter gateway to add them to google home, am I screwed? I thought switchbot had great compatibility
I have HA running in a docker container, and I don't have bluetooth working on it
I have a zigbee coordinator, SLZB-06, and it has a matter-over-thread setting but it's asking me to reflash it FROM zigbee, which I still need/use
I used the API key to add switchbot cloud, but it just shows no devices
shit, this might work: https://smlight.tech/manual/slzb-06/guide/thread-matter/thread-slzb-06m.html
Just get yourself a Bluetooth adapter and pass it to your container.
I have 4 of the blind tilts hooked up the exact same way with no issues.
Hi, I'm using eshome as bluetooth presence sensor. It can detect my tracker, but not my phone. I checked the mac addess on my phone 10 times, it's correct. i'm still "Away" 😭
I have no idea why.
i'm getting desesperated.
It should take 5 minutes. 5 hours later investigating google. Nothing.
What phone?
Android phone
I saw a video where the guy install a special firmware which seems to be connected to MQTT.
may be it's the way to go ....
I'm currently using arduino and esp-idf on 2 esp32 in //
my tracker is detected on both, but not my android...
Android has no native BLE support
You can use the #android-archived app instead for home/away - https://blog.ceard.tech/2023/01/wifi-sensor-to-device-tracker
we are sending ppl to the moon, we will soon travel in space, we have quantic simulations, .... but no BLE on android.
tha'ts realy disapointing me... 😦
well then... i'll stop losing my time on it! Thanks a lot for this quick and short answer Tinkerer !!!!! 🙂
I just set up an ESPHome Bluetooth proxy... super super cool. However, I still have some Bluetooth devices near the proxy disconnecting from time to time. It could be the devices themselves misbehaving, but... what's the best way to check if it's using the proxy?
Do I need to re-pair the device now that the proxy exists? The docs don't really elaborate.
No you don’t, in general at least. Can’t give you definitive answers without knowing the device!
You can see the proxy can see the device by looking in the diagnostic download for the esphome node
I’d start off by enabling the signal strength sensor if it’s available. We’ve seen some combinations of radios not be great together - needing to be less than 1m apart. Signal strength should help rule that out.
We’ve seen atmospheric conditions and time of day seemingly have a meaningful impact on that strength so we want to collect a few days worth.
Hi ! i'm trying to use the govee ble integration (i have the govee smart buttons) but it always shows "No devices found on the network". I have setup home assistant on my raspberry pi 4b in a docker compose environment, my bluetooth module is enabled and working
Which Govee ble integration? The https://www.home-assistant.io/integrations/govee_ble/ only work with Thermometer.
nah the lastest update added support for buttons
Look like it will be supported , but it has not made it in HA yet, it will be in the releases if it's supported https://www.home-assistant.io/blog/2024/07/03/release-20247/#202473---july-19
2024.8.0. Next month
bruh i spend the day trying to make ssomething non existant work lol
Thanks! Just now getting to this, busy day for me. The device is an Ember Mug.
Is there a way I can generate that without having to hook it back up to my main PC? I've only grabbed logs via the ESPHome to MicroUSB before
I'm leaning toward it being the device going into some sort of sleep mode, because it consistently goes unavailable then comes back, but I don't know for sure. It's went unavailable and came back to being fine > 100 times just today.
The diagnostic download is something you get from HA, not esphome. It’s an option under the integration config screens. Lots of integrations have them.
I assume this means it can see it?
{
"name": "Ember Ceramic Mug",
"address": "FD:8D:B7:0A:4D:78",
"rssi": -64,
"advertisement_data": [
"Ember Ceramic Mug",
{
"961": {
"__type": "<class 'bytes'>",
"repr": "b'\\xc9'"
}
},
Yo guys, I just ionstalled a shelly 2pm and enabled its bt repeater within its software and within HA. When i place my BLE device near it though it does not work. Is there any way to check if the repeater is actually working?
Just impulsively (read: mistakenly) bought a bunch of Switchbot devices with no hub & realized I don't even have bluetooth on my HP Elitedesk 600 to passthrough to the HA VM.
Is there any buying advice for a USB-BT adapter vs a ESP32 proxy?
Vm passthrough of Bluetooth is famously bad. It’s one of the most common problems we see in here.
On that alone I’d go for a proxy
Would need to know more to help. Shelly only works with a subset of devices for example.
Hey folks, I'm having trouble getting ESPresence set-up and working and was hoping one of you might be able to point me in the right direction
New user, new install, bluetooth frame reassembly error
Ok, the device I am trying to use is a moisture ground probe called SGS01. It is correctly read by the main bt when i place it near the pi where HA is installed. Not working when in range of the shelly but out of range from the pi
What integration is that?
I did not know shelly repeater was picky with devices, i replaced the normal 2 with pm just for the bt extension feature. Anyway the device was added to Smart life and is added in HA with Tuya BLE integration. Considering the device is correctly working when in Pi range anyway I would exclude an integration problem
Not at all
If it’s a custom integration there are a myriad of ways they could have f***d up
Can you point me to the component you are using? The ha_tuya_ble component I can find hasn’t seen any love in over a year
However if it is that one, it looks like it relies on making an active connection to the device
That is not compatible with Shelly
Shelly only forwards advertisement data, which is enough for eg the xiaomi plant sensor or lots of temperature, humidity, motion etc sensors from govee, inkbird, xiaomi, etc.
Only ESPHome proxies can forward GATT connections
The way it works is through tuya credentials
HE gets the credentials from the account and allows for the connection to the device
To avoid the encryption on the device...juts like temperatur reades from xiaomi
Xiaomi puts the data in the advertisement data, we never connect to it over GATT (we can poll the plant sensor battery, but that won’t break everything if it doesn’t work)
I used this fork https://github.com/markusg1234/ha_tuya_ble
Cause the original is not working... too ild like u mentioned
So without digging too deep I can see it uses async_ble_device_from_address to ask for a connectable address
That will never work with Shelly
You need ESPhome based proxies
ok
You have been super helpful
I have one ESPhome repeater laying around
I will try it later when i go home
The only problem it is on the outside.. I will need to find a proper casing to allow enviromental damage
If Shelly have a physically appropriate product you might be able to run esphome on it