API units and values conversion

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
Post Reply
gulivert
Posts: 16
Joined: 20 Apr 2018, 09:39

API units and values conversion

Post by gulivert » 09 Feb 2020, 10:08

Hi there,

This is a surprise for me but it seems that the Netatmo API does not handle the values conversion in its result according to the units user settings ?
Does that mean I have to convert my self the values result.
This is not clear for me but what I can tell is the following:

If I use the unit with °C for temperature and km/h for wind speed I have this API result :
External module

Code: Select all

"dashboard_data": {
"Temperature": 14.4,
"Humidity": 53,
"min_temp": 0.4,
"max_temp": 14.4,
"date_max_temp": 1581238480,
"date_min_temp": 1581212081,
"temp_trend": "up"
}
Wind module

Code: Select all

"dashboard_data": {
"WindStrength": 6,
"WindAngle": 214,
"GustStrength": 10,
"GustAngle": 233,
"max_wind_str": 16,
"max_wind_angle": 75,
"date_max_wind_str": 1581234844
}
And unit settings return by the API

Code: Select all

"unit": 0,
"windunit": 0,
"pressureunit": 0,
"feel_like_algo": 0
Now if I change my units settings to US °F /inch and m/s for wind

Code: Select all

"dashboard_data": {
"Temperature": 14.4,
"Humidity": 53,
"min_temp": 0.4,
"max_temp": 14.4,
"date_max_temp": 1581238480,
"date_min_temp": 1581212081,
"temp_trend": "up"
}
Wind module

Code: Select all

"dashboard_data": {
"WindStrength": 6,
"WindAngle": 214,
"GustStrength": 10,
"GustAngle": 233,
"max_wind_str": 16,
"max_wind_angle": 75,
"date_max_wind_str": 1581234844
}
And unit settings return by the API

Code: Select all

"unit": 1,
"windunit": 2,
"pressureunit": 0,
"feel_like_algo": 0
Only the user units change but the values remain the same ! :shock:
Is there any explanation point to that in the reference documentation ?

gulivert
Posts: 16
Joined: 20 Apr 2018, 09:39

Re: API units and values conversion

Post by gulivert » 13 Feb 2020, 19:12

@Netatmo, could you please give me an answer, is it a bug from your side ?

Céline
Posts: 48
Joined: 20 Nov 2017, 18:17

Re: API units and values conversion

Post by Céline » 17 Feb 2020, 16:57

Hi Gulivert,

The user settings are there to inform you of the user preference. The data are not converted by the backend but by the user interface.
Céline - Netatmo Team :D

Post Reply

Return to “Netatmo API”