SMXCore / SMXCore_NG

Open Source for Smart Meter eXtension developed in H2020 Nobel Grid project and improved in various other projects
GNU General Public License v3.0
8 stars 5 forks source link

Self description of units for measures. #5

Closed beaylott closed 1 year ago

beaylott commented 7 years ago

Currently the facility does not exist to communicate the units/scaling of measures as specified by the meter communication or as specified in DataSet1.txt.

MihSand commented 6 years ago

In order to obtain both value and unit, and eventually also the timestamp of the last value refresh, it can be requested through MQTT messaging to be sent three different topics and merge the received data at the arrival, thus having finally complete information: value, unit and timestamp.

The problem which remains is that the two (three) or more values for the 2 (3) or more topics are not guaranteed to be simultaneous (synchronous). This is especially valid when we want to correlate value and timestamp or different values, such as the 3 x voltages or 3x powers in a 3-phased system.

For coping with this requirement the MQTT client module can now publish JSON (structured) messages. This raised aspect was in fact one of the reasons for requesting JSON values (instead of granular values), then it is possible to send in the same time a vector with a format with the following content: [value, unit, timestamp].

What still remains for further discussion is if the "unit" can be seen as "metadata", thus not needing to be sent each time is sent a value, but eventually only on request, during some initialization. A concept for sending "metadata" need to be discussed and agreed for further MQTT client developments. This can be included in a future feature based on an event-oriented publish messaging, as an add to the existing periodical MQTT publishing.

beaylott commented 6 years ago

If the data model is orientated around OBIS and units are out of scope then I guess they must be meta-data... or is there a '-X' field for units in OBIS? It sounds like moving to JSON will solve this.