Bluetooth issue - Please help!

I am running Hass.io in a VM on Proxmox on a NUC, but are having problems getting device tracking by Bluetooth working.

This error shows up in my log:

2019-02-24 15:14:54 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform bluetooth_tracker

Traceback (most recent call last):

File “/usr/local/lib/python3.7/site-packages/homeassistant/components/device_tracker/init.py”, line 184, in async_setup_platform
disc_info)

File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)

File “/usr/local/lib/python3.7/site-packages/homeassistant/components/device_tracker/bluetooth_tracker.py”, line 81, in setup_scanner
for dev in discover_devices():

File “/usr/local/lib/python3.7/site-packages/homeassistant/components/device_tracker/bluetooth_tracker.py”, line 59, in discover_devices
lookup_class=False, device_id=device_id)

File “/usr/local/lib/python3.7/site-packages/bluetooth/bluez.py”, line 26, in discover_devices
device_id = _bt.hci_get_route()

OSError: [Errno 97] Address family not supported by protocol

Any idea what to do?

I’m having exact same problem :confused:

Same issue here. I connected the internal bluetooth of the NUC as an USB port to the VM (running Hassos), but it looks like this is currently not supported yet.

I had the same problem. It was caused by the hci0 interface being down inside the container.
This is what I did to fix it. It seems permanent.

user@ubuntu:~# sudo docker exec -it homeassistant /bin/bash                                   
    bash-4.4# hciconfig -a
    hci0:   Type: Primary  Bus: USB
        BD Address: DA:DA:DA:DA:DA:DA  ACL MTU: 310:10  SCO MTU: 64:8
        DOWN
        RX bytes:574 acl:0 sco:0 events:30 errors:0
        TX bytes:368 acl:0 sco:0 commands:30 errors:0
        Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF PARK 
        Link mode: SLAVE ACCEPT 
    bash-4.4# hciconfig hci0 version
    Can't read version info hci0: Network is down (100)
    bash-4.4# hciconfig hci0 up
    bash-4.4# hciconfig hci0 version
    hci0:   Type: Primary  Bus: USB
        BD Address: DA:DA:DA:DA:DA:DA  ACL MTU: 310:10  SCO MTU: 64:8
        HCI Version: 4.0 (0x6)  Revision: 0x22bb
        LMP Version: 4.0 (0x6)  Subversion: 0x22bb
        Manufacturer: Cambridge Silicon Radio (10)
    bash-4.4# exit

Then I restarted hass and now it seems to work. Well, no errors are being throwed at me while restarting hass.
Hope this helps you guys out.

Replying to myself…
This doesn’t help as the card stays down during boot and when hass starts.
But I can confirm my card itself seems to work:

bash-4.4# hciconfig hci0 up
bash-4.4# hcitool scan
Scanning ...
        BA:BA:BA:BA:BA:BA       My_phone
bash-4.4# 

Documentation states that we should enable AutoEnable in /etc/bluetooth/main.conf by changing false to true and of course remove the # in front of it. But I cannot get that to work.
More info at archlinux wiki

Thanks for update, I’m unsure if it should be reported somewhere as a problem, especially with more and more switching to NUCs… :blush: I really miss the BT/BLE on my setup now with the bt not working on my nuc in proxmox…

I am in the same boat with not being able to get Bluetooth working in a hass.io Proxmox VM.
I think you are right that more people are switching to NUC machines and Proxmox so it would be good if HA could support these in the future.

I just cannot find presence detection that is as reliable as BT so really missing this now. What have you been using for presence detection now you cannot use BT?

Anyone care to look into supporting?

Thanks

I ended up setting up the Bluetooth presence monitor that was mentioned on these forums and it’s been rock solid. I have it running under another VM that i already had on my proxmox setup.

1 Like

Same problem here with a NUC

Hi, could you explain how did you do ?

My internal Intel Bluetooth shows up as a USB device so I passed that on to an existing VM running. After that I installed monitor with these instructions:

https://www.google.com/url?sa=t&source=web&rct=j&url=https://github.com/andrewjfreyer/monitor&ved=2ahUKEwj_uu-Wv77jAhVXbc0KHZHoDxoQFjAAegQIARAB&usg=AOvVaw3m5qOv9yijqVHBTHKaeW65

and played around with it until I was comfortable. After I got the gist of it I installed it on a pi zero w and set both to scan for arrival and departure only on specific triggers and publish mqtt messages for each device home or not_home