Skip to content

Instantly share code, notes, and snippets.

@bendtherules
Last active July 31, 2023 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bendtherules/4f90fb0eba6f2ffd4847d8ab448c0eb1 to your computer and use it in GitHub Desktop.
Save bendtherules/4f90fb0eba6f2ffd4847d8ab448c0eb1 to your computer and use it in GitHub Desktop.
Lenovo HS11 Smart Scale BLE protocol (Chipsea CST34M97 chip)

Lenovo HS11 Scale picture

This is bluetooth (BLE) Gatt protocol for Lenovo HS11 Smart weight scale. It uses Chipsea CST34M97 chip, similar to some Huawei scales.

Main service = 0000fff0-0000-1000-8000-00805f9b34fb
Send command Characteristic = 0000fff1-0000-1000-8000-00805f9b34fb
Receive data Characteristic = 0000fff4-0000-1000-8000-00805f9b34fb

To read last N weight measurements

To read weight measurements, first you have to Write to Send command Characteristic and then read/handle Notify values on Receive data Characteristic.

Send command Characteristic

  • Write F2-00 hex (or [242, 0] as byte array)

Receive data Characteristic

  • Returns last N measurement records. Each measurement record is 10 bytes.
  • Skip measurement records which start with F2-00
  • Last record is just 2 bytes F2-00 to indicate end.
  • Each measurement record consists of - Datetime of mesurement, Weight in kgs (upto 1 decimal), Impedance (to calculate BMI).
  • Example measurement record - 67-1F-0F-1E-3B-F2-E0-7A-12-00

Measurement records -

// 67-1F-0F-1E-3B-F2-E0-7A-12-00

// First 5 bytes - measurement date time
// Next 2 bytes - scale type & weight
// Next 3 bytes - impedance

// byte0 = 67 (hex) = 103 (dec)
year 
= ((byte0 & 240) >> 4) + 2017 
= ((103 & 240) >> 4) + 2017 
= 2023

month
= ((byte0 & 255) & 15) - 1
= ((103 & 255) & 15) - 1
= 6 // 0-based index, 6=July

// byte1 = 1F (hex) = 31 (dec)
day
= byte1
= 31 // 31st July, 2023

// byte2 = 0F (hex) = 15 (dec)
hour
= byte2
= 15 // 3pm

// byte3 = 1E (hex) = 30 (dec)
minute 
= byte3
= 30 // 3:30PM

// byte4 = 3B (hex) = 59 (dec)
seconds
= byte4
= 59 // Time = 3:30:59 PM

// byte5 = F2 (hex) = 242 (dec)
scaleType
= byte5 & 240 
= 242 & 240 
= 240 // Always 240 for this scale

// byte6 = E0 (hex) = 224 (dec)
weight
= (((byte5 & 15) << 8) + byte6) * 0.1 
= (((242 & 15) << 8) + 224) * 0.1 
= 73.6 // kgs

// byte7-8-9 = 7A-12-00 (hex) = 122, 18, 0 (hex)
impedance
= byte7 + (byte8 << 8) + (byte9 << 16)
= 122 + (18 << 8) + (0 << 16)
= 4730

To delete stored measurements

Send command Characteristic

  • Write F2-01 hex (or [242, 1] as byte array)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment