0

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 }
Martin Reiche
  • 1,642
  • 1
  • 16
  • 27
Sheik797
  • 435
  • 4
  • 16
  • What's not real? Can you please provide code? what did you try? I'm not sure what is your question – Daniel Krom May 02 '18 at 09:09
  • Yes please provide at least a code snippet. Currently it is not quite clear what you want ... – Mario Murrent May 02 '18 at 09:17
  • The values are not real because in first row, 26918 is some how 35C, I have to derive 35 from 26918 or atleast some thing in human body temperature range. – Sheik797 May 02 '18 at 11:12

1 Answers1

0

From what I could gather from the docs:

value is the value of the measure. This needs to be used in conjunction with the unit parameter to get the correct value.

type indicates the measure type. In this case, 12 means temperature

unit is 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 is 26.918K

The 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

Value for the measure in S.I units (kilogram, meters, etc.). Value should be multiplied by 10 to the power of "unit" (see below) to get the real value.

Unit

Power of ten the "value" parameter should be multiplied to to get the real value. Eg : value = 20 and unit=-1 means the value really is 2.0

Chirag Ravindra
  • 4,760
  • 1
  • 24
  • 35
  • 26.918K is not in human body temperature range, Those are real data from nokia thermometer. How can we derive ~35C from 26918? – Sheik797 May 02 '18 at 11:16
  • Yeah, the numbers look way off. Unfortunately, I could not find the units of temperature (type:12) mentioned anywhere in the docs. Perhaps the API is returning some values for a different user than the one being seen on the app? – Chirag Ravindra May 02 '18 at 11:18