New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth 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
Comments
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)) × python setup.py egg_info did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while generating package metadata. note: This is an issue with the package mentioned above, not pip. 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. |
|
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. 🤦 |
https://github.com/andrewjfreyer/monitor is another way to get this done which I am playing with atm |
The current pybluez release 0.23 is dated Dec 28, 2019. |
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. Caveats:
|
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. |
Yes I agree. |
Thanks for the quick reply. I will try it on my test system which is a pi4 running HAOS also. 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. |
I tried this custom component. It doesn't seem to do anything. I tried with and without this in my configuration.yaml:
Running
I didn't know if I should expect an Integration tile to show up. Should I be expecting already known devices to update my existing device_tracker entities? No error messages (other than warning about a custom component being loaded). |
It should behave exactly like the original bluetooth tracker (except for discovery), so it has no UI. Config looks okay, component-specific debug logs would be helpful. |
I upgrade to version 2023.8.1 on RaspberryPi Home Assistant 2023.8.1 I have gotten the following error:
With this I have updated the version of pip through commands in the terminal and now I have this error:
So I try to install pyBluez via console with "pip install pybluez", but i get the following error:
So it still doesn't work. |
Trying to get debug logs:
homeassistant.components.device_tracker shows other trackers like network devices and a single mention of setting up the custom_bluetooth_tracker
homeassistant.components.bluetooth: Debug logs for Bluetooth Component2023-08-09 08.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 bleak.backends.bluezdbus: bluez.log |
@Joeviocoe could you try this version: It contains some additional debug statements and should produce at least some debug output. |
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. 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. |
yes, I discovered home assistant, home assistant, a lot of information at the same time, my bad haha
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. |
Im confused here... I am still back on 2023.5.4 with unsupervised install and not sure if this is the method to get it to work for phone tracking? It isn't LE and again unsupervised. Are people in this case still waiting? |
Returns Not sure where how or why I'd need to install the wheels which I really no zip about. |
is that all i would have to do then bluetooth tracking would work with newer versions of home assistant unsupervised? |
looks like xz-dev has moved the underlying component from |
any news in 2024.2 version? in this release ships running on Python 3.12! |
Thanks! it works!!! |
Anyone knows if using an ESP32 as Bluetooth proxy would let me use the bluetooth tracker component? |
@freedomanonyme : Where is the error? Or how to controll that this costum componet works? |
Hi! I don't work with a rasberry Pi. I'm on a generic X86-64 with a USB bluetooth dongle bought on Temu. At first I added the bluetooth dongle in the integrations. After that, I added the folder in my custom components as you said. Did you setup the component in your configuration.yaml? :
I track 2 Iphones added manually in the know devices. However, it doesn't work with a Garmin Fenix 6 watch.
|
HI, I too use a generic x86-64 amd/intel old laptop with a usb bluetooth dongle. I originally used a generic bluetooth dongle supporting v5.1 which proved unreliable so I replaced it with one that was compatible with bluetooth v4.0 ( which I believe is recommended for use with HA). I don't use the custom panel integration so your first YAML snippet is irrelevant. Did your old system work with iPhones? can you see their device_tracker.x entities using Developer tools > states? |
Hi all... Would someone be able to help me to activate the --experimental feature? Thanks guys |
It's already activated on ha core.
I think your problem is you want to track an iPhone.
…On Tue, 5 Mar 2024, 23:00 emanuele-bordon, ***@***.***> wrote:
Hi all...
I'm on Home Assistant OS...
Without activating --experimental, I saw my iPhone "Home" for a few
minutes, then I see this error in the logs "hci0 (00:15:83:FB:C1:9F): Error
stopping scanner: [org.bluez.Error.Failed] No discovery started"...
Would someone be able to help me to activate the --experimental feature?
Thanks guys
—
Reply to this email directly, view it on GitHub
<#89119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJIPW7BIYS46D65EGFLXGI3YWZE7PAVCNFSM6AAAAAAVO44ESGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZZG44DANRSHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
but @freedomanonyme track iPhone.... |
@emanuele-bordon might be an adapter issue: #78341. |
Oh... I had purchased a "TRENDnet TBW-107UB (CSR8510A10)" among the "KNOWN WORKING HIGH-PERFORMANCE ADAPTERS" for maximum compatibility... :) @freedomanonyme can you tell me which dongle you use and if you did something special for iPhone? |
Hi! Sorry for the late response. It worked for 48 h… not reliable. |
Mines the same now, a hardware reboot brings it back for a few days. No errors when it drops out so it might be a hard one. |
Hello, there is no news about this problem ? We can't use bluetooth anymore in the future ? |
I agree. So it must be removed from documentation if it isn't working. |
How to use the custom BT integration ? There is a procedure ? |
It is described in this very thread: look for custom_bluetooth_tracker.zip. |
Hello, I add the folder "custom_bluetooth_tracker" in my "custom_components" folder i have this in my configuration.yaml
My devices are already in the "known_devices.yaml" file I restarted HA but... It don't seem to work ? I use a Respberry PI 4 so i think that experimental is on ? |
With the latest update (2024.5.0) custom_bt integration is not working anymore. It seems that BT is hated... now I don't have a reliable presence detection anymore.
|
Here's an updated version: |
You're a hero. |
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
The text was updated successfully, but these errors were encountered: