I only want to run BLE, and entirely disable classic Bluetooth in my system, Bluez offers a way to do this via config option ControllerMode. If Bluez Controllermode is set to (B)LE only via (/etc/bluetooth/main.com: ControllerMode = le, default to ‘dual’ LE & classic+EDR mode), HA Bluetooth integration no longer appears to fully work (unfortunately Ruuvi tags are the only BLE devices I have around, so cannot tell how this affects other BT devices).
Steps to reproduce:
- run HA + BT integration + ruuvi tags → HA is able to read && display Ruuvi tags data.
- add line: ‘ControllerMode = le’ to /etc/bluetooth/main.conf
- restart bluetooth / HA (reboot to be sure)
- HA can no longer read ruuvi tags
(- changing back to ControllerMode = dual && rebooting makes everything work again)
Ruuvitags do not require classic BT and reading them ‘manually’ works fine with ControllerMode = le:
# cat /etc/bluetooth/main.conf | grep ControllerMode
#ControllerMode = dual
ControllerMode = le
# btmgmt --index hci0 power off && ./bluewalker -device hci0 -ruuvi
hci0 Set Powered complete, settings: le secure-conn
Ruuvi device e4:86:8c:2c:12:35,random (static), Data format:v5 (RSSI -56 dBm)
Humidity: 64.62% Temperature: 21.75C Pressure: 97872Pa Battery voltage: 2974mV
Acceleration X: 0.02G, Y: -0.02G, Z: 0.99G
TxPower: 4 dBm, Moves: 99, Seqno: 10376
Information on test system:
HA version home assistant 2024.6.1 / 20240605.0
(Docker):
docker run --cap-add=NET_RAW --cap-add=NET_ADMIN --name=homeassistant -e TZ="$__TIMEZONE" -v /opt/homeassistant/config:/config -v /run/dbus:/run/dbus:ro --network=host --privileged --restart=unless-stopped -d ${__docker_image}
Underlying OS: Linux arch-v 6.9.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 31 May 2024 15:14:45 +0000 x86_64 GNU/Linux
Bluez Version && Bluetooth hardware:
# bluetoothctl --version
bluetoothctl: 5.76
...
Bluetooth:
Device-1: Realtek Bluetooth Radio driver: btusb type: USB
Report: btmgmt ID: hci0 state: up address: C8:8A:D8:C1:55:FE bt-v: 4.2
Runnin on Intel x64 N100 miniPC. I mean this could be a Docker issue, or Bluez issue or someother-issue. But it would be nice if someone could confirm if this reproduces elsewhere.
PS. I should note that in my setup HA stops (also, and independent from issue above) receiving Ruuvi tag data IF default Bluetooth integration is configured to ‘Passive Scanning’ while using Bluez default dual stack. Again - as shown above (see bluewalker output) there is no need to actively scan to receive data from Ruuvi tags. Reproduction steps here are the same except instead of changing bluez config, use HA GUI to navigate to Bluetooth integration, click configure, enable ‘Passive scanning’.
PPS. My apologies if I posted to a wrong forum etc. Newbie here.