The multiple-webthing property unit is textual and linked to a SI list that’s not clear to me.
I found a person using ‘celsius’ as temperature unit in this forum but i can’t understand where that textual description comes from.
Is there somewhere a more precise list of terms to use online or am I overlooking something?
To quote what was posted on IRC after you quit:
Thanks @freaktechnik,
Wikipedia also has a handy summary https://en.wikipedia.org/wiki/International_System_of_Units
Yes, I’m afraid most of the world moved on from fahrenheit last century But luckily it’s easy to convert.
We intend for there to eventually be a setting in the Things Gateway front end for users to express their preference, along with timezone and other options. But at the API level you should try to use SI units where possible.
SI wold be Kelvin what does not make any sense for real world usage. Kelvin is used for Industrial and Scientific things. Do you plan to implement a conversion?
I got a PM from @freaktechnik with this list:
case 'volt':
case 'volts':
return 'V';
case 'hertz':
return 'Hz';
case 'amp':
case 'amps':
case 'ampere':
case 'amperes':
return 'A';
case 'watt':
case 'watts':
return 'W';
case 'kilowatt hour':
case 'kilowatt-hour':
case 'kilowatt hours':
case 'kilowatt-hours':
return 'kW⋅h';
case 'percent':
return '%';
case 'degree fahrenheit':
case 'degrees fahrenheit':
case 'fahrenheit':
return '°F';
case 'degree celsius':
case 'degrees celsius':
case 'celsius':
return '°C';
case 'kelvin':
return 'K';
case 'meter':
case 'meters':
case 'metre':
case 'metres':
return 'm';
case 'day':
case 'days':
return 'd';
case 'hour':
case 'hours':
return 'h';
case 'minute':
case 'minutes':
return 'min';
case 'second':
case 'seconds':
return 's';
case 'millisecond':
case 'milliseconds':
return 'ms';
default:
return unit;
Maybe this list would be better to look at. It includes SI derived units, many of which we also use (like Volt, Watt, and degree Celsius).
Currently the standard is formally referenced under Normative references in the Web Thing API specification.
We could link to more informal (and user friendly!) sources in our online documentation https://iot.mozilla.org/docs/