Closed diamant-x closed 7 months ago
Hi, I confirmed the fix is related to the dependency. This has now been fixed as shared in the related issue ticket.
Thanks.
Meanwhile manual workaround is to download the related library source code, and copy the btlewrap folder into the config/deps folder of home-assistant for it to pick it up instead.
Hello @diamant-x Thanks for your input, and sorry for the delay. If I understand correctly, the issue is not in my code but rather in the btlewrap dependency. Therefore, I'm waiting for https://github.com/ChristianKuehnel/btlewrap/issues/47 to be fixed and streamlined in HA. This will automatically solve the issue. Thanks
to be fixed and streamlined in HA.
Hi, thanks for the reply. The source library has already added to their master branch the changes How can it be "streamlined I to HA"?
As far as I can see, the code was maybe adjusted to resolve the issue, but in github the issue is still open and there was no new release, so it's not officially fixed. Then, the HA dev team need to update the btlewrap library in their codebase in order to import the fix (this is exactly what you've done manually).
Hi,
A new release with the changes was released. https://pypi.org/project/btlewrap/#history Can that be added to a new release of the extension? Not sure if btlewrap is embedded in core HA? In fact HA core seems to be using https://pypi.org/project/bleak/ library as per https://github.com/home-assistant/core/blob/dev/tests/components/bluetooth_le_tracker/test_device_tracker.py
Also, since the last releases the success rate of the connection seems lower (i used to be able to sync with my windows closed, and now i need to leave them open to get updated bluetooth values. My flowerpower is above 50% reported battery so hopefully that should be fine. Maybe this gets fixed with this update or is something else.
There's now an official integration for bluetooth devices since 2022.08. Maybe it could be leveraged to provide better mantained bluetooth connection? As otherwise, the information sent from the parrot device is the same as always. The issue is just due to underlying libraries not being updated to keep up with python versions. Leveraging the official one would ensure the integration always works.
Thanks.
https://www.home-assistant.io/integrations/bluetooth
https://developers.home-assistant.io/docs/network_discovery?_highlight=bluetooth#bluetooth
Integration of this with the new official bluetooth devices would be amazin! add me to the wish list ^^ :-)
Plus having the same issue as you reported above @diamant-x Could you explain more about how do you add the related library source code of btlewrap ?
Could you explain more about how do you add the related library source code of btlewrap ?
I can't find where I found the documentation explaining it but. In order to override the dependencies included in the extension, you can download the master of the dependency you want to use from github (https://github.com/ChristianKuehnel/btlewrap/issues/47#issuecomment-1060989675) and unzip it inside you /config/deps folder. In this case i have /config/deps/btlewrap folder created and the bunch of .py files inside it. Then restart Hassio and it should be picked up (not sure if a core restart or full system restart).
Hope it helps!
Thanks! That is what I had tried but its not working... :-( Not sure why, but I still get the same error. And all this happen with my last update of Home assistant ^^ (it may be because I use the OS version... who knows)
Hi, thanks for your interest. Unfortunately, switching over to the new Bluetooth integration of HA would need to rewrite the whole module. Right now, I don't have the time to deal with that but I'll keep it in mind. Also take into account that, as of today, the HA Bluetooth integration is very new, and lacks some features such as the scan interval, which is very important for these BLE devices (you don't want to scan them every 5 seconds for battery savings).
Also, it seems that HA 2022.8 has bumped Python to version 3.10, which breaks the Bluetooth dependency btlewrap. So, unfortunately this integration needs thorough work.
Hello! Well fixed my problem...
Just sharing what I did and not even sure you must do it like I did... but worked for me ^^
I am using :
Home Assistant 2022.8.3 Supervisor 2022.08.3 Operating System 8.4
What I did is :
modified your manifest to add a requirement = btlewrap
"requirements": ["btlewrap"],
now before that I had forced the install of btlewrap through the console
pip install btlewrap --target ~/config/deps
and hop, up and running again ^^
in a separate comment... i saw that xiaomi flower is also using btlewrap ^^ and they are better integrated to Home assistant... I was just wondering if its not possible to mostly copy paste to get the parrot flower up and running (easier said that done I know ^^)
Great tip, I'll try this out. I've checked the Mi Flora code base, it's somewhat different because of the device, but I'm also exploring the code for this device.
Also, it seems that HA 2022.8 has bumped Python to version 3.10, which breaks the Bluetooth dependency btlewrap. So, unfortunately this integration needs thorough work.
Hi, Just to follow up on this. Your integration is working fine for me on latest 2022.08.03. Also, from my RPi4 it is able to read the signals from my parrot at around 5-7 meters far away with 1 wall in between so performance is quite good (it can't get through a width window though).
The only thing i had to do to is to download the latest release of btlewrap library from github https://github.com/mbrentini/homeassistant_parrotflowerpower/issues/6#issuecomment-1190114981 and make HA to use it https://github.com/mbrentini/homeassistant_parrotflowerpower/issues/6#issuecomment-1210703607 instead.
Thanks again for the effort to make this work. Is thanks to people like you that my nearly 10 years old parrot device, which no longer works with their original applications, keeps being functional through HA and not ending up in eTech wasteland.
@diamant-x and @emilic14
Hi,
I've just added "requirements": ["btlewrap==0.1.1"],
to the manifest.json file, nothing more, rebooted HA, and boom, it got working again.
Could you please check on your installations if this fixes the issue ? Then I'll make a PR.
Thanks a lot !
Ah thanks! That just reminded me what I ACTUALLY did to fix it. I update the manifest just like you propose, but instead used: "requirements": ["btlewrap @ git+https://github.com/ChristianKuehnel/btlewrap.git@master"], That way I pulled in the github updated version. But that was before the btlewrap would push an update to pypi, so i guess now it should be enough with explicitly listing the version as you say. :). Maybe instead of '==' you could define it as '>=', so that if in the future another issue in the connectivity is broken and fixed it is automatically picked up? Or do you prefer to have control over it?
Thanks!
Yeah, I'd prefer using a == for the version identifier if we know that the integration works with this specific version. In that case we are safe from breaking changes due to btlewrap updates.
Hi, so is this fixed and can I use the addon with the most recent home assistant?
Hi @Pferdebockwurst I will upload in the next few days a new version which works well and has some other fixes.
Awesome 😎
Can't wait! Thanks.
Hi @FungusBear @Pferdebockwurst @diamant-x Please check the latest version, it should work fine now (I hope) Cheers
Great, thanks a lot. I will try later. The previous version was running quite well, which the patched manifest.json.
Hi @FungusBear @Pferdebockwurst @diamant-x Please check the latest version, it should work fine now (I hope) Cheers
It is working out of the box now, great work! thanks.
Hi,
The extension stopped working after 2022.02 home-assistant version. The error logs are not very descriptive with just:
2022-03-04 10:11:26 WARNING (SyncWorker_8) [custom_components.parrotflowerpower.sensor] Polling error (BTerror)