Open kwilcox opened 2 years ago
Perfect...I will look into that and make the changes. I knew there was a more standard way to do it, I just didn't know what that standard was which leads to me just making things up as I go along. Heh.
I made the changes to the metadata. For now, I've left out the extra type information for the attributes. If you see a need for it, let me know and I can add
I started using this metadata
format in the register-thing
app and updated mock_sensor
to output a data
field (the data) and metadata
field in NCO-JSON.
I suggest using the NCO-JSON[1][2][3] format for passing any JSON-based metadata around in the MQTT topics. It is very close to what the
Payload: Data with metadata
already defines and will allow us to standardize on the tools used to interpret and apply the metadata elsewhere.[1] https://www.essoar.org/doi/abs/10.1002/essoar.10500689.1 [2] http://nco.sourceforge.net/nco.html#json [3] https://github.com/cf-json/cf-json.github.io/issues/10
For example:
in NCO-JSON would be
NCO-JSON can also serialize the "type" of the attributes so they can be represented in JSON and then decoded back to the correct type. This is useful for "type aware" attributes like
_FillValue
,missing_value
,scale_factor
add_offset
, etc.