Star

ThingsBoard Documentation

Documentation for using ThingsBoard IoT Platform.

Bulk Provisioning

Bulk Provisioning Overview

ThingsBoard provides the option of bulk provisioning using the CSV file for the following types of entities:

Different entities may have the following parameters:

Import Entities

To create multiple entities at one time, you need to create a CSV file, where each line will be responsible for creating one entity with given parameters.
If you don’t need to add some settings for a particular entity, leave this cell empty.
There are three reserved parameters names: Name, Type and Label that have a predefined column type.

Step 1: Select a file

Upload a CSV file to the system.

Step 2: Import configuration

For the uploaded file you need to configure the following parameters::

Step 3: Select columns type

At this step, you need to define a match between the columns of the downloaded file and the type of data in the ThingsBoard platform. You can also set/change the default name for attribute/telemetry key.

Step 4: Creating new entities

Processing input data.

Step 5: Done

The result of the query execution: the number of created/updated entities and the number of errors that occurred during execution.

Use case

Let’s suppose we want to create at the same time 10 devices and give them an access token.

Sample file:

resources/test-import-device.csv
name,type,Data1,Data2,Data3,Data4,Data5,Data6,Data7,Data8,Data9,Data10
Device 1,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF45
Device 2,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF46
Device 3,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF47
Device 4,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF48
Device 5,testImport,123,,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF49
Device 6,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF50
Device 7,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF51
Device 8,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF52
Device 9,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF53
Device 10,testImport,123,test,TRUE,FALSE,123.55,test,test,test,test,AbfdgrRetGF54

Note: file should contain at least two columns: entity name and type.


File was created using the CSV file editor, it contains data for 10 devices. Also, the Data2 parameter was omitted for Device 5, it will not be created for this device.

Upload file

Go to Devices -> Import device

Upload sample file: test-import-device.csv

image

Import configuration

image

Select columns type

The first column of the table displays the first file line that contains data.
Since the First line contains column names checkbox has been set on the previous step, values for the third column have already been initiated based on the first line of the document.
Let’s change some of the attributes. Change the column type in the third row to Timeseries and set the attribute/telemetry key value, for example, Temperature.
The last row in the following table is responsible for the token so change Server attribute to Access token.

image
Note: such column types as Name, Type and Access token can be selected only for one row.

Import finished

After the creation process was completed, some statistics information will be shown.
On the following example, we can see that 8 devices were created successfully, and an error occurred while creating 2 devices. The reason is that Device 1, Device 2 and Device 3 have the same token in the given sample file. ThingsBoard system prohibits that.

image