Converters#

Converters service provides bulk CSV ingestion by parsing uploaded CSV files and publishing their rows as platform messages. It is intended for batch import of historical or bulk-collected sensor data without requiring device-level publishing.

Two input formats are supported:

  • SenML — the first row is the header where column names become measurement names. The first column must be a Unix timestamp. All remaining columns are treated as numeric measurement values.
  • JSON — the file must include a created column containing the timestamp. All remaining columns become JSON field names. Values are auto-parsed as numbers where possible, otherwise treated as strings.

Large files are processed in batches of 50,000 records with a 30-second pause between batches to avoid overloading the message broker.

Authentication#

Authentication uses the Thing key in the Authorization header. The thing must have a valid profile with the appropriate content_type configured.

SenML CSV#

The first column must be a Unix timestamp. Subsequent columns are measurement names taken from the header row.

Example file (readings.csv):

time,voltage,current,power
1709635200,120.1,1.2,144.12
1709635260,119.8,1.3,155.74
curl -s -S -i -X POST \
  -H "Authorization: Thing <thing_key>" \
  -F "file=@readings.csv" \
  https://localhost/csv/senml

Each row is published as a SenML message with the column names as measurement names and the timestamp column as the base time. The example above produces two messages, each carrying voltage, current, and power measurements.

JSON CSV#

The file must include a created column with the timestamp. All other columns become JSON field names. String values that cannot be parsed as numbers are preserved as-is.

Example file (events.csv):

created,temperature,humidity,status
2024-03-05T08:00:00Z,21.5,60,ok
2024-03-05T08:05:00Z,22.1,58,ok
curl -s -S -i -X POST \
  -H "Authorization: Thing <thing_key>" \
  -F "file=@events.csv" \
  https://localhost/csv/json

Each row is published as a JSON message. The created field is used as the message timestamp. The remaining columns — temperature, humidity, and status — become fields in the JSON payload.

For the full API reference, see the API documentation.