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
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
meteringPointsPath | string | Yes | - | JSON path selecting the metering points in the data context, e.g. $.MeteringPoints[*] |
measurementsPath | string | Yes | - | JSON path of the measurements within one metering point, e.g. $.Measurements[*] |
headerMappings | array | Yes | - | Header rows; each entry has a label (first column) and a valuePath (value within the metering point) |
obisCodePath | string | Yes | - | Path of the OBIS code within one measurement; groups the measurements into time series |
timestampPath | string | Yes | - | Path of the timestamp within one measurement (interpreted as UTC if it has no offset) |
valuePath | string | Yes | - | Path of the value within one measurement |
separator | string | No | ; | Column separator |
dateTimeFormat | string | No | dd.MM.yyyy HH:mm | .NET format of the timestamp column |
timeZoneId | string | No | Europe/Vienna | Time zone (IANA id) the timestamps are converted to |
cultureName | string | No | de-DE | Culture for number and date formatting (e.g. comma as decimal separator) |
emptyRowsBetweenHeaderAndData | int | No | 2 | Number of empty rows between the header block and the data block |
dateTimeColumnLabel | string | No | Datum / Uhrzeit | Label of the first column in the data header row |
valueColumnLabel | string | No | Wert | Label of every value column in the data header row |
obisCodeLabel | string | No | OBIS Code | Label of the OBIS code header row |
targetPath | string | No | $ | Path where the CSV string is written |
CSV layout
- One row per entry of
headerMappings: the label, followed by the value atvaluePathof the metering point of every column. - The OBIS code row:
obisCodeLabel, followed by the OBIS code of every column. emptyRowsBetweenHeaderAndDataempty rows.- The data header row:
dateTimeColumnLabel, followed byvalueColumnLabelfor every column. - One data row per distinct timestamp (ascending), converted to
timeZoneIdand formatted withdateTimeFormat. Cells without a measurement for that timestamp stay empty; numbers are formatted withcultureName.
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.