Open zahical opened 1 year ago
Looking at the code: https://github.com/PlusPlus-ua/ha_tuya_ble/blob/c11a1c5481dd7263182d42135d8416e4ea06f523/custom_components/tuya_ble/tuya_ble/tuya_ble.py#L571
it seems the reconnect loop is limited to 100 attempts, so HA will probably boot at the end.
However, at least, on my set-up, a single retry takes ~ 120 seconds, e.g.
2023-06-29 20:31:47.803 ERROR (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] XX:XX:XX:XX:XX:XX: device not found
...
2023-06-29 20:33:08.866 ERROR (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] XX:XX:XX:XX:XX:XX: device not found
...
2023-06-29 20:34:29.934 ERROR (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] XX:XX:XX:XX:XX:XX: device not found
so it will take a lot of time (3+ hours).
I have noticed the same too. I wonder if we can make the whole connection lazy, i.e. postpone until after startup has completed
Hi,
You are right, connection itself should be postponed, I'll change it.
Please try new build, the problem must be solved.
Just installed this component yesterday on HA 2023.6.3 and same issue. I reboot HA while the Fingerbot off and it cannot finish until I switch on the Fingerbot at least within a reasonable timeframe. Thanks!
The specific device for which I've seen this behavior is Fingerbot. I've already had the device successfully configured and running before that. Then, for unrelated reasons, I've decided to restart HA, however the device was not in range, and HA is now stuck "Waiting on integrations to complete setup: tuya_ble" and "tuya_ble" itself seem to be running an endless connection retry loop. 'Restart HA' (from the restart menu) also doesn't help.
(btw, much thanks for the great integration; having to use "the cloud" to manage a BLE device has always felt really strange to me; thanks to your efforts, now we can avoid this madness)
Versions: HA Core: 2023.5.3 HA OS: 10.1 (running on rpi3-64) tuya_ble: 0.1.7 (commit c11a1c5481dd7263182d42135d8416e4ea06f523), installed by direct
git clone
.Error callstack: