eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 787 forks source link

[UoM] How to represent rainfall rate #6846

Closed mhilbush closed 5 years ago

mhilbush commented 5 years ago

Weather stations report rainfall rate, which is a measure of the rain's intensity. The rainfall rate has units of mm/hour or inches/hour. Examples would be 0.20 in/hr or 5.0 mm/hr.

How should this be represented? Should this be added as another Unit for Speed?

For example

    public static final Unit<Speed> INCHES_PER_HOUR = addUnit(
            new TransformedUnit<>("in/hr", MILES_PER_HOUR, new RationalConverter(1l, 63360l)));

and

    public static final Unit<Speed> MILLIMETRE_PER_HOUR = addUnit(
            new TransformedUnit<>("mm/hr", KILOMETER_PER_HOUR, new RationalConverter(1l, 1000000l)));
clinique commented 5 years ago

Will push a PR for this in openhab-core

mhilbush commented 5 years ago

Thanks for taking care of this!

maggu2810 commented 5 years ago

See openhab/openhab-core#588