Closed 0Styless closed 4 months ago
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
Your docker compose snippet doesn't seem to match the logs you've provided. Your PUID/PGID isn't being passed through it seems.
Yeah I also noticed that before. Any idea why this is not working as expected?
I fixed the issue with the wrong UID/GID but the bluetooth issue still persist
Are you not the person here saying your issue is fixed? https://discourse.linuxserver.io/t/home-assistant-with-conbee-ii/8625/3
If you look closer, different issue - but yes that's me.
This is the problem I guess:
[ls.io-init] done.
2024-02-18 23:44:05.685 ERROR (MainThread) [homeassistant.setup] Error during setup of component bluetooth
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/homeassistant/setup.py", line 333, in _async_setup_component
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/bluetooth/__init__.py", line 152, in async_setup
await manager.async_setup()
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/bluetooth/manager.py", line 132, in async_setup
await super().async_setup()
File "src/habluetooth/manager.py", line 217, in async_setup
File "/usr/local/lib/python3.12/site-packages/bluetooth_adapters/systems/linux.py", line 36, in refresh
await self._bluez.load()
File "/usr/local/lib/python3.12/site-packages/bluetooth_adapters/dbus.py", line 39, in load
self._packed_managed_objects = await _get_dbus_managed_objects()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bluetooth_adapters/dbus.py", line 103, in _get_dbus_managed_objects
bus = await MessageBus(bus_type=BusType.SYSTEM).connect()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/dbus_fast/aio/message_bus.py", line 225, in connect
await self._authenticate()
File "/usr/local/lib/python3.12/site-packages/dbus_fast/aio/message_bus.py", line 492, in _authenticate
response = self._auth._receive_line(await self._auth_readline())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/dbus_fast/auth.py", line 99, in _receive_line
raise AuthError(f"authentication failed: {response.value}: {args}")
dbus_fast.errors.AuthError: authentication failed: REJECTED: ['EXTERNAL']
Are you using rootless or different ID's compared to your system user ID's? As that's what your error points to, a permissions issue: https://github.com/home-assistant/core/issues/76429
yes I'm using UID 10003
and GID 10003
and according to the linuxserver docs for homeassistant on hub.docker.com this should work with mounted volume /var/run/dbus
and capabilities NET_ADMIN
& NET_RAW
.
I also tried to add the user ID to the systems bluetooth group. The mentioned userns=keep-id also makes no difference.
What are the permissions on /dev/ttyACM0
on the host?
ll /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Feb 19 20:50 /dev/ttyACM0
This one seems to solve the issue: https://community.home-assistant.io/t/bluetooth-in-ubuntu-18-04-docker-container/482363/18
After installing dbus-broker
and reboot the node, now the bluetooth integration seems to work again - maybe this be added to the installatin docs?
Yeah sorry I was to fast with - integration does not longer displays an error but hcitool still doesn't find a device inside the container
It was confirmed here that it works when we added Bluetooth support: https://github.com/linuxserver/docker-homeassistant/issues/86#issuecomment-1862483554
I feel like those ID's are slightly high unless you specifically set the users ID's to that.
Maybe it's a good idea to add it also here: https://hub.docker.com/r/linuxserver/homeassistant
Accessing Bluetooth Device
In order to provide HA with access to the host's Bluetooth device, one needs to install BlueZ on the host, add the capabilities NET_ADMIN and NET_RAW to the container, and map dbus as a volume as shown in the below examples.
Did the solution work for you?
Hey sorry for the delay - yes solution does work now, inside the container I can see all discovered devices.
Maybe it's a good idea to add it also here: https://hub.docker.com/r/linuxserver/homeassistant
The docs for the integration make the host requirements clear: https://www.home-assistant.io/integrations/bluetooth/#requirements-for-linux-systems
@aptalca you're right, honestly I looked first at the instructions from linuxserver/homeassistant
Is there an existing issue for this?
Current Behavior
Bluetooth Device is not found by Home-Assistant. From inside container:
From outside / host:
Expected Behavior
Home-Asssistant detects Bluetooth-Devices.
Steps To Reproduce
Deploy the provided Docker-Compose yaml on a node with built-in Bluetooth-Device or one with a dongle and try to configure / access it with Home-Assistant.
Environment
CPU architecture
arm64
Docker creation