Page 1 of 1

different API use different temperature units

Posted: 25 May 2016 18:57
by silverhack
I have noticed that the ZWave API uses the correct device temperature units (Fahrenheit)
http://raspberrypi:8083/ZWaveAPI/Run/de ... int.data[2]

Code: Select all

{
"invalidateTime": 1464037718,
"updateTime": 1464037719,
"type": "empty",
"value": null,
"val": {
"invalidateTime": 1464037718,
"updateTime": 1464037719,
"type": "float",
"value": 74
},
"scale": {
"invalidateTime": 1464037719,
"updateTime": 1463975399,
"type": "int",
"value": 1
},
"scaleString": {
"invalidateTime": 1464037719,
"updateTime": 1463975399,
"type": "string",
"value": "°F"
},
"setVal": {
"invalidateTime": 1464037718,
"updateTime": 1464037719,
"type": "float",
"value": 74
},
"modeName": {
"invalidateTime": 1464037719,
"updateTime": 1463975399,
"type": "string",
"value": "Cooling"
},
"deviceScale": {
"invalidateTime": 1464037718,
"updateTime": 1464037719,
"type": "int",
"value": 1
},
"deviceScaleString": {
"invalidateTime": 1464037718,
"updateTime": 1464037719,
"type": "string",
"value": "°F"
}
}
But the Virtual Device API shows incorrect units and max/min levels. However, the value is correct (74 degrees Fahrenheit)
http://raspberrypi:8083/ZAutomation/api ... _16-0-67-2

Code: Select all

{
"data": {
"creationTime": 1463861533,
"creatorId": 1,
"deviceType": "thermostat",
"h": -523218228,
"hasHistory": false,
"id": "ZWayVDev_zway_16-0-67-2",
"location": 6,
"metrics": {
"scaleTitle": "°C",
"level": 74,
"min": 5,
"max": 40,
"icon": "thermostat",
"title": "Thermostat Cool Temp"
},
"permanently_hidden": false,
"probeType": "",
"tags": [],
"visibility": true,
"updateTime": 1464185195
},
"code": 200,
"message": "200 OK",
"error": null
}
Is this on purpose? Or is that a problem with the virtual device API that is being fixed?
Does this API require Celsius, and automatically convert to Fahrenheit based on the device's unitScale?