Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth LE Tracker Issues #160

Open
brianjking opened this issue Nov 22, 2018 · 2 comments
Open

Bluetooth LE Tracker Issues #160

brianjking opened this issue Nov 22, 2018 · 2 comments

Comments

@brianjking
Copy link
Owner

2018-11-22 17:21:31 INFO (Thread-6) [pygatt.backends.gatttool.gatttool] Starting BLE scan
2018-11-22 17:21:31 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform bluetooth_le_tracker
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/__init__.py", line 184, in async_setup_platform
    disc_info)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/bluetooth_le_tracker.py", line 114, in setup_scanner
    update_ble(dt_util.utcnow())
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/bluetooth_le_tracker.py", line 96, in update_ble
    devs = discover_ble_devices()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/bluetooth_le_tracker.py", line 58, in discover_ble_devices
    devs = adapter.scan()
  File "/srv/homeassistant/lib/python3.5/site-packages/pygatt/backends/gatttool/gatttool.py", line 312, in scan
    scan = pexpect.spawn(cmd)
NameError: name 'pexpect' is not defined

https://github.com/brianjking/homeassistant-config/blob/master/configuration.yaml#L237-L239

  - platform: bluetooth_le_tracker
    device_id: hci0
    track_new_devices: True

https://www.home-assistant.io/components/device_tracker.bluetooth_le_tracker/

@hitokiri8x
Copy link

Also encountered the same "bug".
For reference I'am on RPi2 with external usb bt adapter BTW the fix is simple:

pip3 install pexpect

in your venv/containter/whatever runs homeassistant

@brianjking
Copy link
Owner Author

@hitokiri8x Thanks, I'm currently trying to sort out using Tile Trackers without the Tile app instead as it resolves the need to have Bluetooth turned on our phones for presence detection.

See here and #163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants