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
72.1k stars 30.18k forks source link

Bluetooth tracker does not work with newer python - Can't run HA Core on python 3.11.2 because of dependency to pybluez==0.22 #89119

Open ferinelo opened 1 year ago

ferinelo commented 1 year ago

The problem

I created new venv with python 3.11.2, installed HA Core 2023.3.1 there and run hass --script check_config I have a bluetooth tracker enabled in my configuration.

HA tries to install pybluez==0.22 and fails with error:

gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -ljemalloc -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./port3 -I/srv/homeassistant_3.11.2/include -I/usr/local/include/python3.11 -c bluez/btmodule.c -o build/temp.linux-armv7l-cpython-311/bluez/btmodule.o
      bluez/btmodule.c: In function ‘PyInit__bluetooth’:
      bluez/btmodule.c:2837:22: error: lvalue required as left operand of assignment
       2837 |  Py_TYPE(&sock_type) = &PyType_Type;
            |                      ^
      bluez/btmodule.c:2838:29: error: lvalue required as left operand of assignment
       2838 |  Py_TYPE(&sdp_session_type) = &PyType_Type;
            |                             ^
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

With python 3.10.9 I had no issue at all (currently running venv). I managed to install pybluez from source/github, however this did not solve the issue. Seems like device_tracker integration requires pybluez==0.22 and forces HA to install this version, which is not compatible with python 3.11. I failed to migrate to venv python 3.11 because of this issue.

What version of Home Assistant Core has the issue?

2023.3.1

What was the last working version of Home Assistant Core?

2023.3.1

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Bluetooth Tracker

Link to integration documentation on our website

https://www.home-assistant.io/integrations/bluetooth_tracker/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -ljemalloc -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./port3 -I/srv/homeassistant_3.11.2/include -I/usr/local/include/python3.11 -c bluez/btmodule.c -o build/temp.linux-armv7l-cpython-311/bluez/btmodule.o
      bluez/btmodule.c: In function ‘PyInit__bluetooth’:
      bluez/btmodule.c:2837:22: error: lvalue required as left operand of assignment
       2837 |  Py_TYPE(&sock_type) = &PyType_Type;
            |                      ^
      bluez/btmodule.c:2838:29: error: lvalue required as left operand of assignment
       2838 |  Py_TYPE(&sdp_session_type) = &PyType_Type;
            |                             ^
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

Additional information

No response

home-assistant[bot] commented 1 year ago

bluetooth_tracker documentation bluetooth_tracker source

alvariyo commented 1 year ago

Hi, I am facing the same issue (pip 23.0.1 from /srv/homeassistant/venv_3.11.2/lib/python3.11/site-packages/pip (python 3.11)) I have tried to install directly in the venv but same error: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pybluez Using cached PyBluez-0.23.tar.gz (97 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] error in PyBluez setup command: use_2to3 is invalid. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

