Tuya-BLE icon indicating copy to clipboard operation
Tuya-BLE copied to clipboard

Duplicate BLE notifications after reconnect break message assembly ("Missing packet")

Open Netrezw opened this issue 1 week ago • 0 comments

Device: Raykube AT1 / A1 Pro Max (product_id rlyxv7pe), keep_connect enabled.

Problem: after each reconnect, the notification subscription seems to accumulate, so every packet arrives 2x, 3x, etc. This breaks message assembly and the log fills with "Missing packet" and "Sending device info request failed". The lock becomes unreliable until HA restarts.

Workaround I'm using locally (in _notification_handler, right after self._last_rx_time = time.monotonic()):

if bytes(data) == getattr(self, "_last_notify_packet", None):
    return
self._last_notify_packet = bytes(data)

It drops a packet that is byte-identical to the previous one. It works for me, but the proper fix is probably to stop_notify / avoid re-subscribing on reconnect.

Tested up to 778071b; still reproducible.

Netrezw avatar Nov 27 '26 11:11 Netrezw