thomasloven / hass-plejd

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

Is there a way to set which bluetooth device to use? #40

Open johanschelin opened 9 months ago

johanschelin commented 9 months ago

I have problems when i expanded my Plejd network (today a total of 26 devices) that sometimes the integration stops working with the error "The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device"

I have Intel NUC with integrated Bluetooth and 3 M5Stack proxies. I belive the error is related to the M5Stacks, and I would like to test to force the integration to use the Intel BT instead, as it is located in a good spot with a lot of Plejds close by.

Is that possible?

igalg99 commented 7 months ago

I have similar question. I have 36 Plejd devices and also about 10 more other ble devices . Overall I have 6 bt proxy scattered around. I don't understand if this integration uses just 1 connection to the bt proxy or it uses an instance for each Plejd device.. when I check the logs it shows that the Plejd devices every few hours becomes unavailable for few seconds or so and then it's ok again but if they are unavailable when an automation should run then the automation fails.

I have alls external bt adapter I used before with the Plejd mqtt add on and it was more stable. I was wondering if I can force this integration to work with that USB dongle bt adapter instead of the bt proxy with the hope it will prevent from the momentary unavailable state they occurs now and then.

thomasloven commented 7 months ago

The integration should use One active connection slot on One proxy/adapter.

Whenever a plejd device is seen by any adapter, it is added to a list and when a new connection needs to be made attempts will be made to connect to each device in turn - starting from the one which had the best connection to the adapter that first found it. Once any connection has been made, no more attempts are made and communication to other plejd devices is handled by their internal meshing.

Which adapter is used to make the connection attempt is handled entirely by Home Assistant, and there is no way to pick a specific one for one integration as far as I know.

I could make some experiments with how to pick which plejd to connect to.

igalg99 commented 7 months ago

Ok got it! Thank you for the detailed response. Any insights what could cause then the momentary "unavailable" status? It affects all devices when it becomes unavailable. It can become unavailable for few seconds.

On Nov 9, 2023, 11:00, at 11:00, "Thomas Lovén" @.***> wrote:

The integration should use One active connection slot on One proxy/adapter.

Whenever a plejd device is seen by any adapter, it is added to a list and when a new connection needs to be made attempts will be made to connect to each device in turn - starting from the one which had the best connection to the adapter that first found it. Once any connection has been made, no more attempts are made and communication to other plejd devices is handled by their internal meshing.

Which adapter is used to make the connection attempt is handled entirely by Home Assistant, and there is no way to pick a specific one for one integration as far as I know.

I could make some experiments with how to pick which plejd to connect to.

-- Reply to this email directly or view it on GitHub: https://github.com/thomasloven/hass_plejd/issues/40#issuecomment-1803519607 You are receiving this because you commented.

Message ID: @.***>

punxaphil commented 6 months ago

I have similar question. I have 36 Plejd devices and also about 10 more other ble devices . Overall I have 6 bt proxy scattered around. I don't understand if this integration uses just 1 connection to the bt proxy or it uses an instance for each Plejd device.. when I check the logs it shows that the Plejd devices every few hours becomes unavailable for few seconds or so and then it's ok again but if they are unavailable when an automation should run then the automation fails.

I have the same issue, every now and then devices become unavailable. This is when using bluetooth proxy with esp32. My previous solution with HA running on a laptop with built in bluetooth worked fine. But now I've moved to a HA green, so I thought I'd try out the proxy way.

Mats1717 commented 6 months ago

Hi Installed 2024.1 now and it did not find any blutooth adapter, rewerted back to 2023.12 and it was working again.

thomasloven commented 5 months ago

Version 0.7.0 handles picking the best connection a bit differently. Please let me know if you get any better performance with that.

Mats1717 commented 5 months ago

Already 0.6.0 was working for me. Tried 0.7.0 now and working fine👍👍