[OpenTRV-dev] I just added this to the data sets doc...

Damon Hart-Davis dhd at exnet.com
Tue Jun 23 09:12:56 BST 2015


Hi Y’All,

Bruno and I were having a discussion yesterday afternoon about how properly to represent for *JSON* transmission values with units that can be automatically translated to SenML/UCUM units, that are easy for an MCU to generate (eg no floating point if possible), that remain human readable and reasonably compact, and that deal with values whose natural representation is with some power-of-2 multiplier to capture all the significant (binary) digits with minimal bloat in the decimal int expansion.

http://www.earth.org.uk/note-on-IoT-data-sets-and-processing.html#binshiftrep

Any thoughts?

Rgds

Damon


2015/06/22:
Bruno and Damon discussed the desirability of completely mechanical conversions
from JSON sensor units to UCUM/SenML units to minimise or eliminate magic
'mappings' that require sophisticated developer time (in line with IBM
suggestions).  One particular issue that cam eup is being able to represent
value as integers (for brevity and to keep code small on the sensors)
and scale to integers for transit, when the natural scaling is a power of two,
eg temperatures from common sensors with four significant bits after the binary
point, ie that are currently being sent with units <code>|C16</code> for
"Celsius times 16".  Bruno was going to investigate.  One possible escape
hatch is with the Ki/Mi/Gi/Ti "special prefix symbols for powers of 2".


More information about the OpenTRV-dev mailing list