How to find thing 'property' - 'unit' text

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

does SI realy leave out degree fahrenheit?

Yes, I’m afraid most of the world moved on from fahrenheit last century :slight_smile: 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.

1 Like

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;

@Novski Kelvin, Celsius, and Fahrenheit are already in the code you just posted :smiley:

Yes but the documentation or specificaiton referes to the SI list which is not appropriate.

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).

Maybe this should just be updated and linked: https://iot.mozilla.org/schemas/#properties

@benfrancis What’s the best place where we could note resources for units?

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/

1 Like

huh! just saw that iot.mozilla.org got an update and docs are linked there verry nicely! good work!

i know this is a little late… property.unit=“°F”;