@pittsgal That Temperature Measurement appears to be in hexadecimal. I used an online converter to convert 0x2A1C to decimal and got 10780. Perhaps you tried that, too. I knew we could ignore the 0x after reading the article I link to below but I wasnāt sure about the rest of the value.
So it seems we need some more information about the type of value that is being output as temperature.
And there is some in the information you posted (I tried to find the API documentation you mentioned but couldnāt. Is it available online?).
āByte 1 contains the flag field.ā This helps us know if the temperature is in Ā°C or Ā°F but it doesnāt affect the actual value of the temperature.
According to the article below, each hexadecimal digit maps to 4 bits (4 binary digits). A byte is eight binary digits or two hexadecimal digits. So Byte 1 consists of the first two hexadecimal digits, ā1C.ā So we can ignore those for now.
āByte 2 to 5 is a 4 byte float representing the temperature readingā¦ā Now weāre getting somewhere!
If we take Byte 2 to 5 as a single value, we need to evaluate ā2A.ā Because thatās all that remains after we remove the 0x prefix and Byte 1 ā1C.ā
And 2A in hexadecimal converts to 42 in decimal. So the answer is 42 degrees! Woo hoo! But wait, is that 42Ā°F or 42Ā°C? Probably if youāre measuring the temperature at home with the physical device, you already know the answer. But if you need help with parsing the value from Byte 1, I could take a crack at that, too.
Mind you, I just figured this out and Iāve never worked with hexadecimal. So even though I feel pretty good about the chances that 42Ā° is correct, you might want someone else to double-check my assumptions.
I found this useful: Hexadecimal - learn.sparkfun.com, especially the part titled " Hex-to-Decimal Example: Convert 0xC0DE" and the couple of sections below that. Also, I had to read this to understand that in ālittle endian,ā bytes are read from right to left: Is binary code read from right to left? - Quora.
Edit: I canāt leave well enough alone when it comes to learning more about coding! Byte 1ās value of 1C in hexadecimal equals 00011100 in binary. Thatās eight bits: 0, 0, 0, 1, 1, 1, 0, and 0. According to what you posted above, āBit 0 [is the] Temperature scale.ā So if we look at bit 0, the value is 0 ā Iām pretty sure thatās the right-most value. So this temperature is in Celsius (a value of 1 would indicate Fahrenheit). I hope Iām right!
To contextualize, Iām going to say youāre probably measuring some nice hot tub water at about 108 Ā°F.