Azure / opendigitaltwins-dtdl

Digital Twins Definition Language
Creative Commons Attribution 4.0 International
470 stars 160 forks source link

What about unit conversions? #47

Closed iotblackbelt closed 4 years ago

iotblackbelt commented 4 years ago

What if the data that comes in is not the actual data it represents and needs conversion/kalibration? Would it be possible to include this in the plug and play definition? F.i, "temperature" can be represented in Fahrenheid, Celcius or Kelvin:

        {
            "@type": "Telemetry",
            "name": "temp",
            "displayName": "Measured temp",
            "schema": "double",
            "displayUnit": "F" ? "C" ? "K" ?...
        }

This requires conversion between units. You could even see data coming in as "voltage", but actually meaning "temperature" or "resistance" or something else. Will simple unit conversion be part of PnP?

briancr-ms commented 4 years ago

In an upcoming update, look for clarification and improvements in the unit property and Unit type. We expect the modeling language to be able to provide enough information for a component or service to provide some conversation or normalization operations. I'll be interested to hear your feedback.