home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.06k stars 29.72k forks source link

Gardena Bluetooth integration is continuously losing connection to Water Computer #118257

Open dornadeluxe opened 3 months ago

dornadeluxe commented 3 months ago

The problem

I recently added the Gardena Bluetooth integration and added my Gardena Water Computer into Home Assistant. My Raspberry PI that runs HA is in the same room than the Water Computer so I am using the bluetooth directly off the Raspi. However unfortunatley As I can see in the Logbook the Water Computer loses its connection to HA multiple times per hour. I also had to replace the first battery in a matter of days so I do not know what is going on. What I already did: connected the Water Computer to my iPhone and did a firmware update to 1.7.23.29. Then deleted it again from the phone and did a factory reset by pressing the button, before putting in the battery. It directly connected to HA again but the problem persists.

Bildschirmfoto 2024-05-27 um 21 20 52

What version of Home Assistant Core has the issue?

2024.5.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

gardena_bluetooth

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 3 months ago

Hey there @elupus, mind taking a look at this issue as it has been labeled with an integration (gardena_bluetooth) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `gardena_bluetooth` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign gardena_bluetooth` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


gardena_bluetooth documentation gardena_bluetooth source (message by IssueLinks)

elupus commented 3 months ago

I don't think the built-in ble in the raspberry is reliable enough sadly. Can you try a esp32 gateway?

collateral87 commented 3 months ago

I have the same issue with a espAtom Bluetooth proxy.

elupus commented 3 months ago

I have the same issue with a espAtom Bluetooth proxy.

And you have updated the gardena firmware. Older ones are broken.

collateral87 commented 3 months ago

1.7.13.20 is my Firmware.

elupus commented 3 months ago

1.7.13.20 is my Firmware.

Pretty sure that is broken: https://github.com/home-assistant/core/issues/103117#issuecomment-2107137994

collateral87 commented 3 months ago

I updated my firmware yesterday to vesion 1.7.13.29, what worked without issue. Since the update the watercomputer stays connected without a disconnect. I will report, when it should fail again. Thank you for your tip @elupus.

Gmering commented 3 months ago

Hi, how can I update to this version. In my ha it doesn't show the availability to update... sorry.

collateral87 commented 3 months ago

I only deactivated the integration in homeassistant and connect the device with the gardena bluetooth app, update the Firmware, close the app and activate the integration again.

collateral87 commented 3 months ago

I must report that it didnt solve the problem. It happens again...

frontside76 commented 3 months ago

Same problem here. I got it to work for 3 weeks (have M5Stack Atom bluetooth proxy). Iwas on vacation and did no Updates. After my return at home, I made HA Update and the System restarted. After the restart of my HA 1 of my bluetooth valves is offline again.

My ESP config:

substitutions: name: "bluetooth-proxy-gardena-1" friendly_name: Bluetooth Proxy Gardena 1 packages: esphome.bluetooth-proxy: github://esphome/firmware/bluetooth-proxy/m5stack-atom-lite.yaml@main esphome: name: ${name} name_add_mac_suffix: false friendly_name: ${friendly_name} api: encryption: key: *****

esp32_ble_tracker:

external_components:

bluetooth_proxy: active: True cache_services: True

wifi: ssid: !secret wifi_ssid password: !secret wifi_password

Valve firmware is: 1.7.23.29

elupus commented 3 months ago

@frontside76 it is not as simple that batteries are out?

frontside76 commented 3 months ago

@frontside76 it is not as simple that batteries are out?

No, the valves are New: 100% battery

elupus commented 3 months ago

Any errors in logs?

frontside76 commented 3 months ago

Any errors in logs?

Log details (ERROR) Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 08:53:20 (1 occurrences) Last logged: 08:53:20

Error setting up entry Gardena Ventil 1 for gardena_bluetooth Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/gardena_bluetooth/init.py", line 55, in async_setup_entry sw_version = await client.read_char(DeviceInformation.firmware_version, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/gardena_bluetooth/client.py", line 180, in read_char return char.decode(await self.read_char_raw(char.uuid)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/gardena_bluetooth/parse.py", line 82, in decode return data.decode("ASCII") ^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 3: ordinal not in range(128)

elupus commented 3 months ago

@frontside76 Interesting, that is duplicate of #118956

elupus commented 3 months ago

@frontside76 did you update your esp gateway too or just HA?

frontside76 commented 3 months ago

@frontside76 did you update your esp gateway too or just HA?

Both

elupus commented 3 months ago

@frontside76 did you update your esp gateway too or just HA?

Both

Do you happen to know what versions they were using before.

frontside76 commented 3 months ago

I had the problem with every Version. If I take out the battery and put it in again. It will work, till next time I do a restart of HA. Then one of the 3 Valves will have connection problems. Some weeks ago i also had the problem during the day, or when Backup is running. But this is fixed. So only if I restart HA, the Valve maybe thinks there is still a connection, but it is not.

elupus commented 3 months ago

I had the problem with every Version. If I take out the battery and put it in again. It will work, till next time I do a restart of HA. Then one of the 3 Valves will have connection problems. Some weeks ago i also had the problem during the day, or when Backup is running. But this is fixed. So only if I restart HA, the Valve maybe thinks there is still a connection, but it is not.

If the message in the logs does not indicate a connection problem. The device is connected but giving invalid data. Lets continue this in #118956 if that error occur on a new restart of HA.

frontside76 commented 3 months ago

OK

lucaobermaier commented 2 months ago

I have the same issue - my connection broke down after changing values, the switch or random after some time. Firmware is 1.7.23.29. I have two devices right next to each other. BT transmitter is an offset Realtek BT transmitter. So no proxy is in use. Connection was only lost on one of them.

Logger: homeassistant.components.gardena_bluetooth Quelle: helpers/update_coordinator.py:344 Integration: Gardena Bluetooth (Dokumentation, Probleme) Erstmals aufgetreten: 20:24:38 (9 Vorkommnisse) Zuletzt protokolliert: 23:29:53

Error fetching Gardena Bluetooth Data Update Coordinator data: Unable to update data for 98bd0f14-0b0e-421a-84e5-ddbf75dc6de4 due to Communcation failed with device: Gardena Bluetooth - 70:B9:50:5F:F0:E5: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address 70:B9:50:5F:F0:E5 was found: 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 Error fetching Gardena Bluetooth Data Update Coordinator data: Unable to update data for 98bd0f14-0b0e-421a-84e5-ddbf75dc6de4 due to Communcation failed with device: Gardena Bluetooth - D8:71:4D:02:03:C9: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address D8:71:4D:02:03:C9 was found: 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 Error fetching Gardena Bluetooth Data Update Coordinator data: Unable to update data for 98bd0f14-0b0e-421a-84e5-ddbf75dc6de4 due to Unable to find device

Mariusthvdb commented 2 months ago

I updated my firmware yesterday to vesion 1.7.13.29, what worked without issue. Since the update the watercomputer stays connected without a disconnect. I will report, when it should fail again. Thank you for your tip @elupus.

Can you please explain how you updated the device? I received mine yesterday, and its firmware is still 1.7.13.20, and no indication anywhere how to update?

Wait, nevermind, I found the Gardena App, and was able to update to 1.7.23.29, but only after I disabled the HA Integration. With that enabled, the update process would constantly break.

frontside76 commented 2 months ago

I updated my firmware yesterday to vesion 1.7.13.29, what worked without issue. Since the update the watercomputer stays connected without a disconnect. I will report, when it should fail again. Thank you for your tip @elupus.

Can you please explain how you updated the device? I received mine yesterday, and its firmware is still 1.7.13.20, and no indication anywhere how to update?

Wait, nevermind, I found the Gardena App, and was able to update to 1.7.23.29, but only after I disabled the HA Integration. With that enabled, the update process would constantly break.

frontside76 commented 2 months ago

I updated my firmware yesterday to vesion 1.7.13.29, what worked without issue. Since the update the watercomputer stays connected without a disconnect. I will report, when it should fail again. Thank you for your tip @elupus.

Can you please explain how you updated the device? I received mine yesterday, and its firmware is still 1.7.13.20, and no indication anywhere how to update?

Wait, nevermind, I found the Gardena App, and was able to update to 1.7.23.29, but only after I disabled the HA Integration. With that enabled, the update process would constantly break.

Mariusthvdb commented 2 months ago

thanks.

Given the fact I have a few BT proxies (Shelly 1 PM gen 3, Atom Echo, Olimex Poe), and also some connection trouble, I would love to be able to find the connecting proxy easily. Seems only the Olimex for now is close to reliable.

Suppose there is not a sensor for that connection, or some other place in HA where we find that?

love the new valve entity, not sure what the difference between the 2 is though, they toggle at the same time whenever I toggle either of them

Scherm­afbeelding 2024-07-05 om 15 26 16