Also is blocking the upgrade :(

bdraco commented 1 year ago

Support for 3.11 added in https://github.com/pybluez/pybluez/commits/master but pybluez hasn't done a release that supports 3.11 yet so this isn't fixable until a new released is available.

bdraco commented 1 year ago

https://github.com/home-assistant/core/issues/94189#issuecomment-1583661844

Nobody has picked up the project at this point ( last release in Dec 2019 https://github.com/pybluez/pybluez/releases/tag/0.23 ) https://github.com/pybluez/pybluez#contributors-wanted

EthanBezz commented 1 year ago

I’ve created a temporary fix for this issue! It can be found here

NOTE: It’s only intended for docker users, as that’s what I use, but maybe it could be adapted to help others.

d03n3rfr1tz3 commented 1 year ago

I’ve created a temporary fix for this issue! It can be found here

NOTE: It’s only intended for docker users, as that’s what I use, but maybe it could be adapted to help others.

well, after fiddling around for a few hours (my first failed attempt was to fake pybluez 0.30 to be 0.22 in the docker container) and just opening a PR in hope it might help someone, I just realized you already had basically the same solution laid out a week ago. 🤦 I'm cringing right now.

thehoff commented 1 year ago

https://github.com/andrewjfreyer/monitor is another way to get this done which I am playing with atm

bentolor commented 1 year ago

Support for [Python] 3.11 added in https://github.com/pybluez/pybluez/commits/master but pybluez hasn't done a release that supports 3.11 yet so this isn't fixable until a new released is available.

The current pybluez release 0.23 is dated Dec 28, 2019. This gives me doubts that waiting for a new upstream release will be fruitful.

PimDoos commented 1 year ago

Since Home Assistant has a dedicated bluetooth integration, which is used by other integrations requiring Bluetooth, wouldn't it make sense to use that instead of pybluez?

andriilahuta commented 1 year ago

It's also possible to use bluetooth integration with D-Bus API instead. Here's a proof of concept if anyone wants to try. custom_bluetooth_tracker.zip

Caveats:

Duke-Box commented 1 year ago

@andriilahuta

how do I try this? Do I just put the folder structure under "custom_components" and restart HA?

I'm running HAOS native on generic PC so I cannot change Bluez run time. However all my device trackers are already discovered in known_devices.

Duke-Box commented 1 year ago

@bentolor

Yes I agree. However it stopped working when HA went to python 3.10.x last year but started working again up until HA 2023.6.0. So someone/something made pybluez work with python 3.10.x without any fanfare or release notes!

andriilahuta commented 1 year ago

@Duke-Box Yes, just treat it as any other custom component.

Unfortunately, I don't think it would work without 'experimental' flag until this api moves out of experimental stage. I've tried implementing this without experimental features, but it wasn't very reliable for me.

Duke-Box commented 1 year ago

Thanks for the quick reply.

I will try it on my test system which is a pi4 running HAOS also. I think both generic X64 and Pi4 both run Bluez and looking at the documentation for bluetooth integration they mention experimental mode. [https://www.home-assistant.io/integrations/bluetooth/#additional-requirements-by-install-method]

I'll update when i get the time to try it out.

bdraco commented 1 year ago

HAOS has the experimental flag turned on by default so it should work for most people.

Ideally the dbus implementation would get moved into a lib and a PR could be opened to replace the pybluez implementation with a dbus based one which should make things work for the foreseeable future.

Joeviocoe commented 1 year ago

It's also possible to use bluetooth integration with D-Bus API instead. Here's a proof of concept if anyone wants to try. custom_bluetooth_tracker.zip

Caveats:

* Discovery is not implemented, so trackable devices should already be present in known_devices.yaml

* Bluez experimental features should be enabled (--experimental flag)

I tried this custom component. It doesn't seem to do anything. I tried with and without this in my configuration.yaml:

device_tracker:
  - platform: custom_bluetooth_tracker

Running sudo systemctl status bluetooth:

● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2023-08-08 16:35:59 MDT; 41min ago
     Docs: man:bluetoothd(8)
 Main PID: 16957 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/bluetooth.service
           └─16957 /usr/lib/bluetooth/bluetoothd --experimental

I didn't know if I should expect an Integration tile to show up.
I have Airthings BLE working just fine. I can run bluetoothctl on the host, and it shows a scan of all found devices, so it appears like nothing is exclusively locking the BT adapter.

Should I be expecting already known devices to update my existing device_tracker entities?
Right now, they don't update and all show an attribute of "source_type: null"

No error messages (other than warning about a custom component being loaded). Home Assistant 2023.8.1 Supervisor 2023.08.1 Docker version 20.10.7, build f0df350

andriilahuta commented 1 year ago

It should behave exactly like the original bluetooth tracker (except for discovery), so it has no UI. For it to work, the bluetooth integration itself should be configured via UI.

Config looks okay, component-specific debug logs would be helpful. FWIW it works fine on my setup (2023.08 / RPi / Microk8s).

Rubquila commented 1 year ago

I upgrade to version 2023.8.1 on RaspberryPi

Home Assistant 2023.8.1 Supervisor 2023.08.1 Operating System 10.4 Frontend 20230802.0 - latest

I have gotten the following error:

Logger: homeassistant.util.package
Source: util/package.py:107
First occurred: 12:59:07 (6 occurrences)
Last logged: 13:24:22
Unable to install package PyBluez==0.22: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-armv7l-cpython-311 creating build/lib.linux-armv7l-cpython-311/bluetooth copying bluetooth/__init__.py -> build/lib.linux-armv7l-cpython-311/bluetooth copying bluetooth/widcomm.py -> build/lib.linux-armv7l-cpython-311/bluetooth copying bluetooth/osx.py -> build/lib.linux-armv7l-cpython-311/bluetooth copying bluetooth/msbt.py -> build/lib.linux-armv7l-cpython-311/bluetooth copying bluetooth/btcommon.py -> build/lib.linux-armv7l-cpython-311/bluetooth copying bluetooth/bluez.py -> build/lib.linux-armv7l-cpython-311/bluetooth copying bluetooth/ble.py -> build/lib.linux-armv7l-cpython-311/bluetooth running build_ext building 'bluetooth._bluetooth' extension creating build/temp.linux-armv7l-cpython-311 creating build/temp.linux-armv7l-cpython-311/bluez gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./port3 -I/usr/local/include/python3.11 -c bluez/btmodule.c -o build/temp.linux-armv7l-cpython-311/bluez/btmodule.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for PyBluez ERROR: Could not build wheels for PyBluez, which is required to install pyproject.toml-based projects [notice] A new release of pip is available: 23.1.2 -> 23.2.1 [notice] To update, run: pip install --upgrade pip

With this I have updated the version of pip through commands in the terminal and now I have this error:

Platform error device_tracker.bluetooth_tracker - Requirements for bluetooth_tracker not found: ['PyBluez==0.22'].

So I try to install pyBluez via console with "pip install pybluez", but i get the following error:

Error in PyBluez setup command: use_2to3 is invalid

So it still doesn't work.

Joeviocoe commented 1 year ago

Trying to get debug logs:

      homeassistant.components.device_tracker: debug
      homeassistant.components.bluetooth_tracker: debug
      homeassistant.components.custom_bluetooth_tracker: debug
      homeassistant.setup: debug
      homeassistant.components.bluetooth: debug
      bleak.backends.bluezdbus: debug

homeassistant.components.device_tracker shows other trackers like network devices and a single mention of setting up the custom_bluetooth_tracker homeassistant.components.bluetooth_tracker shows nothing homeassistant.components.custom_bluetooth_tracker shows nothing

2023-08-09 09:58:52.465 INFO (MainThread) [homeassistant.setup] Setting up device_tracker
2023-08-09 09:58:52.603 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.custom_bluetooth_tracker
2023-08-09 09:58:52.651 INFO (MainThread) [homeassistant.setup] Setup of domain device_tracker took 0.2 seconds

homeassistant.components.bluetooth:

Debug logs for Bluetooth Component 2023-08-09 0**8.101 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration custom_bluetooth_tracker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-08-09 0**0.016 DEBUG (MainThread) [homeassistant.setup] Dependency bluetooth will wait for dependencies ['usb'] 2023-08-09 0**0.161 INFO (MainThread) [homeassistant.setup] Setting up bluetooth 2023-08-09 0**0.238 INFO (MainThread) [homeassistant.setup] Setup of domain bluetooth took 0.1 seconds 2023-08-09 0**0.247 DEBUG (MainThread) [homeassistant.components.bluetooth.scanner] Initializing bluetooth scanner with {'detection_callback': >, 'scanning_mode': 'active', 'adapter': 'hci0'} 2023-08-09 0**0.248 DEBUG (MainThread) [homeassistant.components.bluetooth.scanner] hci0 (5*****D): Starting bluetooth discovery attempt: (1/3) 2023-08-09 0**0.570 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] Registering scanner hci0 (5*****D) 2023-08-09 0**1.400 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 0*****8 AdvertisementData(manufacturer_data={* b'\x01\t \x02\xe0\xda\xd4T\x87\xb2\x14T\xff/\x86\tg\xf4\xb4\xf7p;\xd48M\xd4\xbf'}, rssi=-84) match: set() 2023-08-09 0**1.978 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 6*****A AdvertisementData(local_name='Airthings Wave+', manufacturer_data={82* b'(G\xa6\xaeI\x00'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'b42e1c08-ade7-11e4-89d3-123b93f75cba', 'f000ffc0-0451-4000-b000-000000000000'], rssi=-75) match: set() 2023-08-09 0**8.452 DEBUG (MainThread) [homeassistant.setup] Dependency airthings_ble will wait for dependencies ['bluetooth_adapters'] 2023-08-09 0**8.612 DEBUG (MainThread) [homeassistant.setup] Dependency bluetooth_adapters will wait for after dependencies ['esphome'] 2023-08-09 0**2.603 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.custom_bluetooth_tracker 2023-08-09 0**7.636 INFO (MainThread) [homeassistant.setup] Setting up bluetooth_adapters 2023-08-09 0**7.636 INFO (MainThread) [homeassistant.setup] Setup of domain bluetooth_adapters took 0.0 seconds 2023-08-09 0**8.362 DEBUG (MainThread) [homeassistant.components.bluetooth.wrappers] 6*****A - Airthings Wave+ -> /org/bluez/hci* Connecting (last rssi: -75) 2023-08-09 0**1.152 DEBUG (MainThread) [homeassistant.components.bluetooth.wrappers] 6*****A - Airthings Wave+ -> /org/bluez/hci* Connected (last rssi: -75) 2023-08-09 0**0.571 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.0239976670127362 2023-08-09 0**0.572 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.27197356801480055 2023-08-09 1**0.573 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.11198911600513384 2023-08-09 1**0.574 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.09599067096132785 2023-08-09 1**0.574 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.11598872800823301 2023-08-09 1**0.575 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.003999611013568938 2023-08-09 1**0.575 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.03199689101893455 2023-08-09 1**0.576 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.12398795003537089 2023-08-09 1**4.534 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 2*****9 AdvertisementData(manufacturer_data={* b'\x01\t "\xbe\x89+@\xcd=v\x99\xdb\x07\x0b\xd3\x0b\xf2\xd7\x16j\xe2qf\xc9)c'}, rssi=-94) match: set() 2023-08-09 1**0.576 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.07999222504440695 2023-08-09 1**3.124 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 6*****A AdvertisementData(local_name='Airthings Wave+', manufacturer_data={82* b'(G\xa6\xaeK\x00'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'b42e1c08-ade7-11e4-89d3-123b93f75cba', 'f000ffc0-0451-4000-b000-000000000000'], rssi=-76) match: set() 2023-08-09 1**0.577 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.003999612003099173 2023-08-09 1**1.776 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 6*****A AdvertisementData(local_name='Airthings Wave+', manufacturer_data={82* b'(G\xa6\xaeI\x00'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'b42e1c08-ade7-11e4-89d3-123b93f75cba', 'f000ffc0-0451-4000-b000-000000000000'], rssi=-76) match: set() 2023-08-09 1**4.393 DEBUG (MainThread) [homeassistant.components.bluetooth.wrappers] 6*****A - Airthings Wave+ -> /org/bluez/hci* Connecting (last rssi: -75) 2023-08-09 1**5.605 DEBUG (MainThread) [homeassistant.components.bluetooth.wrappers] 6*****A - Airthings Wave+ -> /org/bluez/hci* Connected (last rssi: -75) 2023-08-09 1**0.577 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.09999028302263469 2023-08-09 1**4.304 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 6*****9 AdvertisementData(manufacturer_data={7* b'\x02\x15\x1c\xa9.#\xf0\x87M\xf7\xb9\xa2\xfdKqjK\xf6\x00\xe5\x00\x00\x03'}, rssi=-91) match: {'ibeacon'} 2023-08-09 1**6.724 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: D*****2 AdvertisementData(service_data={'0000feed-0000-1000-8000-00805f9b34fb': b'\x02\x00\n\xac\x9a\x12\xf8**<'}, service_uuids=['0000feed-0000-1000-8000-00805f9b34fb'], rssi=-76) match: set() 2023-08-09 1**0.577 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.1519852289929986 2023-08-09 1**0.579 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.03999611298786476 2023-08-09 1**0.580 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.03999611298786476 2023-08-09 1**5.042 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 3*****8 AdvertisementData(manufacturer_data={* b'\x01\t \x02+\t\x83.\xaf\x95\x1b:TB\x7f\x0b\xc6#\xf9\xe1\xb0@F\xb7\x8a\xd76'}, rssi=-83) match: set() 2023-08-09 1**4.945 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 4*****6 AdvertisementData(manufacturer_data={7* b'\x10\x068\x1a$\x830\xff'}, tx_power=7, rssi=-90) match: set() 2023-08-09 1**0.580 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.0 2023-08-09 1**0.581 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.03599650098476559 2023-08-09 1**0.582 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.08399183698929846 2023-08-09 1**0.582 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.07599261403083801 2023-08-09 1**0.583 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.09199106000596657 2023-08-09 1**2.159 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 6*****A AdvertisementData(local_name='Airthings Wave+', manufacturer_data={82* b'(G\xa6\xaeK\x00'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'b42e1c08-ade7-11e4-89d3-123b93f75cba', 'f000ffc0-0451-4000-b000-000000000000'], rssi=-76) match: set() 2023-08-09 1**0.583 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.043995724990963936 2023-08-09 1**3.363 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (5*****D) [connectable]: 6*****A AdvertisementData(local_name='Airthings Wave+', manufacturer_data={82* b'(G\xa6\xaeI\x00'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'b42e1c08-ade7-11e4-89d3-123b93f75cba', 'f000ffc0-0451-4000-b000-000000000000'], rssi=-86) match: set() 2023-08-09 1**9.393 DEBUG (MainThread) [homeassistant.components.bluetooth.wrappers] 6*****A - Airthings Wave+ -> /org/bluez/hci* Connecting (last rssi: -75) 2023-08-09 1**0.584 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.9719055430032313 2023-08-09 1**0.684 DEBUG (MainThread) [homeassistant.components.bluetooth.wrappers] 6*****A - Airthings Wave+ -> /org/bluez/hci* Connected (last rssi: -75) 2023-08-09 1**0.584 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.21997862099669874 2023-08-09 1**0.585 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.1719832859816961 2023-08-09 1**0.586 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.13598678295966238 2023-08-09 1**0.587 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.0 2023-08-09 1**0.587 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.1079895049915649 2023-08-09 1**0.587 DEBUG (MainThread) [homeassistant.components.bluetooth.base_scanner] hci0 (5*****D): Scanner watchdog time_since_last_detection: 0.0239976670127362

bleak.backends.bluezdbus: bluez.log

andriilahuta commented 1 year ago

@Joeviocoe could you try this version: custom_bluetooth_tracker.zip

It contains some additional debug statements and should produce at least some debug output. Ideally, the original bluetooth tracker should be disabled in the meantime.

Joeviocoe commented 1 year ago

Tried the new custom component.

I only have the following config:

device_tracker:
  - platform: custom_bluetooth_tracker
    interval_seconds: 30
    new_device_defaults:
      track_new_devices: false

is this what should be disabled? Or are you talking about the Bluetooth Integration with is doing a bunch of scanning? I've tried with and without this config, and with and without the Bluetooth Integration disabled. No change.

/usr/share/hassio/homeassistant/custom_components/custom_bluetooth_tracker$ ls
device_tracker.py  __init__.py  manifest.json  __pycache__

No additional logs seen in home-assistant.log What should a log entry look like? Is it [bleak.backends.bluezdbus] logs? Or should it say [homeassistant.components.custom_bluetooth_tracker]?

Joeviocoe commented 1 year ago

Found it [custom_components.custom_bluetooth_tracker] Had to debug the whole log to find it.

2023-08-09 1**3.887 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration custom_bluetooth_tracker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-08-09 1**7.992 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Setting up custom bluetooth tracker
2023-08-09 1**8.120 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.custom_bluetooth_tracker
2023-08-09 1**8.121 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Setting up the Bluetooth scanner
2023-08-09 1**8.158 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Devices to track: {'A*****2': '', '0*****A': '', '4*****A': '', '5*****F': 'Device2', '2*****C': 'SuT', 'A*****6': 'k', 'F*****0': ' TT-', '0*****D': 'Bose 35', '3*****0': 'InputStick', '6*****C': ''}
2023-08-09 1**8.160 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Performing Bluetooth devices update
2023-08-09 1**8.160 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Found Bluetooth adapters: {'hci0': {'address': '5*****D', 'sw_version': '', 'hw_version': 'usb:v1D6Bp0246d0530', 'passive_scan': False, 'manufacturer': 'Broadcom Corp', 'product': 'BCM20702A0', 'vendor_id': '0a5c', 'product_id': '21e8'}}
2023-08-09 1**1.220 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging A*****2
2023-08-09 1**1.479 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 0*****A
2023-08-09 1**1.636 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 4*****A
2023-08-09 1**2.149 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 5*****F
2023-08-09 1**2.154 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 2*****C
2023-08-09 1**2.157 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging A*****6
2023-08-09 1**2.160 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging F*****0
2023-08-09 1**2.173 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 0*****D
2023-08-09 1**2.188 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 3*****0
2023-08-09 1**2.194 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 6*****C

*Redacted

Important Note: My known devices that were previously tracked by Home Assistant, are regular bluetooth devices (phones and such), not BLE. The bluetoothctl command seems to be seeing only the same 4 BLE devices as [bleak.backends.bluezdbus.manager]. The Bluetooth Integration (logs shown above) seems to detect only the plugged in USB adapter and the Airthings Wave+ which uses BLE I believe. Not sure how this figures into your PoC, if you are tracking non-BLE devices.

andriilahuta commented 1 year ago

Yeah, I've only tried tracking phones with it using built-in RPi adapter, not sure how it works with other configurations (it should though). But it seems that it indeed can't detect/connect to regular bluetooth devices in your case. Here's a version with even more debugging, maybe it will shed some light. custom_bluetooth_tracker.zip

All in all, it should detect bluetooth devices if bluetoothctl can.

Joeviocoe commented 1 year ago

With a Broadcom Bluetooth LE USB dongle: ID_MODEL_FROM_DATABASE: BCM20702A0 Bluetooth 4.0 ID_MODEL_ID: '21e8' ID_REVISION: '0112' ID_SERIAL: Broadcom_Corp_BCM20702A0_5CF3709C83BD ID_SERIAL_SHORT: 5CF3709C83BD ID_USB_INTERFACES: ':ff0101:ffffff:fe0101:' ID_VENDOR: Broadcom_Corp ID_VENDOR_ENC: Broadcom\x20Corp ID_VENDOR_FROM_DATABASE: Broadcom Corp.

2023-08-09 1**0.573 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Performing Bluetooth devices update
2023-08-09 1**0.573 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Found Bluetooth adapters: {'hci0': {'address': '5*****D', 'sw_version': '***', 'hw_version': 'usb:v1D6Bp0246d0530', 'passive_scan': False, 'manufacturer': 'Broadcom Corp', 'product': 'BCM20702A0', 'vendor_id': '0a5c', 'product_id': '21e8'}}
2023-08-09 1**1.684 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging A*****2
2023-08-09 1**1.701 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] ConnectDevice for A*****2, msg type: MessageType.ERROR, body: ['Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn\'t exist\n'], error_name: org.freedesktop.DBus.Error.UnknownMethod
2023-08-09 1**1.701 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Ping result for A****** False
2023-08-09 1**1.991 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 0*****A
2023-08-09 1**1.998 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] ConnectDevice for 0*****A, msg type: MessageType.ERROR, body: ['Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn\'t exist\n'], error_name: org.freedesktop.DBus.Error.UnknownMethod
2023-08-09 1**1.998 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Ping result for 0****** False
2023-08-09 1**2.589 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 4*****A

And I found my older Bluetooth dongle that was not LE capable... ID_MODEL_FROM_DATABASE: Bluetooth Dongle (HCI mode) ID_MODEL_ID: '0001' ID_REVISION: '8891' ID_SERIAL: 0a12_CSR8510_A10 ID_USB_INTERFACES: ':e00101:' ID_VENDOR: 0a12 ID_VENDOR_ENC: 0a12 ID_VENDOR_FROM_DATABASE: Cambridge Silicon Radio, Ltd

2023-08-09 1**9.588 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Performing Bluetooth devices update
2023-08-09 1**9.588 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Found Bluetooth adapters: {'hci1': {'address': '0*****3', 'sw_version': '***', 'hw_version': 'usb:v1D6Bp0246d0530', 'passive_scan': False, 'manufacturer': 'cyber-blue(HK)Ltd', 'product': 'CSR8510 A10', 'vendor_id': '0a12', 'product_id': '0001'}}
2023-08-09 1**9.593 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging A*****2
2023-08-09 1**9.595 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] ConnectDevice for A*****2, msg type: MessageType.ERROR, body: ['Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn\'t exist\n'], error_name: org.freedesktop.DBus.Error.UnknownMethod
2023-08-09 1**9.595 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Ping result for A****** False
2023-08-09 1**9.598 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 0*****A
2023-08-09 1**9.600 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] ConnectDevice for 0*****A, msg type: MessageType.ERROR, body: ['Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn\'t exist\n'], error_name: org.freedesktop.DBus.Error.UnknownMethod
2023-08-09 1**9.600 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Ping result for 0****** False
2023-08-09 1**9.603 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 4*****A
2023-08-09 1**9.605 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] ConnectDevice for 4*****A, msg type: MessageType.ERROR, body: ['Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn\'t exist\n'], error_name: org.freedesktop.DBus.Error.UnknownMethod
2023-08-09 1**9.605 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Ping result for 4****** False
2023-08-09 1**9.607 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 5*****F
2023-08-09 1**9.610 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] ConnectDevice for 5*****F, msg type: MessageType.ERROR, body: ['Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn\'t exist\n'], error_name: org.freedesktop.DBus.Error.UnknownMethod
2023-08-09 1**9.610 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Ping result for 5****** False
2023-08-09 1**9.612 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] Pinging 2*****C
2023-08-09 1**9.616 DEBUG (MainThread) [custom_components.custom_bluetooth_tracker.device_tracker] ConnectDevice for 2*****C, msg type: MessageType.ERROR, body: ['Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn\'t exist\n'], error_name: org.freedesktop.DBus.Error.UnknownMethod

I am able to use bluetoothctl to see "scan on" and see the regular Bluetooth devices I am looking to track.

"'Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn\'t exist\n'" Is this the problem?

Joeviocoe commented 1 year ago

Screenshot_2023-08-09_16-42-02

I installed D-Feet and took a look at the code. The ConnectDevice method doesn't exist for me. Is there a difference between our version of BlueZ?

andriilahuta commented 1 year ago

"'Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist\n'" Is this the problem?

Yes, that's why it doesn't work. I'm not sure when it was introduced into BlueZ D-Bus API, although this is still an experimental feature (here are the docs). I have BlueZ version 5.64 on Ubuntu 22.04.

BigThunderSR commented 1 year ago

It's also possible to use bluetooth integration with D-Bus API instead. Here's a proof of concept if anyone wants to try. custom_bluetooth_tracker.zip

Caveats:

  • Discovery is not implemented, so trackable devices should already be present in known_devices.yaml
  • Bluez experimental features should be enabled (--experimental flag)

andriilahuta, this is working so far on my HAOS VM. Thanks!

andriilahuta commented 1 year ago

I've noticed that it eats the battery of my phone a bit too much for my liking (2-4% more per night), so I've added an extra option to poll less frequently when the device was already seen recently:

device_tracker:
  - platform: custom_bluetooth_tracker
    interval_seconds: 15
    seen_interval_seconds: 600
    consider_home: 90

With this config the device will be marked as away only after 10 minutes it's out of range (and still will be marked home within 15 seconds). Might be too much, but it works for my use cases and the battery drain is negligible.

Joeviocoe commented 1 year ago

"'Method "ConnectDevice" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist\n'" Is this the problem?

Yes, that's why it doesn't work. I'm not sure when it was introduced into BlueZ D-Bus API, although this is still an experimental feature (here are the docs). I have BlueZ version 5.64 on Ubuntu 22.04.

I am still on Ubuntu 18.04 :facepalm: and my BlueZ version is 5.48. I have an upgrade planned to go to Debian 12, so hopefully that will fix things.

Thanks for your help.

UPDATE:
Spun up a test VM of Debian 12 and its BlueZ version is 5.64-2. At first it had the same methods as the previous screenshot, but when I enabled "--experimental" there are a bunch more, including the needed ConnectDevice Screenshot_2023-08-09_18-36-39 I am confident an upgrade to my HA system should make your custom_bluetooth_tracker component work as intended.| I guess my older version doesn't quite do the "--experimental" flag properly. I just removed the flag and restarted, and it appears the "--experimental" flag does not add anything to the dbus methods.

Duke-Box commented 1 year ago

HI,

Andriilahuta - thanks for your custom component. I eventually tested it out and can confirm it works fine, both on my Pi4 and on my generic x86 instances of HA running HAOS

Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5 Frontend 20230802.1 - latest

Once again many thanks.

Rubquila commented 1 year ago

Sorry for my ignorance but... how could I test it? how do you install it on a rpi3?

andriilahuta commented 1 year ago

@Rubquila just unzip to _customcomponents directory and enable it in the config file (see an example couple posts above).

barneyman commented 1 year ago

@andriilahuta - can't find your repo for this

andriilahuta commented 1 year ago

@barneyman it's not in a repo, here you can find a link to zip file: https://github.com/home-assistant/core/issues/89119#issuecomment-1661192703.

Rubquila commented 1 year ago

@Rubquila just unzip to _customcomponents directory and enable it in the config file (see an example couple posts above).

But... how can I activate experimental flag?

andriilahuta commented 1 year ago

@Rubquila if your OS uses systemd, you can try creating /etc/systemd/system/bluetooth.service.d/override.conf file with the following content:

[Service]
ExecStart=
ExecStart=/usr/lib/bluetooth/bluetoothd --experimental

And then running

systemctl daemon-reload
systemctl restart bluetooth
boggiano commented 1 year ago

I am Home Assistant 2023.7.3 on Raspian 11. I installed custom_bluetooth_tracker and modified the bluetooth service with the --experimental flag, but I get:

_2023-08-31 15:06:00.523 ERROR (SyncWorker7) [homeassistant.util.package] Unable to install package dbus-fast>=1.87.0: ERROR: Cannot install dbus-fast>=1.87.0 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

andriilahuta commented 1 year ago

@boggiano try lowering dbus-fast version in custom_bluetooth_tracker/manifest.json to 1.86.0.

boggiano commented 1 year ago

@boggiano try lowering dbus-fast version in custom_bluetooth_tracker/manifest.json to 1.86.0.

It works! Thanks!

devildant commented 1 year ago

@Rubquila just unzip to _customcomponents directory and enable it in the config file (see an example couple posts above).

Hi @andrilahuta to use your custom_bluetooth_tracker

in configuration.yaml

panel_custom:
  - name: custom_bluetooth_tracker
    url_path: custom_bluetooth_tracker

device_tracker:
  - platform: custom_bluetooth_tracker
    interval_seconds: 15
    consider_home: 150

inside /etc/bluetooth/main.conf

i passe experimental at true

also i put my iphone mac bluetooth address in known_devices.yaml

my_iphone_test:
  name: my_iphone
  mac: BLE_XX:FA:XX:0B:XX:1D
  icon:
  picture:
  track: true

but nothing works, am I missing something?

best regard

bdraco commented 1 year ago

Maybe this will eventually make its way into core at some point, but in the mean time 2023.10.x will have a new solution for tracking devices when the IRK can be obtained

https://deploy-preview-28761--home-assistant-docs.netlify.app/integrations/private_ble_device/

devildant commented 1 year ago

Maybe this will eventually make its way into core at some point, but in the mean time 2023.10.x will have a new solution for tracking devices when the IRK can be obtained

https://deploy-preview-28761--home-assistant-docs.netlify.app/integrations/private_ble_device/

according to the info, you need a mac for that... I don't have one and I don't want one :) Apple is really a bane for home automation...

