thomasloven / hass-plejd

🔹 Plejd BLE integration for Home Assistant
81 stars 10 forks source link

Dropped connection after HAOS 11 upgrade #44

Closed ankisch closed 8 months ago

ankisch commented 8 months ago

Thanks for a great integration, and all your other contributions aswell, Thomas.

Unfortunately after upgrading to HAOS 11.0 the connection to the mesh is dropped resulting in entities getting unavailable every other minute.

IMG_5179

I get the following messages in the logs:

Logger: pyplejd.ble
Source: runner.py:186
First occurred: 22:58:42 (27 occurrences)
Last logged: 23:01:45

Plejd mesh keepalive signal failed: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Unlikely Error)
Plejd mesh keepalive signal failed: [org.bluez.Error.Failed] Not connected.

—-

Logger: pyplejd.ble
Source: custom_components/plejd/light.py:82
Integration: Plejd (documentation)
First occurred: 22:58:42 (7 occurrences)
Last logged: 23:07:23

Writing to plejd mesh failed: [org.bluez.Error.Failed] Not connected
Writing to plejd mesh failed: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Unlikely Error)

—-

Logger: pyplejd.ble
Source: custom_components/plejd/light.py:86
Integration: Plejd (documentation)
First occurred: 23:00:29 (1 occurrences)
Last logged: 23:00:29

Writing to plejd mesh failed: [org.bluez.Error.Failed] Not connected

I am using HAOS 11.0, HA 2023.10.3 and Plejd 0.3.5 on a Intel NUC. Please let me know if you want any more info.

FreshJonte commented 8 months ago

+1, I am using the same version and having the same problem. Hoping for a quick resolve. Thank you 👍

bm500 commented 8 months ago

+1. Same issue hear :(. I'm also using HAOS 11.0, HA 2023.10.3 and Plejd 0.3.5 on a Intel NUC.

Errol log: (https://gofile.me/4p0eE/E38FhhJ0c)

supersonical commented 8 months ago

Looks like i have the issue aswell.

claeshellgren commented 8 months ago

A temporary fix is to revert to HAOS 10.5.

Run the following command from the command line (I use the SSH add on): ha os update --version 10.5

I had the same problem. Reverting to 10.5 solved the problem while waiting for a permanent fix...

thomasloven commented 8 months ago

I belive this is a Home Assistant issue. Seems Bluez was updated in HAOS, and that's potentially causing issues. See https://github.com/home-assistant/operating-system/issues/2821 (also https://github.com/home-assistant/operating-system/issues/2818)

I hear this can take two weeks or so to fix, due to developers also having a life. Please consider downgrading HAOS if you cannot wait.

ricmik commented 8 months ago

As a side note, I can recommend using ESP32 Bluetooth Proxies. I was skeptical to them at first, but I've been very happy with the first proxy I set up in my house. I also moved over to another platform to run Home Assistant on, which does not have Bluetooth support. I was very happy to see that the Bluetooth proxy was connected automatically and all BLE devices ready to use without need for an internal Bluetooth device.

thomasloven commented 8 months ago

The first version of this integration had workarounds in place specifically to work with proxies.

Now they are absolutely the best way to use it. Actually faster and more stable in many cases than a BT stick plugged into your machine.

s0len commented 8 months ago

I'm using a Shelly plus 1pm as passive proxy and it's located 1,5 meters away from a Plejd device. But my Plejd device is spotty at best. Is there something I'm missing or any best practice on how to make a good BLE connection?

thomasloven commented 8 months ago

Plejd requires an active connection to publish updates.

s0len commented 8 months ago

🤯🤯🤯 thanks 🤩

FreshJonte commented 8 months ago

I'm using a Shelly plus 1pm as passive proxy and it's located 1,5 meters away from a Plejd device. But my Plejd device is spotty at best. Is there something I'm missing or any best practice on how to make a good BLE connection?

Plejd requires an active connection to publish updates.

The bluetooth integration does not seem to support shelly active connections at the moment unfortunately https://www.home-assistant.io/integrations/bluetooth#remote-adapters-bluetooth-proxies

Shelly Bluetooth advertisement listening: Shelly v2 device with firmware 12.0 or later Bluetooth advertisement bundling: not supported Single active connection: not supported Multiple active connections: not supported

magicus commented 8 months ago

I actually found my way here due to this issues. I've been using hassio-plejd, but am now promptly switching to this integration instead! :)

I can also report that the issue in 11.0 seems indeed to be fixed in 11.1.rc1. If you want to try it out (as opposed to staying on 10.5 until 11.1 is released), here is what to do: Connect to your supervisor via ssh, and issue these commands:

~ $ ha os info
~ $ ha supervisor options --channel=beta
~ $ ha supervisor reload
~ $ ha supervisor update
~ $ ha os update
<this will update and reboot your system>
~ $ ha supervisor options --channel=stable
~ $ ha os info
<verify version has been updated>
ankisch commented 8 months ago

Working with HAOS 11.1 and HA 2023.10.5.