Xiaomi mi scale v1 Weight Data

573 Views Asked by At

I am trying to writing an application that can take weight measurement from Xiaomi mi scale version 1. I get a hex value like this 0624b2070101002e3800004c04(5.50kg) from the Body Composition Measurement service.

According to my research the first byte gives 02:measurement unit The last two bytes are the weight value, But when I convert this value to decimal and divide by 200, I don't get the correct value.

Can someone help me get the correct data?

3

There are 3 best solutions below

0
ukBaz On BEST ANSWER

The last two bytes are 4c04. Bluetooth sends data in little endian format so as an integer that is 1100.

The "GATT Specification Supplement 4" document at https://www.bluetooth.com/specifications/specs/ says:

3.27.2.7 Weight field

This field is in kilograms with resolution 0.005 if the bit 0 of the Flag field is 0 or in pounds with a resolution of 0.01 if the bit 0 of the Flag field is 1.

1100 * 0.005 = 5.5kg

0
Michael Kotzjan On

The value of hex 4c04 is equal to 19460 which does not give you the desired result. But changing the endianess (byte-order) to 044c results in a value of 1100 which, divided by 200, gives you the desired result of 5.5kg

0
A96 On

I had a similar problem, here is how i do it personally read the whole thing i had everything documented and don't be intimidated by the looks of it it's pretty simple in fact:

enter image description here

for the conversion i use this website cause well I don't know how to convert :) enter link description here

here is an image showing exactly how it works u need to look to the INT 16 BIG endian and post the whole hex code not just the last two bytes like this: enter image description here

enter image description here