Duke-Box commented 1 year ago

@devildant

Isn't this custom component for classic bluetooth?

You have a BLE device configured in your known.yaml.

devildant commented 1 year ago

@devildant

Isn't this custom component for classic bluetooth?

You have a BLE device configured in your known.yaml.

I created it manually in known_devices.yaml with the Bluetooth information retrieved on my iPhone

it may be BT instead of BLE, but that doesn't change anything, I configured SSH access to HomeAssistant, but it seems that I am in a limited environment I cannot install BlueZ, and the modification that I did on the file /etc/bluetooth/main.conf is reset at each startup.

I just started with home assistant, and I'm a little lost haha

devildant commented 1 year ago

OK my bad, trouble with websocket :p

my config for help PI 3B installation with raspberry pi OS (https://www.home-assistant.io/installation/raspberrypi/)

configuration:

in configuration.yaml :

panel_custom:
  - name: custom_bluetooth_tracker
    url_path: custom_bluetooth_tracker

device_tracker:
  - platform: custom_bluetooth_tracker
    interval_seconds: 10
#    seen_interval_seconds: 60
    consider_home: 60

in known_devices.yaml


bluetooth_iphone_devildant:
  name: bluetooth_iphone_devildant
  mac: BT_XX:XX:XX:XX:XX:XX
  icon: 'mdi:bluetooth-settings'
  picture:
  track: true

note: for found the mac address in ios, open settings/general/about (or settings/general/informations) and inside line mac: BT_yourMacAddressFound

thx for this fix :) but i also question why it's works ? i don't install BlueZ (because I have not been able to launch an apt-get command) and i don't activate the experimental mode (because I don't know where to activate it)

best regards

Duke-Box commented 1 year ago

@devildant

Glad you got it working, especially as people were pointing you in the right direction. You got there in the end. :-)

but i also question why it's works ? i don't install BlueZ (because I have not been able to launch an apt-get command) and i don't activate the experimental mode (because I don't know where to activate it)

I gather from that statement you haven't read the whole thread, because the answers to those questions are in this thread. Doesn't the thread title give you a clue?

Start here https://github.com/home-assistant/core/issues/89119#issuecomment-1661192703

devildant commented 1 year ago

@devildant

Glad you got it working, especially as people were pointing you in the right direction. You got there in the end. :-)

but i also question why it's works ? i don't install BlueZ (because I have not been able to launch an apt-get command) and i don't activate the experimental mode (because I don't know where to activate it)

I gather from that statement you haven't read the whole thread, because the answers to those questions are in this thread. Doesn't the thread title give you a clue?

Start here #89119 (comment)

yes yes I read haha ​​but between the links on the bluetooth doc of HA, the pyBluez and the Bluez, the experimental mode... I'm a bit lost :p but if I understand correctly pyBluez is a deprecated python lib, which is based on a system element "bluez" which has the functions in its api necessary in this experimental version. this bluez element is natively installed for bluetooth control. and HA activates experimental mode by default. am I good? :p another question can we deactivate experimental mode on HA? (to know if ever one day it changes) sorry for all these questions I like to understand :p

Duke-Box commented 1 year ago

It isn't pyBluez, or "Bluez". That's the point of the thread.

This component uses the D-Bus API in experimental mode. You must be confused.

And because you have a native install of HA on Pi3, i.e running HAOS, then all this is done for you. As per my question in the thread and the response from Nick (bdraco), 5 posts down from my previous link. So you didn't need to hack any files via SSH. After you had put the custom files into your custom_components dir you just needed to edit your yaml files You had the correct stuff in you configuration.yaml and once you corrected your known_device.yaml, it worked.

EDIT: but I agree the bluetooth tracker documentatiion isn't great and when I have suggested updates to it I have runn into a brick wall with some of the devs.

devildant commented 1 year ago

It isn't pyBluez, or "Bluez". That's the point of the thread.

This component uses the D-Bus API in experimental mode. You must be confused.

yes, I discovered home assistant, home assistant, a lot of information at the same time, my bad haha

And because you have a native install of HA on Pi3, i.e running HAOS, then all this is done for you. As per my question in the thread and the response from Nick (bdraco), 5 posts down from my previous link. So you didn't need to hack any files via SSH. After you had put the custom files into your custom_components dir you just needed to edit your yaml files You had the correct stuff in you configuration.yaml and once you corrected your known_device.yaml, it worked.

I'm not used to everything working like that haha ​​so it lost me haha.

anyway thanks for the info and help :)

Rubquila commented 1 year ago

I have tried this CustomComponent and it works for me too. Although it must be emphasized that it works with the system update with Python 3. That is, in HAOS 2023.5.4 it did not work for me due to the Python version.