Open ferinelo opened 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 :(
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.
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
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.
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.
https://github.com/andrewjfreyer/monitor is another way to get this done which I am playing with atm
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.
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?
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:
@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.
@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!
@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.
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.
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.
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
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).
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.
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:
bleak.backends.bluezdbus: bluez.log
@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.
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]?
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.
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.
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?
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?
"'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.
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!
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.
"'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
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.
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.
Sorry for my ignorance but... how could I test it? how do you install it on a rpi3?
@Rubquila just unzip to _customcomponents directory and enable it in the config file (see an example couple posts above).
@andriilahuta - can't find your repo for this
@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 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?
@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
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
@boggiano try lowering dbus-fast version in custom_bluetooth_tracker/manifest.json to 1.86.0.
@boggiano try lowering dbus-fast version in custom_bluetooth_tracker/manifest.json to 1.86.0.
It works! Thanks!
@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
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/
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...
@devildant
Isn't this custom component for classic bluetooth?
You have a BLE device configured in your known.yaml.
@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
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
@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
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
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.
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 :)
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.
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:
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?
Additional information
No response