Using new bluetooth integration with laptop internal bluetooth antenna

Hello everyone,

I am trying to make the Bluetooth integration work on my Home Assistant Container. I have docker installed on an old Samsung Chronos Series 7 laptop and it has a bluetooth module of course.

One thing that is not clear from the official bluetooth integration page is whether or not this integration works with internal antennas.

I have a bluetooth temperature sensor that is really close to the laptop so an externa antenna would not be necessary in terms of range.

Citing the docs:

Some systems may not come with Bluetooth and require a USB adapter. Installing an adapter for the first time may require multiple restarts for the device to be fully recognized.

This sentence kind of says that if you already have bluetooth you are ready to use the integration. Is that correct?

The answer is yes, you can this as Reddit user explained to me.

Sharing my experience here just to help others.

I think I am having issues with mounting the dbus folder. I’ve tried both with /run/dbus:/run/dbus:ro and /var/run/dbus:/run/dbus:ro with no luck whatsoever.

What I get is this error in HA:

ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/bluetooth_adapters/__init__.py", line 82, in _get_dbus_managed_objects
reply = await bus.call(msg)
File "/usr/local/lib/python3.10/site-packages/dbus_fast/aio/message_bus.py", line 337, in call
await future
File "/usr/local/lib/python3.10/site-packages/dbus_fast/aio/message_bus.py", line 404, in _message_reader
if self._unmarshaller.unmarshall():
File "/usr/local/lib/python3.10/site-packages/dbus_fast/_private/unmarshaller.py", line 332, in unmarshall
self._read_header()
File "/usr/local/lib/python3.10/site-packages/dbus_fast/_private/unmarshaller.py", line 271, in _read_header
self.read_to_offset(HEADER_SIGNATURE_SIZE)
File "/usr/local/lib/python3.10/site-packages/dbus_fast/_private/unmarshaller.py", line 174, in read_to_offset
raise EOFError()
EOFError

Am I doing something wrong?

UPDATE: Well, I found out. After seeing this thread and particularly this comment I’ve managed to get Bluetooth integration working using the privileged flag workaround in my docker-compose. Be aware that the privileged flag is not recommended and I was just testing out the integration.

The issue is now that I am trying to connect a SensorBlue WS08 using the Thermobeacon integration but it looks like my laptop built-in BT adapter does not support BLE.

In fact, if I run $ hciconfig hci0 lestates I get Read LE supported states on hci0 returned status 1 which means that BLE is not supported as explained here, so I cannot connect to the device.

It looks like I’ll need an adapter!

1 Like

Just to clarify, your OS is Ubuntu?

Yes, exactly. Ubuntu 22.04 LTS

yea… setting privileged mode is not great… it basically gives your container root access and is bad from a security and isolation(the point of containers) perspective.

I was running ubuntu 22.04 LTS earlier this year and had to use privileged mode in order to get bluetooth to work. then I actually read the docs and they said to use dbus-broker. then that worked great without having to use privileged mode!

but i just upgraded to ubuntu 23.10 and now i’m seeing your error above.

i’m still using the ASUS USB-BT500, which is in the supported list
systemd is still running dbus-broker.
i’ve got bluez lib installed for sure
the dbus socket looks good and is mapped into the container just fine

so i don’t know what’s wrong :frowning: