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

Raykube A1 Ultra (hc7n0urm): remote unlock refused when the member ID in ble_unlock_check is not 0x0001

Open lesaca-domotique opened this issue 3 weeks ago • 1 comments

Hi, and thanks a lot for this integration — it lets me run three Raykube A1 Ultra locks (category jtmspro, product_id hc7n0urm) fully locally in Home Assistant.

Problem Remote unlock was refused by all three locks. In tuya_ble.py, the FD50 V4 unlock frame hard-codes the member ID as 00 01:

return b"\x00\x00\x00\x00\x01\x47\x00\x00\x13" + prefix + b"\x00\x01" + check_code + b"\x01" + check_key + b"\x00\x01"

But the first two bytes of ble_unlock_check hold the member ID of the account that shared the lock, and it is not always 1. On my locks it is 00 03, 00 04 and 00 06.

Fix Use the member ID from ble_unlock_check instead of the constant:

return b"\x00\x00\x00\x00\x01\x47\x00\x00\x13" + prefix + check[0:2] + check_code + b"\x01" + check_key + b"\x00\x01"

With this one-line change, unlock works on all three locks (tested since 27/10, and again on today's version d4e88a2).

Could you include it in a future release? Each HACS update currently overwrites my local fix.

Thanks!

lesaca-domotique avatar Nov 11 '26 16:11 lesaca-domotique

I’d appreciate it if you could open a PR for that fix instead.

ShonP40 avatar Nov 12 '26 09:11 ShonP40