eclipse-archived/smarthome

[UoM] How to represent rainfall rate

mhilbush opened this issue · 3 comments

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

Will push a PR for this in openhab-core

Thanks for taking care of this!