unitsofmeasurement / uom-systems

Units of Measurement Systems
http://www.uom.systems
Other
36 stars 17 forks source link

[Q] Virtual/Boolean Units #131

Open michelkaeser opened 5 years ago

michelkaeser commented 5 years ago

Hi all

I am currently evaluating concepts to represent measured sensor data and I came across JSR-385 which seems to address most topics. Great stuff!

As mentioned in the title, I am however struggling to find how (virtual) boolean data can/should be represented (https://github.com/unitsofmeasurement/uom-systems/issues/115#issuecomment-325332678). Virtual values in general seem to be undefined, but I would have gone with annotated units where possible (i.e. phone battery level = Units.PERCENT annotated with battery_level (or the like)).

Played around with the DimensionLess AbstractUnit.ONE and transforming 0 to false and 1 to true, but I wasn't able to get a working POC.

Possible virtual boolean sensors:

How would one represent such values?

keilw commented 5 years ago

@htreu, @kaikreuzer, do you have any suggestions for that based on SmartHome?