OpenBand BLE Bridge Protocol Specification

Reverse-engineered communication protocol for Xiaomi Smart Band 7 (Zepp OS 1.0 / Dialog DA14697) and compatible Huami/Zepp wearables.


1. Overview & Multiplexing

Unlike official cloud-tethered apps, OpenBand connects directly over Bluetooth Low Energy (BLE) to the Band using Android's native GATT multiplexing:

[ Zepp OS Mini-App on Band ]
        │  hmBle.send() / hmBle.createConnect()
        ▼
[ Dialog DA14697 BLE Firmware ]
        │
   BLE ACL Link (Authenticated by Zepp Life / Mi Fitness)
        │
        ▼
[ OpenBand Companion (Android) ]
        │  connectGatt(..., TRANSPORT_LE)
        ▼
[ Local Action Gateway / Home Assistant (127.0.0.1 or LAN) ]

Because Zepp Life maintains the bonded ACL link, OpenBand opens an independent client GATT handle without requiring root access or re-pairing keys.


2. GATT Service & Characteristics

Under the Huami primary service:

Communication occurs across two dedicated characteristics:

CharacteristicUUIDPropertiesPurpose
Chunked Read / Notify00000017-0000-3512-2118-0009af100700NOTIFY, READWrist $\to$ Phone actions from hmBle.send()
Chunked Write00000016-0000-3512-2118-0009af100700WRITE, WRITE_NO_RESPONSEPhone $\to$ Wrist data into hmBle.createConnect()
CCCD Descriptor00002902-0000-1000-8000-00805f9b34fbWRITEClient Characteristic Configuration

3. Huami 2021 Chunked Framing Format

All payloads passing through 00000016 (write) and 00000017 (notify) are wrapped in an 11-byte Little-Endian binary header:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Opcode (0x03)|      Channel ID (0x0007)      |   Seq (2B)    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Total Payload Length (4B)                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Flags (0xA0) | Reserved(0x00)|         Payload Bytes ...     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Header Fields:


4. Transmission Flows

Flow A: Wrist Action $\to$ Phone

  1. User taps button on wrist mini-app.
  2. Mini-app calls OpenBandBridge.sendAction("light_living_room").
  3. Band firmware wraps payload into the 11-byte frame and sends a BLE Notification on characteristic 00000017.
  4. OpenBand receives onCharacteristicChanged() on 00000017.
  5. OpenBand isolates OPENBAND:<action>, discards binary headers, and dispatches to:
    • Android Testing Popup / Notification
    • Home Assistant REST / Webhook (127.0.0.1:8123 or LAN)
    • Phone Automation (Find My Phone, Torch)

Flow B: Phone Data $\to$ Wrist (e.g. Temperature / Status)

  1. Phone constructs payload (e.g. "Temp: 23.5 C\nStatus: Online").
  2. Android packages payload using encodeHuamiFrame() (11-byte header).
  3. Android writes packet to characteristic 00000016.
  4. Band firmware strips header and delivers bytes to hmBle.createConnect() callback.
  5. OpenBandBridge decodes ArrayBuffer / Uint8Array into clean text and updates the on-screen widget.

5. Critical Implementation Gotchas

  1. Android CCCD Write Queue: Android's BluetoothGatt drops concurrent descriptor writes. Subscribing to notifications must use a sequential queue governed by onDescriptorWrite().
  2. Sensor Filtering: Characteristic 00000007 continuously streams real-time accelerometer and step data. Never enable notifications on 0x0007 for app messaging.
  3. No Automatic Echo Loop: When writing to 00000016, the band may emit a low-level protocol acknowledgment on 00000017. Phone listeners must strictly filter for OPENBAND: and never echo automatic ACKs inside onActionReceived() to prevent infinite loops.
  4. Connection Priority: Request BluetoothGatt.CONNECTION_PRIORITY_HIGH upon connect to reduce BLE packet interval from $\sim 100\text{ ms}$ to $\sim 11\text{ ms}$.