M.Minbashi
M.Minbashi

Reputation: 352

what does the returned value of BLE thermometer mean?

I am using xiaomi LYWSD03MMC , I have got temperature of this device by BLE characteristics and it shows : 21 0a 17 7e 0b , However I know this is hex value but unfortunately i can't understand what does it mean.I only know the number 17, which is the amount of humidity, which is hex, and when I convert it to decimal it returns 23.

Upvotes: 1

Views: 683

Answers (2)

ukBaz
ukBaz

Reputation: 7984

What is the UUID of the characteristic you are reading?

If it is of the format 0000xxxx-0000-1000-8000-00805F9B34FB then it should be documented on https://www.bluetooth.com/

You can find the mapping of Characteristic UUID to name in the 16-bit UUID Numbers Document at: https://www.bluetooth.com/specifications/assigned-numbers/

The name can then be used to look in GATT Specification Supplement for more detailed description of the fields.

Upvotes: 2

Michael Kotzjan
Michael Kotzjan

Reputation: 2663

According to this script from github the first two values describe the temperature and need to be converted to little endian. This would result in a hex value of 0a21 which in decimal is 2539. This needs to be divided by 100 to give you a temperature of 25.39 degrees.

As you said, the third value is humidity, the last two values describe the battery voltage. Converted to little endian (0b7e) and decimal (2942), this value needs to be divided by 1000 and gives you a voltage of 2.942

Upvotes: 1

Related Questions