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
73.51k stars 30.71k forks source link

Gardena Irrigation Valve 9 V Bluetooth losing connection after a few minutes #98561

Closed xlemassacre closed 1 year ago

xlemassacre commented 1 year ago

The problem

Hey, I'm using a ESP32 bluetooth proxy to connect to the Gardena Irrigation Valve 9V Bluetooth. Everything works fine for a few minutes, but then the connection is lost and the device gets unavailable.

It''s not possible to reconnect to the valve anymore. I need to remove the battery to start the pairing (no reset), which also doesnt't work sometimes without deleting the device in the gardena addon.

I have tried to figure out the problem, but i'm not able to identify if it's the gardena addon, bluetooth proxy or the valve itself.

What version of Home Assistant Core has the issue?

2023.8.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

gardena_bluetooth

Link to integration documentation on our website

https://www.home-assistant.io/integrations/gardena_bluetooth/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.gardena_bluetooth
Source: helpers/update_coordinator.py:229
Integration: Gardena Bluetooth (documentation, issues)
First occurred: 22:03:26 (1 occurrences)
Last logged: 22:03:26

Error fetching Gardena Bluetooth Data Update Coordinator data: Unable to update data for 98bd0b11-0b0e-421a-84e5-ddbf75dc6de4 due to Communcation failed with device: Gardena Bluetooth - E4:E1:12:FF:8D:72: Failed to connect after 7 attempt(s): Timeout waiting for connect response while connecting to E4:E1:12:FF:8D:72 after 20.0s, disconnect timed out: True, after 5.0s

Additional information

I have the same issue both my valves. Also tried a different esp32.

home-assistant[bot] commented 1 year 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.

(message by CodeOwnersMention)


gardena_bluetooth documentation gardena_bluetooth source (message by IssueLinks)

elupus commented 1 year ago

Could you have started the gardena app on your phone? It seems to lock is out.

xlemassacre commented 1 year ago

I saw in the ticket #97957 that there is an issue when i also have the valves connected to the app. I have removed them alreaday from the app and also disconnected the bluetooth connections from the phone.

elupus commented 1 year ago

It does seem to stop responding. Not sure why to be honest. Could be related to the esp gateway. Maybe you can look at the logs on that device.

elupus commented 1 year ago

Do you have multiple esp gateways btw? Maybe its trying to connect using a different one and that causes it to fail.

xlemassacre commented 1 year ago

I tried two different esp gateways, but always only one at at time. I did flash esphome differently now yesterday, and it seems to be more stable now. I'll do more tests this weekend to see if this solves the issue

mathisschmieder commented 1 year ago

I have two of the same irrigation valves and am experiencing the same issues, both with and without a bluetooth proxy. Attached is a log: hass-gardena-bluetooth.log

Sometimes, the device recovers, but most of the time it doesn't. I have never connected the valves to the Gardena app, nor do I have it on my phone.

elupus commented 1 year ago

Once it fails to recover, does a restart of home assistant make any difference (core and possibly full computer)? Also restarts of any esp gateways would be interesting to check.

mathisschmieder commented 1 year ago

Yes, a restart of the home assistant process (I'm running it dockerized) renders the valves usable for a couple of minutes. I can't comment on restarting the esp gateway yet, unfortunately. Once thing I noticed was that the update times kept increasing before it finally fails completely.

Also, I've just put the esp gateway on a USB power bank into the box directly next to the valves and it looks like the update times are staying low. Maybe this somehow is a signal strength issue?! The proxy can't really stay where it is for a long time, but I'll try to keep it in there at least for today to see if the connection is more stable.

elupus commented 1 year ago

Could be something is leaking memory/handles on failed connections. Possibly inside the device.

xlemassacre commented 1 year ago

I did some improvements now, but i'm not able to get a stable connection for more than a few hours. Especially when i connect both my valves, one valve is always disconnected after a few minutes.

Are there any logs that could help investigating the problem?

elupus commented 1 year ago

Logs on the esp gateways

xlemassacre commented 1 year ago

this is a log from esp32 where the device firts connects successfully, and then disconnects:

`[19:59:21][I][bluetooth_proxy:278]: [0] [E4:E1:12:FF:8D:82] Connecting v3 with cache [19:59:21][D][esp32_ble_tracker:214]: Pausing scan to make connection... [19:59:21][I][esp32_ble_client:064]: [0] [E4:E1:12:FF:8D:82] 0x00 Attempting BLE connection [19:59:22][I][esp32_ble_client:144]: [0] [E4:E1:12:FF:8D:82] Connected [19:59:22][D][esp32_ble_tracker:246]: Starting scan... [19:59:28][I][esp32_ble_client:081]: [0] [E4:E1:12:FF:8D:82] Disconnecting. [19:59:28][D][esp-idf:000]: W (351776) BT_HCI: hci cmd send: disconnect: hdl 0x0, rsn:0x13

[19:59:28][D][esp-idf:000]: W (351781) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16

[19:59:28][D][esp-idf:000]: W (351784) BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x16

[19:59:28][D][esp-idf:000]: W (351788) BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x16

[19:59:28][D][esp-idf:000]: W (351826) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16

[20:00:23][I][bluetooth_proxy:278]: [0] [E4:E1:12:FF:8D:82] Connecting v3 with cache [20:00:23][D][esp32_ble_tracker:214]: Pausing scan to make connection... [20:00:23][I][esp32_ble_client:064]: [0] [E4:E1:12:FF:8D:82] 0x00 Attempting BLE connection [20:00:43][I][esp32_ble_client:081]: [0] [E4:E1:12:FF:8D:82] Disconnecting. [20:00:48][W][bluetooth_proxy:268]: [0] [E4:E1:12:FF:8D:82] Connection request ignored, device is disconnecting [20:00:53][D][esp-idf:000]: W (436500) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x100

[20:00:53][D][esp-idf:000]: W (436504) BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x100

[20:00:53][D][esp-idf:000]: W (436505) BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x100

[20:00:53][W][esp32_ble_client:134]: [0] [] Connection failed, status=133 [20:00:53][D][esp32_ble_tracker:246]: Starting scan... [20:00:53][I][bluetooth_proxy:278]: [0] [E4:E1:12:FF:8D:82] Connecting v3 with cache [20:00:53][D][esp32_ble_tracker:214]: Pausing scan to make connection... [20:00:53][I][esp32_ble_client:064]: [0] [E4:E1:12:FF:8D:82] 0x00 Attempting BLE connection [20:01:13][I][esp32_ble_client:081]: [0] [E4:E1:12:FF:8D:82] Disconnecting. [20:01:18][W][bluetooth_proxy:268]: [0] [E4:E1:12:FF:8D:82] Connection request ignored, device is disconnecting [20:01:23][D][esp-idf:000]: W (466914) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x100

[20:01:23][D][esp-idf:000]: W (466917) BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x100

[20:01:23][D][esp-idf:000]: W (466919) BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x100

[20:01:23][W][esp32_ble_client:134]: [0] [] Connection failed, status=133 [20:01:23][D][esp32_ble_tracker:246]: Starting scan... `

elupus commented 1 year ago

Seems its timing out a previous disconnection request, leaving the device hanging.

Could you make sure you are running esp gateways of version 2023.8.0 that was released this week and check again?

xlemassacre commented 1 year ago

yes it is the latest version 2023.8.0. there is some auth error that i always get on a fresh connect (after resetting the valve):

`[21:27:04][I][esp32_ble_client:196]: [0] [E4:E1:12:FF:8D:82] Connected [21:27:04][I][esp32_ble_client:265]: [0] [E4:E1:12:FF:8D:82] auth complete. remote BD_ADDR: e4e112ff8d82 [21:27:04][E][esp32_ble_client:268]: [0] [E4:E1:12:FF:8D:82] auth fail reason = 0x61 [21:27:05][I][esp32_ble_client:081]: [0] [E4:E1:12:FF:8D:82] Disconnecting. [21:27:05][D][esp-idf:000]: W (281043) BT_BTM: btm_sec_clr_temp_auth_service() - no dev CB

[21:27:05][D][esp-idf:000]: W (281048) BT_HCI: hci cmd send: disconnect: hdl 0x0, rsn:0x13 [21:27:05][D][esp-idf:000]: W (281055) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16 [21:27:05][D][esp-idf:000]: W (281059) BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x16 [21:27:05][D][esp-idf:000]: W (281064) BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x16 [21:27:05][D][esp-idf:000]: E (281073) BT_BTM: Device not found

[21:27:05][D][esp-idf:000]: W (281078) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16 [21:27:05][D][esp-idf:000]: E (281081) BT_APPL: bta_gattc_mark_bg_conn unable to find the bg connection mask for: e4:e1:12:ff:8d:82 [21:27:05][I][bluetooth_proxy:278]: [0] [E4:E1:12:FF:8D:82] Connecting v3 with cache [21:27:05][I][esp32_ble_client:064]: [0] [E4:E1:12:FF:8D:82] 0x00 Attempting BLE connection [21:27:08][I][esp32_ble_client:144]: [0] [E4:E1:12:FF:8D:82] Connected`

I have disabled now the continuos scanning to see if that makes a difference.

elupus commented 1 year ago

The auth error is expected i think. It does an automatic pairing. Too bad you already had the latest esp release.

Or guess is somehow a disconnect fails (times out) and after that it's broken. We have a timeout increase in the works, but it needs a few upstream fixes that might be a few months away and it's not guaranteed to work.

xlemassacre commented 1 year ago

I think I found a solution thats fine for the moment. I have disabled the continuous scanning in esphome and added a button to trigger scanning from home assistant manually.

The valves now disconnect after 5 minutes and stay unavailable until i trigger the scan. It takes a few seconds up to a minute to connect to the valves. Then i can start the watering.

mathisschmieder commented 1 year ago

Can you share your esphome config.yml? I'd like to try if it solves the issue on my end as well. Thanks!

xlemassacre commented 1 year ago

Can you share your esphome config.yml? I'd like to try if it solves the issue on my end as well. Thanks!

esp32_ble_tracker: scan_parameters: active: true continuous: false

bluetooth_proxy: active: true

button:

DobroschkeBjoern commented 1 year ago

Hello All, I use an Raspberry PI 3 and 4 with the integrated Bluetooth. After some minutes the Gargena Irrigation Valve 9V Bluethooth is not available in my Intgegration anymore. What can I do?

This is, what I see in the logs...

2023-08-29 18:15:12.430 ERROR (MainThread) [homeassistant.components.gardena_bluetooth] Error fetching Gardena Bluetooth Data Update Coordinator data: Unable to update data for 98bd2a19-0b0e-421a-84e5-ddbf75dc6de4 due to Communcation failed with device: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Unlikely Error) 2023-08-29 18:16:48.564 WARNING (MainThread) [gardena_bluetooth.client] Unexpected disconnection from device Gardena Bluetooth - F0:5E:CD:22:B1:19: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address F0:5E:CD:22:B1:19 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 2023-08-29 18:19:10.955 WARNING (MainThread) [gardena_bluetooth.client] Unexpected disconnection from device Gardena Bluetooth - F0:5E:CD:22:B1:19: Failed to connect after 5 attempt(s): TimeoutError 2023-08-29 18:21:25.261 WARNING (MainThread) [gardena_bluetooth.client] Unexpected disconnection from device Gardena Bluetooth - F0:5E:CD:22:B1:19: Failed to connect after 7 attempt(s): failed to discover services, device disconnected 2023-08-29 18:23:34.835 WARNING (MainThread) [gardena_bluetooth.client] Unexpected disconnection from device Gardena Bluetooth - F0:5E:CD:22:B1:19: Failed to connect after 4 attempt(s): TimeoutError 2023-08-29 18:24:53.830 ERROR (MainThread) [root] A message handler raised an exception: 'org.bluez.Device1'. Traceback (most recent call last): File "src/dbus_fast/message_bus.py", line 811, in dbus_fast.message_bus.BaseMessageBus._process_message File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 854, in _parse_msg condition_callback() File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 709, in callback self._properties[device_path][defs.DEVICE_INTERFACE][property_name]


