When reading the temperature from the Nokia health API, I am getting the following readings. However, these are not correct. In the Nokia app, the readings in Celsius are as follows:
35C { value: 26918, type: 12, unit: -3 }
35.6C { value: 23569, type: 12, unit: -3 }
36.7C { value: 27398, type: 12, unit: -3 }
From what I could gather from the docs:
valueis the value of the measure. This needs to be used in conjunction with theunitparameter to get the correct value.typeindicates the measure type. In this case, 12 means temperatureunitis the exponential multiplier which needs to be multiplied with the value field to get the actual value in SI units.Formula:
actualValue = value * (10 ^ unit)Breaking down one of your examples:
{ value: 26918, type: 12, unit: -3 }Here type is 12 so it's temperature (consequently, we can assume the units to be Kelvin if the API returns in SI units)
so,
actualValue = 26918 * (10 ^ -3)which is26.918KThe docs don't explicitly mention what the temperature units are. I have assumed it to be Kelvin because that is the SI unit of temperature. Excerpt from docs:
Value
Unit