Changing telemetry unit dynamically from device

Copper Contributor

Does IoT Central support dynamically changing the unit of a telemetry field by a device ? For example, I'm trying to simulate a temperature sensor that allows the user to change the temperature unit from Degree Celsius to Farenheit, or another hypothetical device that can send length measurements in millimeter, centimeter or in meter units. If the device is allowed to send the measurement unit along with the measurement value while sending telemetry, I could handle this in my application logic. Ideally, the unit change should be done once and all future measurements sent should be using the last updated measurement unit until it's changed again. Is such a use-case supported by IoT Central?

 

In all the examples that I've seen, the measurement unit is fixed in the device capability model. And I have not seen an API that allows the device to override this unit while sending a telemetry measurement. If this is allowed, how can I achieve this using the direct MQTT APIs? I'm not using any device SDKs at the moment. So, would like to know how I can include that unit value in the MQTT JSON payload itself.

1 Reply

@albin_sag A few thoughts here.

  • Dynamically changing the "unit" of a telemetry is not supported.
  • We're working to support data transformation "in app"... which would allow you to transform from F to C in the app, while preserving the original value.
  • And we're also working on a Query API which would allow a customer to query for data in Central, and retrieve back the unit.

Both should be available later this year and/or early next year.