Skip to main content

ExportMeasurementsToCsv@1

Node ExportMeasurementsToCsv@1 exports the measurements of a set of metering points into a CSV text. Every metering point produces one column per distinct OBIS code (time series); the rows are the timestamps of all time series. The CSV string is written to targetPath and can, for example, be attached to an e-mail.

Adapter Prerequisites​

Node Configuration​

For fields path, targetPath, targetValueWriteMode, and targetValueKind, see Overview.

transformations:
- type: ExportMeasurementsToCsv@1
meteringPointsPath: $.MeteringPoints[*] # metering points
measurementsPath: $.Measurements[*] # measurements within one metering point
obisCodePath: $.Values[1] # OBIS code within one measurement
timestampPath: $.Values[3] # timestamp within one measurement
valuePath: $.Values[4] # value within one measurement
headerMappings: # one header row per entry
- label: Zählpunkt
valuePath: $.Values[0]
- label: Objekt
valuePath: $.Values[1]
separator: ";"
dateTimeFormat: dd.MM.yyyy HH:mm
timeZoneId: Europe/Vienna
cultureName: de-DE
targetPath: $.csv
PropertyTypeRequiredDefaultDescription
meteringPointsPathstringYes-JSON path selecting the metering points in the data context, e.g. $.MeteringPoints[*]
measurementsPathstringYes-JSON path of the measurements within one metering point, e.g. $.Measurements[*]
headerMappingsarrayYes-Header rows; each entry has a label (first column) and a valuePath (value within the metering point)
obisCodePathstringYes-Path of the OBIS code within one measurement; groups the measurements into time series
timestampPathstringYes-Path of the timestamp within one measurement (interpreted as UTC if it has no offset)
valuePathstringYes-Path of the value within one measurement
separatorstringNo;Column separator
dateTimeFormatstringNodd.MM.yyyy HH:mm.NET format of the timestamp column
timeZoneIdstringNoEurope/ViennaTime zone (IANA id) the timestamps are converted to
cultureNamestringNode-DECulture for number and date formatting (e.g. comma as decimal separator)
emptyRowsBetweenHeaderAndDataintNo2Number of empty rows between the header block and the data block
dateTimeColumnLabelstringNoDatum / UhrzeitLabel of the first column in the data header row
valueColumnLabelstringNoWertLabel of every value column in the data header row
obisCodeLabelstringNoOBIS CodeLabel of the OBIS code header row
targetPathstringNo$Path where the CSV string is written

CSV layout​

  1. One row per entry of headerMappings: the label, followed by the value at valuePath of the metering point of every column.
  2. The OBIS code row: obisCodeLabel, followed by the OBIS code of every column.
  3. emptyRowsBetweenHeaderAndData empty rows.
  4. The data header row: dateTimeColumnLabel, followed by valueColumnLabel for every column.
  5. One data row per distinct timestamp (ascending), converted to timeZoneId and formatted with dateTimeFormat. Cells without a measurement for that timestamp stay empty; numbers are formatted with cultureName.

Behavior​

  • If the data context is empty, no metering points are found or no metering point has measurements, the node logs a message and writes nothing.
  • If several measurements of one time series have the same timestamp, only the first is used.

The configuration properties are documented in the API reference.