KeyError: 'org.bluez.Device1'
...
2023-08-29 18:25:46.243 ERROR (MainThread) [root] A message handler raised an exception: 'org.bluez.Device1'.
Traceback (most recent call last):
  File "src/dbus_fast/message_bus.py", line 811, in dbus_fast.message_bus.BaseMessageBus._process_message
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 854, in _parse_msg
    condition_callback()
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 709, in callback
    self._properties[device_path][defs.DEVICE_INTERFACE][property_name]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'org.bluez.Device1'
elupus commented 1 year ago

We have some fixes we are waiting for in a upstream library that might help in the meantime placing an esp32 bluetooth proxy nearer might help.

DobroschkeBjoern commented 1 year ago

ok - will setup an bluetooth proxy in the meanwhile thanks

mr-p666 commented 1 year ago

@DobroschkeBjoern @xlemassacre @mathisschmieder I had the same problem. After playing around for a few hours, I just disconnected the Bluetooth proxy, connected the valve to the Gardena Android app, performed the firmware update (from v1.7.13.20) and closed the app after the last step - the factory reset. After that I reconnected the Bluetooth proxy and everything has been working as it should since that. Over a week without a single disconnect. :-)

mathisschmieder commented 1 year ago

Oh that is a very good idea. I think I‘m on the same firmware revision and will give it a try tonight

DobroschkeBjoern commented 1 year ago

I have already used before I have started witht the integration the latest Firmware. I flashed a standard ESPHome Bluetooth Proxy and integrated it to HA. Unfortuantly I still have the same issue.

This are the current logentries...

2023-08-30 16:47:29.321 ERROR (MainThread) [homeassistant.components.gardena_bluetooth] Error fetching Gardena Bluetooth Data Update Coordinator data: Unable to update data for 98bd0b12-0b0e-421a-84e5-ddbf75dc6de4 due to Communcation failed with device: BLUETOOTH PROXY [b8:f0:09:ce:35:9c]: Timer - F0:5E:CD:22:B1:19: Disconnected during operation
2023-08-30 16:48:46.188 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Timer for gardena_bluetooth
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aioesphomeapi/connection.py", line 667, in send_message_await_response_complex
    await fut
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 97, in _async_wrap_bluetooth_operation
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 386, in disconnect
    return await self._disconnect()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 390, in _disconnect
    await self._client.bluetooth_device_disconnect(self._address_as_int)
  File "/usr/local/lib/python3.11/site-packages/aioesphomeapi/client.py", line 783, in bluetooth_device_disconnect
    await self._connection.send_message_await_response_complex(
  File "/usr/local/lib/python3.11/site-packages/aioesphomeapi/connection.py", line 670, in send_message_await_response_complex
    raise TimeoutAPIError(
aioesphomeapi.core.TimeoutAPIError: Timeout waiting for response for <class 'api_pb2.BluetoothDeviceRequest'> after 5.0s

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/gardena_bluetooth/__init__.py", line 64, in async_setup_entry
    await client.disconnect()
  File "/usr/local/lib/python3.11/site-packages/gardena_bluetooth/client.py", line 86, in _disconnect
    await client.disconnect()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 382, in disconnect
    return await self._backend.disconnect()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 99, in _async_wrap_bluetooth_operation
    raise asyncio.TimeoutError(str(err)) from err
TimeoutError: Timeout waiting for response for <class 'api_pb2.BluetoothDeviceRequest'> after 5.0s
2023-08-30 16:49:03.408 WARNING (MainThread) [aioesphomeapi.connection] bluetooth-proxy @ 192.168.99.11: Connection error occurred: [Errno 104] Connection reset by peer
2023-08-30 16:49:34.680 DEBUG (MainThread) [homeassistant.components.gardena_bluetooth] Finished fetching Gardena Bluetooth Data Update Coordinator data in 0.925 seconds (success: True)
2023-08-30 16:51:24.813 WARNING (MainThread) [gardena_bluetooth.client] Unexpected disconnection from device BLUETOOTH PROXY [b8:f0:09:ce:35:9c]: Timer - F0:5E:CD:22:B1:19: Disconnected during operation
2023-08-30 16:51:24.817 ERROR (MainThread) [homeassistant.components.gardena_bluetooth] Error fetching Gardena Bluetooth Data Update Coordinator data: Unable to update data for 98bd0b12-0b0e-421a-84e5-ddbf75dc6de4 due to Communcation failed with device: BLUETOOTH PROXY [b8:f0:09:ce:35:9c]: Timer - F0:5E:CD:22:B1:19: Disconnected during operation
2023-08-30 16:51:24.819 DEBUG (MainThread) [homeassistant.components.gardena_bluetooth] Finished fetching Gardena Bluetooth Data Update Coordinator data in 50.499 seconds (success: False)
elupus commented 1 year ago

For reference, my watering computer (which does not exhibit this problem) is running firmware 1.7.23.29 so looks to be a bit newer.

mr-p666 commented 1 year ago

For reference, my watering computer (which does not exhibit this problem) is running firmware 1.7.23.29 so looks to be a bit newer.

Since the version number is not updated in HA, I can't say for sure. But the first three digits of the version number are definitely the same for me as for you since I did the update. :+1:

Edit: I have to correct my comment: After restarting HA, the version of my valve was checked and now I see 1.7.23.29 as well.

mathisschmieder commented 1 year ago

After updating both valves to 1.7.23.29 yesterday evening (about 12 hours ago), they seem to be stable and I can still use them perfectly in home assistant. From my point of view, updating the firmware fixed this issue.

mr-p666 commented 1 year ago

After updating both valves to 1.7.23.29 yesterday evening (about 12 hours ago), they seem to be stable and I can still use them perfectly in home assistant. From my point of view, updating the firmware fixed this issue.

Good to know. Thanks for your feedback. :+1:

DobroschkeBjoern commented 1 year ago

I'm using the following Versions...

Raspberry Pi 4 Modell B (4 GB) with Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5 Frontend 20230802.1 - latest Gardena Model Number TBD von Husqvarna AB Firmware: 1.7.23.29

ESPHome Bluetooth Proxy
    ESPHome version 2023.8.2

I had deactivated the onBoard Bluetooth device in HA, checked the via the mobile app the Gardena Version, reset the Gardena Irrigation Valve, restarted the HA, connected the Valve and checked the connection. After some Minutes or I still loosing the connections.

xlemassacre commented 1 year ago

Seems like my firmware is outdated 1.7.8.18. How did you update the firmware, i don't see any option in the app for that

DobroschkeBjoern commented 1 year ago

@xlemassacre : I got the Gardena Valve, connected it via bluetooth with the mobile app and it automatically asked for the update.... I'm using the current Android App GARDENA Bluetooth App 4.1.0

elupus commented 1 year ago

@DobroschkeBjoern how close is your esp32 to the valve? Also is the esp32 in reasonable wifi range?

DobroschkeBjoern commented 1 year ago

@elupus Yesterday on the 1st floor 5m away...today directly 3m behind the Valve on the same floor. I have not put the Bluetooth Proxy outside yet

DobroschkeBjoern commented 1 year ago

what I have done for 30mins is to change to contious scanning....

INFO ESPHome 2023.8.2 INFO Reading configuration /config/esphome/bluetooth-proxy.yaml... INFO Starting log output from bluetooth-proxy.local using esphome API INFO Successfully connected to bluetooth-proxy.local [12:47:13][I][app:102]: ESPHome version 2023.8.2 compiled on Aug 30 2023, 15:01:29

[12:47:13][C][wifi:379]: Local MAC: ---- [12:47:13][C][wifi:380]: SSID: [redacted] [12:47:13][C][wifi:381]: IP Address: ---- [12:47:13][C][wifi:383]: BSSID: [redacted]

[12:47:13][C][wifi:386]: Signal strength: -67 dB [12:47:13][C][wifi:390]: Channel: 5 [12:47:13][C][wifi:391]: Subnet: 255.255.255.0 [12:47:13][C][wifi:392]: Gateway: ---- [12:47:13][C][wifi:393]: DNS1: ---- [12:47:13][C][wifi:394]: DNS2: 0.0.0.0

[12:47:13][C][logger:302]: Level: DEBUG [12:47:13][C][logger:303]: Log Baud Rate: 115200 [12:47:13][C][logger:305]: Hardware UART: UART0 [12:47:13][C][bluetooth_proxy:088]: Bluetooth Proxy: [12:47:13][C][bluetooth_proxy:089]: Active: YES [12:47:13][C][esp32_ble:238]: ESP32 BLE: [12:47:13][C][esp32_ble:240]: MAC address: B8:F0:09:CE:35:9E [12:47:13][C][esp32_ble:241]: IO Capability: none [12:47:13][C][esp32_ble_tracker:617]: BLE Tracker: [12:47:13][C][esp32_ble_tracker:618]: Scan Duration: 300 s [12:47:13][C][esp32_ble_tracker:619]: Scan Interval: 1100.0 ms [12:47:13][C][esp32_ble_tracker:620]: Scan Window: 1100.0 ms [12:47:13][C][esp32_ble_tracker:621]: Scan Type: ACTIVE [12:47:13][C][esp32_ble_tracker:622]: Continuous Scanning: True

[12:47:13][C][mdns:113]: Hostname: bluetooth-proxy [12:47:13][C][ota:093]: Over-The-Air Updates: [12:47:13][C][ota:094]: Address: bluetooth-proxy.local:3232 [12:47:13][C][ota:097]: Using Password. [12:47:13][C][api:138]: API Server: [12:47:13][C][api:139]: Address: bluetooth-proxy.local:6053 [12:47:13][C][api:141]: Using noise encryption: YES [12:47:30][I][bluetooth_proxy:278]: [0] [F0:5E:CD:22:B1:19] Connecting v3 with cache [12:47:30][D][esp32_ble_tracker:214]: Pausing scan to make connection... [12:47:30][I][esp32_ble_client:064]: [0] [F0:5E:CD:22:B1:19] 0x00 Attempting BLE connection [12:47:32][I][esp32_ble_client:144]: [0] [F0:5E:CD:22:B1:19] Connected [12:47:32][D][esp32_ble_tracker:246]: Starting scan... [12:47:44][I][esp32_ble_client:081]: [0] [F0:5E:CD:22:B1:19] Disconnecting. [12:48:39][I][bluetooth_proxy:278]: [0] [F0:5E:CD:22:B1:19] Connecting v3 with cache [12:48:39][D][esp32_ble_tracker:214]: Pausing scan to make connection... [12:48:39][I][esp32_ble_client:064]: [0] [F0:5E:CD:22:B1:19] 0x00 Attempting BLE connection [12:48:41][I][esp32_ble_client:144]: [0] [F0:5E:CD:22:B1:19] Connected [12:48:41][D][esp32_ble_tracker:246]: Starting scan... [12:48:54][I][esp32_ble_client:081]: [0] [F0:5E:CD:22:B1:19] Disconnecting.

since 20mins I have the valve connection now....checking the situation now...

DobroschkeBjoern commented 1 year ago

I have changed the ESP32 Module and think that this solved finally my issue. I bought a new ESP32 DevModule and flashed it. Before it seems to be an issue with the distance. Now with the new Module it seems to be possible to be away 5m, with the old module 1-2m. Maybe this is helpful for others

bdraco commented 1 year ago

https://github.com/home-assistant/core/pull/99541 will increase the disconnect timeout to 20s

If it needs more time than that, consider replacing the ESP32 as its likely not a too short timeout and the issue https://github.com/home-assistant/core/issues/98561#issuecomment-1702892213