home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.08k stars 29.73k forks source link

Bluetooth tracker LE setting up error #16698

Closed Molodax closed 2 years ago

Molodax commented 5 years ago

Home Assistant release with the issue:

0.78.0

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

hassio (HassOS 1.10) rpi 3

Component/platform:

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

Description of problem: Error in setting up the platform.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

device_tracker:
  - platform: bluetooth_le_tracker

Traceback (if applicable):

2018-09-18 19:57:05 WARNING (SyncWorker_13) [homeassistant.components.device_tracker.bluetooth_le_tracker] No Bluetooth LE devices to track!
2018-09-18 19:57:05 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform bluetooth_le_tracker

Additional information: Nothing more in log. I also have Mi Flora Plant component that works with Bluetooth LE.

TEDSv commented 5 years ago

Thanks! It`s working now:

ofalvai commented 5 years ago

This seems to be fixed in 0.92. I removed track_new_devices from my config, and everything is working correctly.

squwal33 commented 5 years ago

Hi,

I didn't succeed to set the @scottyphillips solution. I have a configuration error when I follow the steps. I also try by adding to the component a init.py and a manifest.json but with no success.

Can someone share his working configuration with this workaround ?

Thx by advance

ofalvai commented 5 years ago

Have you tried using the original component after upgrading to the latest version? For me it's working perfectly since 0.92, and my config is simply this:

- platform: bluetooth_le_tracker
    interval_seconds: 60
squwal33 commented 5 years ago

@ofalvai do you have miflora sensor plateform too ?

ofalvai commented 5 years ago

Nope. I'm not sure these two modules can use Bluetooth at the same time.

squwal33 commented 5 years ago

I think it can. platform: mitemp_bt + platform: miflora is working together. But not platform: miflora + platform: bluetooth_le_tracker That's the point of this issue.

I succeed to have the 3 working together for about 6 hours with someone custom ble_tracker component.

SeLLeRoNe commented 5 years ago

I was having this issue too, and I did notice now that> track_new_devices: false cause the issue, while if I set track_new_devices: true

It is working fine.

Harshajv commented 4 years ago

The problem still persists even with 0.99.3 Works for couple of hours and then there are no updates.

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

d0ugal commented 4 years ago

I believe this problem still persists in 0.103

stemelkov commented 4 years ago

I confirm - this is still an issue in 0.103.4.

rbosneag commented 4 years ago

same in 0.103.5

duncan-valleix commented 4 years ago

bonjour toujours present dans 0.105.2

martykiico commented 4 years ago

Error during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: I/O error

in Home Assistant 0.106.5

volkotyk commented 4 years ago

HASS 0.107.4 Logger: homeassistant.components.bluetooth_le_tracker.device_tracker Source: components/bluetooth_le_tracker/device_tracker.py:119 Integration: bluetooth_le_tracker (documentation, issues) First occurred: 10:44:42 PM (27 occurrences) Last logged: 10:54:27 PM

Error during Bluetooth LE scan: Unexpected error when scanning: LE Scan

Aroxyson commented 4 years ago

Same problem on Hass.io 0.107.7. I dont have Miflora. I tried many diffirent variants of device_tracker config but this is what i see everytime.

2020-04-01 23:06:20 WARNING (SyncWorker_18) [homeassistant.components.bluetooth_le_tracker.device_tracker] No Bluetooth LE devices to track!
2020-04-01 23:06:21 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy
northpower25 commented 4 years ago

I have the same result with the custom component LE_Track and with the original HA bluetooth_le_tracker Integration

Environment: HA Version 0.107.1 fresh UBUNTU 19 Installation with HAMA Bluetooth USB Stick and G-TAG and TILE BLE Tags

LE_Track: LOG RESULT: DEBUG (SyncWorker_4) [custom_components.ble_track.device_tracker] Adding BLE_7C:2F:80:C7:F7:0A to BLE tracker ... ERROR (SyncWorker_4) [custom_components.ble_track.device_tracker] BLEError during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: I/O error

CONFIG: - platform: ble_track interval_seconds: 12 track_new_devices: True

bluetooth_le_tracker: LOG RESULT: No errors but it see that after a while the Discovering sops with last log line DEBUG (SyncWorker_19) [homeassistant.components.bluetooth_le_tracker.device_tracker] Discovering Bluetooth LE devices

CONFIG: - platform: bluetooth_le_tracker track_new_devices: True interval_seconds: 12

curiouse is that the known_device.yaml in both cases are not created, but if i create this file by my self with the datas from an G-TAG and a Tile Device in the second case with bluetooth_le_tracker hi shown in the frontend at first with the state "home and then with "not home" but with the command "hcitool -i hci0 lescan" i see that the devices are shown the entire time.

kitkat270 commented 4 years ago

Same error

HASS: 0.107.7

Environment

arch | armv7l
dev | false
docker | true
hassio | true
os_name | Linux
os_version | 4.19.106-v7
python_version | 3.7.7
timezone | Europe/London
version | 0.107.7
virtualenv | false

Config

device_tracker:
  - platform: bluetooth_le_tracker
    track_new_devices: true

sensor:
  - platform: miflora
    mac: '80:EA:CA:89:15:7C'
    force_update: true

Log

2020-04-17 21:45:09 DEBUG (SyncWorker_7) [homeassistant.components.bluetooth_le_tracker.device_tracker] Discovering Bluetooth LE devices
2020-04-17 21:45:09 INFO (SyncWorker_7) [pygatt.backends.gatttool.gatttool] Starting BLE scan
2020-04-17 21:45:09 ERROR (SyncWorker_7) [pygatt.backends.gatttool.gatttool] Unexpected error when scanning: Set scan parameters failed: I/O error

2020-04-17 21:45:09 ERROR (SyncWorker_7) [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: I/O error
2020-04-18 07:54:53 DEBUG (SyncWorker_6) [homeassistant.components.bluetooth_le_tracker.device_tracker] Discovering Bluetooth LE devices
2020-04-18 07:54:53 INFO (SyncWorker_6) [pygatt.backends.gatttool.gatttool] Starting BLE scan
2020-04-18 07:55:03 INFO (SyncWorker_6) [pygatt.backends.gatttool.gatttool] Found 9 BLE devices

then, with nothing changing...

2020-04-18 07:55:26 DEBUG (SyncWorker_14) [homeassistant.components.bluetooth_le_tracker.device_tracker] Discovering Bluetooth LE devices
2020-04-18 07:55:26 INFO (SyncWorker_14) [pygatt.backends.gatttool.gatttool] Starting BLE scan
2020-04-18 07:55:36 INFO (SyncWorker_14) [pygatt.backends.gatttool.gatttool] Found 0 BLE devices
2020-04-18 07:55:36 DEBUG (SyncWorker_14) [homeassistant.components.bluetooth_le_tracker.device_tracker] Bluetooth LE devices discovered = {}

Occasionally both BLE tracker and MiFlora work OK, tile BLE tracker randomly reports home & away when devices are close by for a long period. Sometimes MiFlora BLE (hardware version 3.2.2) works ok and gets readings, but then fails for extended periods without anything changing.

kitkat270 commented 4 years ago

My main install is on a RPI3B, but to try fix this, I put a fresh install onto a new RPI4 with a bare bones BLE tracker and Miflora config, nothing else at all...

device_tracker:
  - platform: bluetooth_le_tracker
    track_new_devices: true

sensor:
  - platform: miflora
    mac: '80:EA:CA:89:15:7C'
    force_update: true

After 24hours its been rock solid. On the RPI4, my tiles have shown at home for the entire period, which they have, but on the RPI3, they've flipped between away and home many many times and there are big gaps in the miflora data too.

So I'm going to give it another day or so and then switch over my main config to the RPI4 and see if it's still good.

The only other differences are:

RPI4 environment:

-- | --
rch | armv7l
dev | false
docker | true
hassio | true
os_name | Linux
os_version | 4.19.114-v7l
python_version | 3.7.7
timezone | Europe/London
version | 0.108.6
virtualenv | false
imist commented 4 years ago

I've had problems with Bluetooth (Mi Flora and Xiaomi BLE temp sensor) since v0.9x something. It seems they finally fixed this on the RPi3 in HassOS 3.13 that just came out. You might want tio try that. It certainly solved my problems at least...

https://github.com/home-assistant/operating-system/releases

kitkat270 commented 4 years ago

Oh, wow, good shout, didn't spot that. Just upgraded now, I'll see how it goes.

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

plinss commented 4 years ago

I still see errors when enabling the bluetooth_le_tracker:

2020-07-19 11:29:49 ERROR (SyncWorker_2) [pygatt.backends.gatttool.gatttool] Unexpected error when scanning: Set scan parameters failed: Operation not permitted

2020-07-19 11:29:49 ERROR (SyncWorker_2) [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: Operation not permitted

I'm running 0.112.4 on a Debian Buster system

The-Fons commented 4 years ago

Me too, Home Assistant 0.113.0, hassio install on rpi3 `2020-07-24 18:54:33 ERROR (SyncWorker_0) [pygatt.backends.gatttool.gatttool] Unexpected error when scanning: Set scan parameters failed: I/O error

2020-07-24 18:54:33 ERROR (SyncWorker_0) [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: I/O error device_tracker:

florianec commented 4 years ago

I have the same experience, using miflora together with bluetooth_le_tracker causes scan errors after some time. Home Assistant 0.113.1 image install on RPi4.

But lately sometimes there are no errors in the logs, bluetooth just stops discovering and all device are shown not_home.

sensor:

device_tracker:

PolestarWx commented 4 years ago

I have the same experience, using miflora together with bluetooth_le_tracker causes scan errors after some time. Home Assistant 0.113.1 image install on RPi4.

But lately sometimes there are no errors in the logs, bluetooth just stops discovering and all device are shown not_home.

sensor:

  • platform: miflora mac: '11:11:11:11:11:11' name: Flower force_update: true monitored_conditions:

    • battery
    • moisture
    • light
    • temperature
    • conductivity

device_tracker:

  • platform: bluetooth_le_tracker track_new_devices: False interval_seconds: 30 consider_home: 600`

Same problem for me

xvolte commented 4 years ago

Me too, Home Assistant 0.113.0, hassio install on rpi3 `2020-07-24 18:54:33 ERROR (SyncWorker_0) [pygatt.backends.gatttool.gatttool] Unexpected error when scanning: Set scan parameters failed: I/O error

2020-07-24 18:54:33 ERROR (SyncWorker_0) [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: I/O error device_tracker:

  • platform: bluetooth_le_tracker track_new_devices: true track_battery: true interval_seconds: 300 `

Hi, how do you get that far.

i'm stuck in the logs, home assistant saying :

FileNotFoundError: [Errno 2] No such file or directory: 'sudo'

i'm using hass.io on rpi 3b+ and i don't understand how, from docker containers to leave access to bluetooth device, even when reading this doc: https://www.home-assistant.io/integrations/bluetooth_le_tracker/#rootless-setup

Logger: homeassistant
Source: components/bluetooth_le_tracker/device_tracker.py:189
First occurred: 0:47:02 (1 occurrences)
Last logged: 0:47:02

Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 172, in update_ble
    adapter.start(reset_on_start=True)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 264, in start
    self.reset()
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 631, in reset
    subprocess.Popen(["sudo", "systemctl", "restart", "bluetooth"]).wait()
  File "/usr/local/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sudo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 189, in update_ble
    adapter.stop()
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 308, in stop
    self.disconnect(self._connected_device)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 50, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 486, in disconnect
    if not self._receiver.is_set("disconnected"):
AttributeError: 'NoneType' object has no attribute 'is_set'
DiggiD commented 3 years ago

bump

ditto last post

bence-sebok commented 3 years ago

Me too, Home Assistant 0.113.0, hassio install on rpi3 2020-07-24 18:54:33 ERROR (SyncWorker_0) [pygatt.backends.gatttool.gatttool] Unexpected error when scanning: Set scan parameters failed: I/O error 2020-07-24 18:54:33 ERROR (SyncWorker_0) [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: I/O error `device_tracker:

  • platform: bluetooth_le_tracker track_new_devices: true track_battery: true interval_seconds: 300 `

Hi, how do you get that far.

i'm stuck in the logs, home assistant saying :

FileNotFoundError: [Errno 2] No such file or directory: 'sudo'

i'm using hass.io on rpi 3b+ and i don't understand how, from docker containers to leave access to bluetooth device, even when reading this doc: https://www.home-assistant.io/integrations/bluetooth_le_tracker/#rootless-setup

Logger: homeassistant
Source: components/bluetooth_le_tracker/device_tracker.py:189
First occurred: 0:47:02 (1 occurrences)
Last logged: 0:47:02

Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 172, in update_ble
    adapter.start(reset_on_start=True)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 264, in start
    self.reset()
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 631, in reset
    subprocess.Popen(["sudo", "systemctl", "restart", "bluetooth"]).wait()
  File "/usr/local/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sudo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 189, in update_ble
    adapter.stop()
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 308, in stop
    self.disconnect(self._connected_device)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 50, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 486, in disconnect
    if not self._receiver.is_set("disconnected"):
AttributeError: 'NoneType' object has no attribute 'is_set'

I have the same setup and the same error. Did you solve the problem @xvolte ?

cvroque commented 3 years ago

I have the exact same issue and log errors, using HA 2020.12 and Debian supported instalation.

I've followed the steps for rootless setup, left the config to track new devices to true but no dice:


Logger: homeassistant.components.device_tracker
Source: components/bluetooth_le_tracker/device_tracker.py:189
Integration: Device Tracker (documentation, issues)
First occurred: 14:28:13 (1 occurrences)
Last logged: 14:28:13

Error setting up platform legacy
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 172, in update_ble
    adapter.start(reset_on_start=True)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 264, in start
    self.reset()
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 631, in reset
    subprocess.Popen(["sudo", "systemctl", "restart", "bluetooth"]).wait()
  File "/usr/local/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sudo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 239, in async_setup_legacy
    setup = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 200, in setup_scanner
    update_ble(dt_util.utcnow())
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 189, in update_ble
    adapter.stop()
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 308, in stop
    self.disconnect(self._connected_device)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 50, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 486, in disconnect
    if not self._receiver.is_set("disconnected"):
AttributeError: 'NoneType' object has no attribute 'is_set'
jcgoette commented 3 years ago

Adding to this. Additional info, works fine in development (hass -c config from venv) but below error when testing in live environment:

Error while setting up cool_new_integration platform for light Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/cool_new_integration/light.py", line 35, in setup_platform light_array.append(cool_new_integration(addr)) File "/config/custom_components/cool_new_integration/light.py", line 45, in init self._light = cool_new_integration(light) File "/usr/local/lib/python3.8/site-packages/cool_new_integration/cool_new_integration.py", line 18, in init self.adapter.start() File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 264, in start self.reset() File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 631, in reset subprocess.Popen(["sudo", "systemctl", "restart", "bluetooth"]).wait() File "/usr/local/lib/python3.8/subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'sudo'

tuxflo commented 3 years ago

I faced the same issue and I saw that the dependency gatttool tries to call the installed application "hcitool". Should this program be available on the host? Because if I login via ssh I can not find the command hcitool. The Arch Linux wiki states that hcitool is deprecated, was this the reason why its not included anymore?

jcgoette commented 3 years ago

I think the issue stems from the use of Alpine in OS and therefore no sudo command. pygatt has precedent for not running as root, so might try and add that. Granted, there hasn't been a merged PR since 2019. :/

kitkat270 commented 3 years ago

Same issue. Worked reliably for months on RPi4 till update to 21.3.3 or thereabouts. Now my tile BLE trackers are changing everyone to 'away' every few minutes.

[pygatt.backends.gatttool.gatttool] Unexpected error when scanning: Set scan parameters failed: I/O error [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: I/O error

nortuzar commented 3 years ago

Also having problems after some update. Running on a virtual machine under windows 10

System Health

version core-2021.3.3
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.7
os_name Linux
os_version 5.4.99
arch x86_64
timezone America/Santiago
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4410 Installed Version | 1.11.3 Stage | running Available Repositories | 840 Installed Repositories | 31
Hass.io host_os | Home Assistant OS 5.12 -- | -- update_channel | stable supervisor_version | supervisor-2021.03.6 docker_version | 19.03.13 disk_total | 30.8 GB disk_used | 11.9 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Samba share (9.3.1), AppDaemon 4 (0.5.0), Node-RED (8.2.0), WireGuard (0.5.0), SSH & Web Terminal (8.0.4), Mosquitto broker (5.1.1), TasmoAdmin (0.14.0), Duck DNS (1.12.5), Check Home Assistant configuration (3.6.0), AdGuard Home (4.0.0), File editor (5.2.0), ESPHome (1.16.2), MariaDB (2.2.2), Valetudo Mapper (1.8.1), Visual Studio Code (3.1.1)
Lovelace dashboards | 1 -- | -- resources | 18 views | 12 mode | storage
Spotify api_endpoint_reachable | ok -- | --
Logger: homeassistant.components.bluetooth_le_tracker.device_tracker
Source: components/bluetooth_le_tracker/device_tracker.py:114
Integration: bluetooth_le_tracker (documentation, issues)
First occurred: 9:34:14 PM (13 occurrences)
Last logged: 9:37:05 PM

Error during Bluetooth LE scan: Unexpected error when scanning: Set scan parameters failed: I/O error
Logger: pygatt.backends.gatttool.gatttool
Source: /usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py:352
First occurred: 9:34:14 PM (13 occurrences)
Last logged: 9:37:05 PM

Unexpected error when scanning: Set scan parameters failed: I/O error
github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Molodax commented 3 years ago

It is interesting that the issue has been for several years now without good resolution. At the moment, it seems that the component doesn't work at all in Home Assistant 2021.6.5

florianec commented 3 years ago

yep, i am using Home Assistant for about three years now. Had RPi 3, 4 and HA Blue with a BT dongle. In none of these configurations the BT LE component worked reliable.

ghost commented 3 years ago

It is interesting that the issue has been for several years now without good resolution. At the moment, it seems that the component doesn't work at all in Home Assistant 2021.6.5

I just started having this issue as of a couple of months ago. Not sure why.

serhat-ozkara commented 3 years ago

This is reallly getting on my nerves... Years and years this bug exists, yet nobody even ANSWERS. BLE Tracker does not work. If it's not to be handled, I thing core dev team just as well remove integration from listings!

TheQue42 commented 3 years ago

I gave up, I am using roomassistant instead. (Although I must say I got issues with BLE there as well, but I think its just PEBCAC)

serhat-ozkara commented 3 years ago

This is a joke which is not even funny... Thank you for your suggestion @TheQue42 I'll give that and https://github.com/davefrooney/custom_components/tree/master/ble_track a try...

d0ugal commented 3 years ago

This is reallly getting on my nerves... Years and years this bug exists, yet nobody even ANSWERS. BLE Tracker does not work. If it's not to be handled, I thing core dev team just as well remove integration from listings!

I believe this bug needs somebody to drive the effort and come up with a solution. You can be the change you want to see ❤️

it seems it is too niche or a low priority for other reasons. Bluetooth is also notoriously hard to work with.

serhat-ozkara commented 3 years ago

Well, If I could come up with a solution then I could've created a PR already :) Even then, If somebody can solve the problem with 137 lines of code, then again I don't think this is that much complicated. Also, there are at least 3 other bug reports out there about the same issue they're all auto-closed by bot... See: https://github.com/davefrooney/custom_components/blob/master/ble_track/device_tracker.py

mcanteri commented 2 years ago

Hi all, I wrote a watchdog daemon for who are running HA as supervised like me. If you are interested to try it is here: https://github.com/mcanteri/home-assistant-bluetooth-LE-watchdog

d0ugal commented 2 years ago

Hi all, I wrote a watchdog daemon for who are running HA as supervised like me. If you are interested to try it is here: https://github.com/mcanteri/home-assistant-bluetooth-LE-watchdog

Wow, this patches the home assistant container. Clever, but scary 😀

ghost commented 2 years ago

Hi all, I wrote a watchdog daemon for who are running HA as supervised like me. If you are interested to try it is here: https://github.com/mcanteri/home-assistant-bluetooth-LE-watchdog

Is this for me if I'm running HAS OS on a pi4, or is this for docker container-esque setups?

mcanteri commented 2 years ago

Hi all, I wrote a watchdog daemon for who are running HA as supervised like me. If you are interested to try it is here: https://github.com/mcanteri/home-assistant-bluetooth-LE-watchdog

Is this for me if I'm running HAS OS on a pi4, or is this for docker container-esque setups?

It's been too long since I was using HASS OS and I don't remember how one could run the script in the container in that environment, but if anyone can comment or suggest, everyone is welcome. For sure the watchdog could work in container too, because I've tried it in my environment, having access to docker and command line. For now is not a solution for your environment.

mcanteri commented 2 years ago

I discovered today that only 531 user installation uses bluetooth LE, indeed we are a niche.