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

#1

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?

0 Likes

(Martin Giger) #2

To quote what was posted on IRC after you quit:

0 Likes

(Ben Francis) #3

Thanks @freaktechnik,

Wikipedia also has a handy summary https://en.wikipedia.org/wiki/International_System_of_Units

0 Likes

#4

does SI realy leave out degree fahrenheit?

0 Likes

(Ben Francis) #5

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.

0 Likes

#6

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;
0 Likes

(Michael Stegeman) #7

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

0 Likes