This type of Virtual Thing uses CSV as data source to publish metric values to a thing registered in a DPS.
Once a Virtual Thing has been created, and the CSV File has been selected, you can configure the information required for data publishing.
A Virtual Thing based on CSV is described by:
- Name: the name uniquely identifying the virtual thing in the console.
- Description: the text providing information about the purpose of the virtual thing.
- Target Thing: the thing in the current DPS where the data must be published.
- CSV File: the CSV containing the metric data you want to publish.
Se the CSV Data Structure section for more details. - Separator: the CSV separator char (default comma).
- Looping: if selected, data publishing restarts from the first row when the end of the CSV is reached.
- Default Metric Path: the default metric mapping path used to publish CSV data.
Additionally, you can specify the metricPath as the second column in the CSV.
CSV Data Structure
The CSV file must use the following sample data structure.
ts,temperature,humidity,active,status
1716971660000,22,67,true,HEATING
1716971210000,21,55,false,STANDBY
The CSV header must be the first row in the CSV and must contain these columns:
-
ts: represent the timestamp (milliseconds) associated with the data in the row.
The timestamp sequence must be increasing with at least 1s difference between each row.
Timestamps are used only for publication timing, based on the delta between rows. So the real timestamp is never used for publishing, which starts immediately when the Virtual Thing is started. - metricPath: the optional column you can use in case there are multiple metric mapping path to use. It is mandatory in case the Default Metric Path is left blank.
- <metric-data-column>: the column related to data of a single metric, it must be the metric mapping name.
Multiple metric columns can be added, and with each publication all row values are published in a single message.
TOPIC: <USERNAME>/<THING_ASSET_ID>/<METRIC_MAPPING_PATH>
PAYLOAD: { "timestamp": 1716971660000, "data": { "temperature": 22, "humidity": 67, "active": true, "status": "HEATING" } }
Limitations
- For each environment you can have at maximum of 10 RUNNING Virtual Things in parallel.
- In the CSV, you can provide at most 500 metric columns.
- In the CSV, you can provide at most 100000 rows.
- In the CSV, the timestamp sequence must be increasing with at minimum 1s difference between each row. This means that the maximum message publishing rate is 1 message/sec.
- The CSV can have a maximum size of 20 MB.
Comments
0 comments
Please sign in to leave a comment.