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

jtmspro zpebvcjt (GHome KH10) - FD50 channel negotiates, device disconnects ~30ms after FUN_SENDER_DEVICE_INFO

Open colincravenho-cpu opened this issue 1 month ago • 2 comments

Device

Product GHome KH10 V2.0 smart door handle (BLE-only, no Wi-Fi)
Category jtmspro
Product ID zpebvcjt
Advertised service 0000fd50-0000-1000-8000-00805f9b34fb (no legacy a201)
Advertised name alternates between LOCK, None and Simple Peripheral
HA version 2026.10.4
Integration current master

Simple Peripheral is the stock TI BLE-stack default name, so the radio appears to reinitialise between advertisement bursts. Flagging it in case it is relevant.

Credentials (uuid, local_key, ble_unlock_check) were pulled from the Tuya IoT OpenAPI with TinyTuya and are confirmed loading — ble_unlock_check is populated (28 chars) after triggering one remote unlock from the Smart Life app.

Datapoints reported by the cloud

alarm_lock, auto_lock_time, automatic_lock, beep_volume, ble_unlock_check,
check_code_set, child_lock, do_not_disturb, hijack, lock_motor_state, lock_record,
manual_lock, mute_mode_period, record, remote_no_dp_key, remote_pd_setkey_check,
residual_electricity, rtc_lock, synch_method, temporary_password_creat,
temporary_password_delete, temporary_password_modify, unlock_ble, unlock_dynamic,
unlock_fingerprint, unlock_method_create, unlock_method_delete,
unlock_method_modify, unlock_password, unlock_phone_remote, unlock_temporary,
unlock_voice_remote

That looks like the standard FD50 jtmspro schema (dp 46 manual_lock, dp 47 lock_motor_state, dp 71 ble_unlock_check).

Mapping added locally

Modelled on the y2yaegze entry, plus zpebvcjt registered in the four hardcoded ("hc7n0urm", "y2yaegze") tuples in lock.py:

"zpebvcjt":  # GHome KH10 smart door handle - TuyaOS FD50
[
    TuyaBLELockMapping(
        dp_id_unlock=6,
        dp_id_lock=46,
        dp_id=118,
        dp_id_nop=52,
        keep_connect=False,
        keep_connect_timer=60,
        description=LockEntityDescription(key="manual_lock"),
    ),
],

What happens

DEBUG ... DC:23:52:XX:XX:XX: Connecting; RSSI: -86
DEBUG ... DC:23:52:XX:XX:XX: Connected; RSSI: -86
DEBUG ... DC:23:52:XX:XX:XX: legacy characteristics not present, using FD50 GATT channel
DEBUG ... DC:23:52:XX:XX:XX: Sending device info request
DEBUG ... DC:23:52:XX:XX:XX: Sending packet: #14 FUN_SENDER_DEVICE_INFO
DEBUG ... DC:23:52:XX:XX:XX: Device unexpectedly disconnected; RSSI: -86
ERROR ... DC:23:52:XX:XX:XX: timeout receiving response, RSSI: -86
ERROR ... DC:23:52:XX:XX:XX: Sending device info request failed

The connection succeeds, service discovery succeeds, _uses_fd50_channel is set correctly — and then the lock drops the link roughly 30-70 ms after the device-info write, every time. Setup never completes and no entities are created.

Ruled out

  • Signal. HA's connection-path picker reports hci0 ... (RSSI=-66) with the lock sitting next to the host. Two connectable scanners available (a USB adapter and an ESPHome proxy); same result through either.
  • Credentials. keyman logs the address lookup hitting and all 10 fields present.
  • Another BLE central holding the slot. Identical with the phone's Bluetooth off and the vendor app closed.
  • FD50 specifics not applied. Payload 00 f3, protocol marker 0x20 and the single 244-byte write are all gated on or self._uses_fd50_channel, which is true here, so they should be in effect.
  • Sequence number. It does not reset on unexpected disconnects (climbs across retries), but the very first attempt at #1 failed the same way.

Question

Is there a known firmware variant that rejects the device-info frame like this — different key derivation, a different protocol version byte, or a bonding/pairing requirement before GATT writes are accepted?

Happy to capture an Android HCI snoop log of the vendor app talking to the lock and decode the device-info exchange, if that is the useful next step. Also happy to open a PR with the mapping above once the handshake is sorted.

colincravenho-cpu avatar Nov 02 '26 22:11 colincravenho-cpu

Follow-up with measurements from a direct probe, and a correction to my original post.

I wrote a probe that connects to the lock through HA's Bluetooth stack and sends a single crafted FUN_SENDER_DEVICE_INFO, so each variable could be isolated. Results below. Correction first: my original suggestion that this is a key-derivation difference is not supported. Please disregard that part.

Device facts

GATT table (jtmspro / zpebvcjt, GHome KH10 V2.0):

service 0000fd50-0000-1000-8000-00805f9b34fb
    00000001-0000-1001-8001-00805f9b07d0  h=10  write-without-response,write
    00000002-0000-1001-8001-00805f9b07d0  h=11  notify
    00000003-0000-1001-8001-00805f9b07d0  h=13  read      <- reads back empty (len=0)

Only two notify/indicate characteristics exist on the whole device (2a05 Service Changed and the FD50 notify), and subscribing to both changes nothing - so the reply is not arriving on an unexpected characteristic.

Advertisement:

service_uuids : 0000fd50-0000-1000-8000-00805f9b34fb
service_data[0000fd50-...] = 490c00082ce8b18c5165687e
manufacturer_data          : absent

This may be worth handling in _decode_advertisement_data independently of this bug: with no 0x07D0 manufacturer data, _protocol_version and _is_bound are never populated, and the service data is keyed under fd50 rather than SERVICE_UUID (a201), so raw_product_id stays None. _protocol_version therefore keeps its default of 2 for this device rather than being read from the device.

What was measured

ATT MTU is 247 when the link is good, so the 36-byte device-info frame is delivered in one write. Attempts where MTU negotiated to 23 were discarded, since a 36-byte write cannot be delivered under a 23-byte MTU - worth noting for anyone else probing this, as it silently invalidates tests.

  • Control (connect, subscribe, send nothing): link stays up 12 s. Not an idle timeout.
  • Baseline (MD5(local_key[:6]), payload 00f3, pv 2): disconnects 184 ms / 246 ms / 105 ms after the write across runs.
  • 16 alternative key derivations (full/sliced local_key, uuid, device_id, MAC, concatenations): no reply.
  • Payload (empty) / 00f3 / 0000 / 00f0 crossed with protocol version byte 2 / 3 / 4, correct key: no reply.
  • Write-with-response and write-without-response: no difference.

The part I cannot resolve

Initially the correct key disconnected while wrong keys stayed silently connected, which looked like a clean signal that the device was validating the frame. That did not reproduce - a later run with identical inputs returned "write accepted, silent, link still up". So I can't claim the device is parsing the frame, and I'd treat the disconnect/silence distinction as unreliable.

Some of this variance is probably RF: this unit sits at -70 to -86 dBm and MTU negotiation fails intermittently at the weaker end. I previously said range was ruled out based on a -66 dBm reading; that was premature, since I had not checked the negotiated MTU at the time.

Where that leaves it

The key and framing look right, the frame is delivered intact, the device is not timing out, and there is nowhere else for a reply to arrive. Either the firmware wants something before device-info that the library does not send, or the behaviour is partly an artifact of a marginal link. I don't think it can be settled from this side without a capture of the official app, which I can't produce: the device is paired to an Android 17 Samsung with a locked bootloader, and every snoop copy reachable without root has ACL payloads stripped.

Happy to run further probes on request - the harness takes key/payload/protocol-version/opcode as parameters, so specific hypotheses are cheap to test. If a capture is essential I'd need to pair the lock to a rooted Android first.

colincravenho-cpu avatar Nov 03 '26 17:11 colincravenho-cpu

The zpebvcjt is not a supported device by this integration (take a look at the README for supported devices), thus support will not be provided.

As stated many times before, please do not open issues for new device requests, but instead work on integrating it yourself & open a PR once you have working code.

ShonP40 avatar Nov 06 '26 20:11 ShonP40