Update Unit of Measurements with new Units from openhab-core (#1036)
* Update Unit of Measurements with new Units from openhab-core SmartHomeUnits class. Signed-off-by: Stewart Cossey <stewart.cossey@gmail.com> * Update UoM documentation to include binary prefixes and some additional tweaks. Add Binary Prefixes table. Change some unit text styling. Change prefix Value column to Factor. Tweak some formatting. Modify a sentence to mention BinaryPrefix. Signed-off-by: Stewart Cossey <stewart.cossey@gmail.com> * Add mm/h notation. Signed-off-by: Stewart Cossey <stewart.cossey@gmail.com>pull/1118/head
parent
de0794ee65
commit
fc2ae61a00
|
@ -70,7 +70,9 @@ The state description pattern "%.1f %unit%" describes the value format as floati
|
||||||
## Implementing UoM
|
## Implementing UoM
|
||||||
When creating QuantityType states the framework offers some useful packages and classes:
|
When creating QuantityType states the framework offers some useful packages and classes:
|
||||||
The `org.eclipse.smarthome.core.library.unit` package contains the classes `SIUnits`, `ImperialUnits` and `SmartHomeUnits` which provide units unique to either of the measurement systems and common units used in both systems.
|
The `org.eclipse.smarthome.core.library.unit` package contains the classes `SIUnits`, `ImperialUnits` and `SmartHomeUnits` which provide units unique to either of the measurement systems and common units used in both systems.
|
||||||
The `MetricPrefix` class provides prefixes like MILLI, CENTI, HECTO, etc. which are wrappers to create derived units.
|
|
||||||
|
The `MetricPrefix` class provides prefixes like MILLI, CENTI, HECTO, etc. and the `BinaryPrefix` class provides prefixes like KIBI, MEBI, etc. both of which are wrappers to create derived units.
|
||||||
|
|
||||||
The `org.eclipse.smarthome.core.library.dimension` and `javax.measure.quantity` packages provide interfaces which are used to type the generic QuantityType and units.
|
The `org.eclipse.smarthome.core.library.dimension` and `javax.measure.quantity` packages provide interfaces which are used to type the generic QuantityType and units.
|
||||||
|
|
||||||
## List of Units
|
## List of Units
|
||||||
|
@ -96,9 +98,11 @@ Imperial:
|
||||||
SI:
|
SI:
|
||||||
|
|
||||||
| Type | Unit | Symbol |
|
| Type | Unit | Symbol |
|
||||||
|------------------------|-------------------------|--------|
|
|------------------------|----------------------------------|--------|
|
||||||
| Acceleration | Metre per square Second | m/s² |
|
| Acceleration | Metre per square Second | m/s² |
|
||||||
|
| Acceleration | Standard Gravity | ɡₙ |
|
||||||
| AmountOfSubstance | Mole | mol |
|
| AmountOfSubstance | Mole | mol |
|
||||||
|
| AmountOfSubstance | Deutscher Härtegrad | °dH |
|
||||||
| Angle | Radian | rad |
|
| Angle | Radian | rad |
|
||||||
| Angle | Degree | ° |
|
| Angle | Degree | ° |
|
||||||
| Angle | Minute Angle | ' |
|
| Angle | Minute Angle | ' |
|
||||||
|
@ -106,6 +110,23 @@ SI:
|
||||||
| Area | Square Metre | m² |
|
| Area | Square Metre | m² |
|
||||||
| ArealDensity | Dobson Unit | DU |
|
| ArealDensity | Dobson Unit | DU |
|
||||||
| CatalyticActivity | Katal | kat |
|
| CatalyticActivity | Katal | kat |
|
||||||
|
| DataAmount | Bit | bit |
|
||||||
|
| DataAmount | Megabit | Mbit |
|
||||||
|
| DataAmount | Kilobit | kbit |
|
||||||
|
| DataAmount | Gigabit | Gbit |
|
||||||
|
| DataAmount | Terabit | Tbit |
|
||||||
|
| DataAmount | Byte | B |
|
||||||
|
| DataAmount | Octet | o |
|
||||||
|
| DataAmount | Kibioctet | Kio |
|
||||||
|
| DataAmount | Mebioctet | Mio |
|
||||||
|
| DataAmount | Gibioctet | Gio |
|
||||||
|
| DataTransferRate | Bit per Second | bit/s |
|
||||||
|
| DataTransferRate | Kilobit per Second | kbit/s |
|
||||||
|
| DataTransferRate | Megabit per Second | Mbit/s |
|
||||||
|
| DataTransferRate | Gigabit per Second | Gbit/s |
|
||||||
|
| DataTransferRate | Terabit per Second | Tbit/s |
|
||||||
|
| Density | Microgram per cubic Metre | µg/m³ |
|
||||||
|
| Density | Kilogram per cubic Metre | kg/m³ |
|
||||||
| Dimensionless | Percent | % |
|
| Dimensionless | Percent | % |
|
||||||
| Dimensionless | Parts per Million | ppm |
|
| Dimensionless | Parts per Million | ppm |
|
||||||
| Dimensionless | Decibel | dB |
|
| Dimensionless | Decibel | dB |
|
||||||
|
@ -119,11 +140,14 @@ SI:
|
||||||
| Energy | Joule | J |
|
| Energy | Joule | J |
|
||||||
| Energy | Watt Second | Ws |
|
| Energy | Watt Second | Ws |
|
||||||
| Energy | Watt Hour | Wh |
|
| Energy | Watt Hour | Wh |
|
||||||
| Energy | KiloWatt Hour | kWh |
|
| Energy | Kilowatt Hour | kWh |
|
||||||
|
| Energy | Megawatt Hour | MWh |
|
||||||
|
| Energy | Kilovar Hour | kvarh |
|
||||||
| Force | Newton | N |
|
| Force | Newton | N |
|
||||||
| Frequency | Hertz | Hz |
|
| Frequency | Hertz | Hz |
|
||||||
| Illuminance | Lux | lx |
|
| Illuminance | Lux | lx |
|
||||||
| Intensity | Irradiance | W/m² |
|
| Intensity | Irradiance | W/m² |
|
||||||
|
| Intensity | Microwatt per square Centimeter | µW/cm² |
|
||||||
| Length | Metre | m |
|
| Length | Metre | m |
|
||||||
| Length | Kilometre | km |
|
| Length | Kilometre | km |
|
||||||
| LuminousFlux | Lumen | lm |
|
| LuminousFlux | Lumen | lm |
|
||||||
|
@ -133,16 +157,19 @@ SI:
|
||||||
| Mass | Kilogram | kg |
|
| Mass | Kilogram | kg |
|
||||||
| Mass | Gram | g |
|
| Mass | Gram | g |
|
||||||
| Power | Watt | W |
|
| Power | Watt | W |
|
||||||
|
| Power | Kilovar | kvar |
|
||||||
|
| Power | Decibel-Milliwatts | dBm |
|
||||||
| Pressure | Pascal | Pa |
|
| Pressure | Pascal | Pa |
|
||||||
| Pressure | hectoPascal | hPa |
|
| Pressure | Hectopascal | hPa |
|
||||||
| Pressure | Millimetre of Mercury | mmHg |
|
| Pressure | Millimetre of Mercury | mmHg |
|
||||||
| Pressure | Bar | bar |
|
| Pressure | Bar | bar |
|
||||||
| Pressure | milliBar | mbar |
|
| Pressure | Millibar | mbar |
|
||||||
| Radioactivity | Becquerel | Bq |
|
| Radioactivity | Becquerel | Bq |
|
||||||
| RadiationDoseAbsorbed | Gray | Gy |
|
| RadiationDoseAbsorbed | Gray | Gy |
|
||||||
| RadiationDoseEffective | Sievert | Sv |
|
| RadiationDoseEffective | Sievert | Sv |
|
||||||
| SolidAngle | Steradian | sr |
|
| SolidAngle | Steradian | sr |
|
||||||
| Speed | Metre per Second | m/s |
|
| Speed | Metre per Second | m/s |
|
||||||
|
| Speed | Millimetre per Hour | mm/h |
|
||||||
| Speed | Kilometre per Hour | km/h |
|
| Speed | Kilometre per Hour | km/h |
|
||||||
| Speed | Knot | kn |
|
| Speed | Knot | kn |
|
||||||
| Temperature | Kelvin | K |
|
| Temperature | Kelvin | K |
|
||||||
|
@ -153,12 +180,17 @@ SI:
|
||||||
| Time | Day | d |
|
| Time | Day | d |
|
||||||
| Time | Week | week |
|
| Time | Week | week |
|
||||||
| Time | Year | y |
|
| Time | Year | y |
|
||||||
| Volume | Cubic Metre | m³ |
|
| Volume | Litre | l |
|
||||||
|
| VolumetricFlowRate | Litre per Minute | l/min |
|
||||||
|
| VolumetricFlowRate | Cubic Metre per Second | m³/s |
|
||||||
|
| VolumetricFlowRate | Cubic Metre per Minute | m³/min |
|
||||||
|
| VolumetricFlowRate | Cubic Metre per Hour | m³/h |
|
||||||
|
| VolumetricFlowRate | Cubic Metre per Day | m³/d |
|
||||||
|
|
||||||
Prefixes:
|
Metric Prefixes:
|
||||||
|
|
||||||
| Name | Symbol | Value |
|
| Name | Symbol | Factor |
|
||||||
|-------|--------|-------|
|
|-------|--------|--------|
|
||||||
| Yotta | Y | 10²⁴ |
|
| Yotta | Y | 10²⁴ |
|
||||||
| Zetta | Z | 10²¹ |
|
| Zetta | Z | 10²¹ |
|
||||||
| Exa | E | 10¹⁸ |
|
| Exa | E | 10¹⁸ |
|
||||||
|
@ -180,10 +212,21 @@ Prefixes:
|
||||||
| Zepto | z | 10⁻²¹ |
|
| Zepto | z | 10⁻²¹ |
|
||||||
| Yocto | y | 10⁻²⁴ |
|
| Yocto | y | 10⁻²⁴ |
|
||||||
|
|
||||||
|
Binary Prefixes:
|
||||||
|
|
||||||
To use the prefixes simply add the prefix to the unit symbol e.g.
|
| Name | Symbol | Factor |
|
||||||
|
| ---- | ------ | ------ |
|
||||||
|
| Kibi | Ki | 2¹⁰ |
|
||||||
|
| Mebi | Mi | 2²⁰ |
|
||||||
|
| Gibi | Gi | 2³⁰ |
|
||||||
|
| Tebi | Ti | 2⁴⁰ |
|
||||||
|
| Pebi | Pi | 2⁵⁰ |
|
||||||
|
| Exbi | Ei | 2⁶⁰ |
|
||||||
|
| Zebi | Zi | 2⁷⁰ |
|
||||||
|
| Yobi | Yi | 2⁸⁰ |
|
||||||
|
|
||||||
Examples:
|
To use the prefixes simply add the prefix to the unit symbol - for example:
|
||||||
-milliAmpere - `mA`
|
* milliAmpere - `mA`
|
||||||
-centiMetre - `cm`
|
* centiMetre - `cm`
|
||||||
-kiloWatt - `kW`
|
* kiloWatt - `kW`
|
||||||
|
* KibiByte - `KiB`
|
||||||
|
|
Loading…
Reference in New Issue