Closed alistair23 closed 1 month ago
If any body can add that check to their proxy devices, it would be a nice thing to test.
You can test that fix by adding something like this to your config:
external_components:
- source: github://pr#6590
components: [ bluetooth_proxy ]
For me it's working now pretty stable without any connection losses, since 2 days. I will post my config later.
I would much appreciate if somebody tested above mentioned fix. I thunk that fix is correct, but unsure if it solves the issue here.
I can try it from Monday on.
Testing it now.
@wtom unlikely to make a difference. Looks like nothing will trigger that change.
There does seem to be potential issues with multiple connections, so having any ble_client
section in your esp proxy config it's most likely to just make thing worse.
In theory i have a fix for having a ble_client config in your esp proxy. it is still invalid to have that section there for this device, but should break less with the changes in https://github.com/esphome/esphome/pull/6596
external_components:
- source: github://pr#6596
components: [ bluetooth_proxy, esp32_ble_client ]
This config with the Gardena Firmware 1.7.23.29 works so far stable. Since 4 days no connection loss, even with the new start after uploading the pr#6590.
Maximum in the past was like 3 days at most.
packages:
esphome.bluetooth-proxy: github://esphome/firmware/bluetooth-proxy/esp32-generic.yaml@main
esp32_ble_tracker:
external_components:
- source: github://pr#6590
components: [ bluetooth_proxy ]
#ble_client:
# - mac_address: B0:D2:78:91:4C:42
# id: gardena_water_switch
# auto_connect: false
I can add and test the new change as well, if you need to.
Still working stable here without connection loss.
Can you switch to the alternate version i posted above?
Sure, i will install it now.
Edit: After installing, the connection was again made without a power cycle. I will let it run, and i will report if something unexpected will happen.
[09:26:07][I][bluetooth_proxy:278]: [0] [B0:D2:78:91:4C:42] Connecting v3 with cache
[09:26:07][D][esp32_ble_tracker:215]: Pausing scan to make connection...
[09:26:07][I][esp32_ble_client:067]: [0] [B0:D2:78:91:4C:42] 0x00 Attempting BLE connection
[09:26:09][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_CONNECT_EVT
[09:26:09][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_OPEN_EVT
[09:26:09][I][esp32_ble_client:154]: [0] [B0:D2:78:91:4C:42] Connected
[09:26:09][D][esp32_ble_tracker:266]: Starting scan...
[09:26:09][D][esp32_ble_client:188]: [0] [B0:D2:78:91:4C:42] cfg_mtu status 0, mtu 247
[09:26:09][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:09][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:10][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:11][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_READ_CHAR_EVT
[09:26:16][I][esp32_ble_client:084]: [0] [B0:D2:78:91:4C:42] Disconnecting.
[09:26:16][D][esp-idf:000]: W (18337) BT_HCI: hci cmd send: disconnect: hdl 0x0, rsn:0x13
[09:26:16][D][esp-idf:000]: W (18344) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16
[09:26:16][D][esp-idf:000]: W (18346) BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x16
[09:26:16][D][esp-idf:000]: W (18347) BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x16
[09:26:16][D][esp32_ble_client:110]: [0] [B0:D2:78:91:4C:42] ESP_GATTC_CLOSE_EVT
[09:26:16][D][esp-idf:000]: W (18381) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16
No problems so far.
Perfect. @alistair23 could you test with above config too? Make sure there is no active ble client in your config.
Testing now. I'll report back in a few days
esp32_ble_tracker:
id: ble_tracker_id
scan_parameters:
interval: 1100ms
window: 1100ms
bluetooth_proxy:
active: true
cache_services: true
external_components:
- source: github://pr#6596
components: [ bluetooth_proxy, esp32_ble_client ]
Doesn't seem to make a difference. The device still disappears.
The config from https://github.com/home-assistant/core/issues/103117#issuecomment-2068770732 has the same issue as well.
Firmware version: 1.7.8.18
Please remove the tracker did too to start with.
You said you could not update the firmware? My guess is that is the key here.
There appears to be no way to update the older firmware, same as https://github.com/home-assistant/core/issues/103117#issuecomment-2056556459
I got both my valves replaced now by Gardena because of the bluetooth issue. I also had a bad/slow connection via official app and couldn't update the firmware. The replaced valves had a newer firmware and I could immediately update them to (probably) the latest firmware (1.7.23.29) via the App . Bluetooth connection is now way better
Regarding bluetooth proxy, I still had issues that the connection was gone after a few minutes. But with that config/PR it looks quite stable. I'll watch it now in the next days
packages:
esphome.bluetooth-proxy: github://esphome/firmware/bluetooth-proxy/esp32-generic.yaml@main
external_components:
- source: github://pr#6590
components: [ bluetooth_proxy ]
esp32_ble_tracker:
8 days now and no problems with
external_components:
- source: github://pr#6596
components: [ bluetooth_proxy, esp32_ble_client ]
Perfekt. The changes in pr6596 have been merged upstream. So will not be needed once next esphome release is out.
Are the changes from that PR enough to make it stable or are additional config changes like mentioned further above still needed compared to the standard Bluetooth Proxy config that ESPHome deploys from their website?
Standard ble proxy should be enough. Enabling additional things are more likely to break it, so avoid that.
I have similar issues. Where can I put that script part with "external_components" to? I tried to add it to my configuration.yaml but receive an error right away, complaining about the external_components to be not known.
I have similar issues. Where can I put that script part with "external_components" to? I tried to add it to my configuration.yaml but receive an error right away, complaining about the external_components to be not known.
On the ble proxy yaml file.
I've added external_components to my esphome yaml, with no huge affect.
Devices are disconnecting almost every few minutes. But once before 9PM disconnects till now.
My YAML:
esp32_ble_tracker:
scan_parameters:
interval: 2000ms
window: 1000ms
active: true
bluetooth_proxy:
active: true
external_components:
- source: github://pr#6590
components: [ bluetooth_proxy ]
That config wont help. 6590 has no effect. Look at my post above with 6596. But make sure you have new firmware on your device.
I'd like to go for that configuration as well, but I don't have ESP hardware yet. Can someone point me to a parts list, what I need to buy when I don't have anything yet, not even experience with ESP?
That config wont help. 6590 has no effect. Look at my post above with 6596. But make sure you have new firmware on your device.
I changed for 6596, for fist 10 minutes valves were unavailable. But now it's finally online - let's see for how long :)
I'd like to go for that configuration as well, but I don't have ESP hardware yet. Can someone point me to a parts list, what I need to buy when I don't have anything yet, not even experience with ESP?
Just ESP32 - it's enough.
Ps. Do note that 6596 has an additional component on it.
Additionally, there are also some more BLE fixes in ESP-IDF 4.4.7. This was reported to fix a problem where scans stop and don't start again with active scanning for a few users.
esp32:
framework:
type: esp-idf
version: 4.4.7
I'd like to go for that configuration as well, but I don't have ESP hardware yet. Can someone point me to a parts list, what I need to buy when I don't have anything yet, not even experience with ESP?
Just ESP32 - it's enough.
Do you have a link? On esphome.io I don't find hardware and on Amazon I only find chips that I need to plug into a board, but I don't know what board is needed?
If you want something that requires no soldering
https://www.olimex.com/Products/IoT/ESP32/
ESP32-POE-ISO-EA is the model you want
If you want something that has a case as well
ESP32-EVB-EA
And the box: https://www.olimex.com/Products/IoT/ESP32/BOX-ESP32-EVB-EA/
Thanks a lot, this is very helpful.
For reference, Gardena told me this
Our Global Service in Germany have confirmed any new models with or after firmware version 1.7.13.20 “No FOTA” (remote firmware update) it is possible to conduct an update.
They also said
We have been advised by our Global Tech Team that the water computer you have is not capable of doing a firmware update. We suggest if the computer is still within the 2 year warranty period that you return it to the place of purchase for a replacement.
So if you are reading this and have a version earlier then 1.7.13.20
go and return it. It sounds like it has been recalled, but Gardena are refusing to issue an official recall
First few hours after change. Works but not stable.
haos 12.3 includes bluez fixes that might be relavent for those using ble adapters instead of proxies
One valve works as it wants - lots of disconnections Second valve is disconnected...
@marithpl You have not mentioned what firmware yours are running. As noted, some are seemingly broken
1.7.23.29 & 1.7.8.18
The 1.7.8.18
device will need to be returned, it won't create a reliable connection
https://github.com/home-assistant/core/issues/103117#issuecomment-2107137994
Hello, I'm adding my piece here I have the Water Control Bluetooth 01889-20, brand new. Firmware updated (1.7.23.29)
HA on a RPI4
It has connected very fast to HA the first time I booted it up.
But it won't connect again since I placed it in its location outside.
I have a Shelly Plus PM 1 meter away configured as a bluetooth proxy (I tried Active and Passive)
That can see it
shelly_notification:209 Event from script:1: {"component":"script:1","id":1,"event":"ble.scan_result","data":[2,[["f0:5e:cd:2d:bf:08",-82,"AgEGEQbkbdx1v93lhBpCDgsBAL2Y",""]]],"ts":1715588372.58}
HA can see it aswell, but cannot seem to connect at all I don't understand why the RSSI is so low since the shelly is very close
➜ ~ bluetoothctl | grep F0:5E:CD:2D:BF:08
[CHG] Device F0:5E:CD:2D:BF:08 RSSI: 0xffffffa0 (-96)
hci0 F0:5E:CD:2D:BF:08 type LE Public connect failed (status 0x08, Timeout)
[DEL] Device F0:5E:CD:2D:BF:08 F0-5E-CD-2D-BF-08
[NEW] Device F0:5E:CD:2D:BF:08 F0-5E-CD-2D-BF-08
[CHG] Device F0:5E:CD:2D:BF:08 RSSI: 0xffffffa2 (-94)
hci0 F0:5E:CD:2D:BF:08 type LE Public connect failed (status 0x03, Failed)
[DEL] Device F0:5E:CD:2D:BF:08 F0-5E-CD-2D-BF-08
hci0 F0:5E:CD:2D:BF:08 type LE Public connected eir_len 0
[NEW] Device F0:5E:CD:2D:BF:08 F0-5E-CD-2D-BF-08
hci0 F0:5E:CD:2D:BF:08 type LE Public disconnected with reason 1
[CHG] Device F0:5E:CD:2D:BF:08 Connected: no
[CHG] Device F0:5E:CD:2D:BF:08 RSSI: 0xffffffa1 (-95)
[CHG] Device F0:5E:CD:2D:BF:08 AdvertisingFlags:
[CHG] Device F0:5E:CD:2D:BF:08 RSSI: 0xffffff9c (-100)
[DEL] Device F0:5E:CD:2D:BF:08 F0-5E-CD-2D-BF-08
➜ ~ bluetoothctl info F0:5E:CD:2D:BF:08
Device F0:5E:CD:2D:BF:08 (public)
Alias: F0-5E-CD-2D-BF-08
Paired: no
Bonded: no
Trusted: no
Blocked: no
Connected: no
LegacyPairing: no
UUID: Vendor specific (98bd0001-0b0e-421a-84e5-ddbf75dc6de4)
RSSI: 0xffffffa3 (-93)
AdvertisingFlags: 06
And here is the error I got in HA
2024-05-14 17:48:49.222 ERROR (MainThread) [homeassistant.components.gardena_bluetooth] Error fetching Gardena Bluetooth Data Update Coordinator data: Unable to update data for 98bd0f13-0b0e-421a-84e5-ddbf75dc6de4 due to Communcation failed with device: Gardena Bluetooth - F0:5E:CD:2D:BF:08: Failed to connect after 10 attempt(s): No backend with an available connection slot that can reach address F0:5E:CD:2D:BF:08 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
Does anybody have any idea ? Is the shelly not suitable for this purpose ?
thx a lot
Shellys are not suitable for this purpose as they don't proxy actual Bluetooth connections, they only support advertisements.
ah ..... that solves it .... thx a lot
Here still no problems anymore.
I have two ESP32 proxies and that seems to be a problem. I paired my Gardena BT to the proxy at the second floor and the connection is stable, no disconnect. Then I brought it downstair which has another BT proxy then it kept disconnecting. Brining it back to the second floor then it works again flawlessly.
And finaly disconnected (today at 2AM).
Home Assistant restarted, ESP restarted and connection won't come back.
Hi there, I'm trying to find a way to use my ESP32 as a proxy with the Gardena Bluetooth, and it It seems that this is what some of you are doing. Are you using the gardena bridge? I can't find any documentation on the way to do it. And I am completely confused about how all this is supposed to work. I don't have any gardena bridge and I am wondering is if I can do without it and use a Bluetooth proxy on an ESP32 chip instead, to add a valve control service for HA.
What I understand: There is 2 ways to use the electronic valve.
Thanks for help of course it would help to see your yaml and to know your setup
I reply to myself:
No need to have a Gardena bridge to get the Gardena Bluetooth vane integrated to home assistant. Just an ESP32 configured as an USB proxy by adding this section in the ESPHome yaml configuration file:
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
bluetooth_proxy:
active: true
I then had to reset the Gardena Vane to factory default like it is suggested here.
After the factory reset, my home assistant instance automatically suggested me (from the "Device and Services section") to install the Gardena Integration. If it does not, you will have to click the "Add Integration" button and to pickup the Gardena Bluetooth integration. I could then retreive all the sensors to manage my gardena device.
Of course, the ESP32 has to be configured to be connected to your home assistant instance. Which should be done automatically once to setup a Wifi section in esphome yaml conf file:
wifi:
#ssid: !secret wifi_ssid
#password: !secret wifi_password
# or with multiple networks
networks:
- ssid : !secret wifi_ssid1
password: !secret wifi_password3
- ssid: !secret wifi_ssid2
password: !secret wifi_password
The problem
This is somewhat similar to https://github.com/home-assistant/core/issues/98561 in that the Bluetooth connection disconnects when using an ESPHome Bluetooth proxy. The connection stays up for a few days, but eventually the Gardena device becomes unavailable.
Once the device has become unavailable it won't reappear until I remove and reinsert the battery from the device.
That doesn't always work though. The attached log in the issue is while I power cycle the Gardena device but it doesn't reconnect in the HA UI.
The ESPHome device is located very close to the Gardena Bluetooth controller, but it is a long distance from the WiFi access point. I am working on hard wiring it encase that is the issue.
What version of Home Assistant Core has the issue?
core-2023.10.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
https://www.home-assistant.io/integrations/gardena_bluetooth
Diagnostics information
logs_esp32-bluetooth-proxy_logs.txt
ha.log
Example YAML snippet
No response
Anything in the logs that might be useful for us?