Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

One option is to use PowerShell to just call a WebHook, but I wanted better integration and was planning on adding ZWave + Zigbee so I wanted to get USB PT working.

I switched over to VMWare Workstation as Hyper-V has no USB Passthrough and USBIP wouldn't load for me w/ azure kernel and I didn't want to rebuild kernel.

Interestingly, I was able to just "use bluetooth" without doing anything! (I love VMWare). Both my host and guest are able to see BT devices without having to disable one.

Getting BT to work in HA/Docker was another story, and I'm not 100% sure what I did, here are my notes, I'll refine next time I have to re-setup my container and can test, but I'm done testing for now!

Sources:

https://github.com/home-assistant/core/issues/17118
https://www.home-assistant.io/docs/installation/docker/
https://www.reddit.com/r/homeassistant/comments/ay4nvc/home_assistant_bluetooth_le_tracker_logging_no/
https://www.reddit.com/r/homeassistant/comments/c7v0d8/can_i_manually_add_ble_devices_to_known/
https://www.home-assistant.io/integrations/bluetooth_tracker/
https://www.home-assistant.io/integrations/bluetooth_le_tracker/

Added to Docker-Compose:

    volumes:
      - type: bind
        source: /dev/bus/usb
        target: /dev/bus/usb
      - type: bind
        source: /var/run/dbus
        target: /var/run/dbus
    privileged: true

Installed via apt:

apt install bluez bluetooth libbluetooth-dev

Testing:

Note: CLI into your HA installation and run the following

hcitool lescan #can you scan for LE?
hcitool scan # Regular BT should work, does you LE device show? Mine did, so forget LE

Note: If I paired device, it always showed as there?, so never pair device, or completely remove if you do

configuration.yaml:

device_tracker:
  - platform: bluetooth_tracker
# - platform: bluetooth_le_tracker
#    track_battery: true
#    track_battery_interval: 1
    interval_seconds: 12
    new_device_defaults:
      track_new_devices: true

what got added to known_devices:

myble:
  name: myble
  mac: BT_AA:BB:CC:DD...
# mac: BLE_AA:BB:CC:DD...
  icon:
  picture:
  track: true

HA is not for the faint of heart! After all that, I figured adding to my automation would be easy! Well, I was using "away" but the state should be "not_home" to "home".

platform: state
entity_id: device_tracker.myble
from: not_home
to: home
  • No labels