Registering Devices in Batch


You can batch create devices of the same product by using this feature via one of the following methods.

  • Download a blank template, fill in the device information, and upload the template to create devices in batch.

  • Generate a template based on an existing device, fill in the device information, and upload it to create devices in batch.

Before You Start

Procedure

  1. Select Device Management > Device Assets.

  2. Select Batch Import and select the product the devices belong to.

  3. Select one of the following methods to download the template.

    • Download an empty template: select this option then click Empty template(.xlsx) to download an empty template.

    • Generate template from existing device: If the devices to be created have similar attributes with an existing device, select this option and choose a device from the drop-down list. Click Template (.xlsx) to download a template based on this device.

    Note

    The downloaded template is named as "Template_product_key.xlsx", where product_key refers to the product key of the product the device belongs to, which can be found in Device Management > Products.

    ../../_images/device_batch_import.png
  4. Fill in the template with the device attributes in the required format. The template contains the following fixed fields.

    Field

    Description

    AssetId

    There is no need to fill in this field as it will be auto-generated (and overwritten) by the system.

    DeviceKey

    The device key. It is recommended that you use the SN, IMEI, or MAC address as the device key. Supports upper case and lower case lettters, numbers, hyphen (-), underline (*), period (.) and colon (:). 4-64 characters. The DeviceKey must be unique within an OU.

    Device Name (Default)

    The name which is used to search for devices in the device list. Supports Chinese characters, upper case and lower case letters, numbers, hyphen (-), underline (*), period (.) and colon (:). No more than 64 characters.

    Device Name (English)

    The device name that will appear for the English environment.

    Device Name (Chinese)

    The device name that will appear for the Chinese environment.

    Time Zone

    Refers to the time zone where the device is located. If the DST is used in this zone, you should select the cities to which DST applies in the drop-down list.

    Description

    The description of the device.


    Other fields in the template include the tags and attributes of the device. The attribute name, data type, and whether the field is required are all inherited from the model that the device belongs to.


    The template generated from the existing device includes the same fixed fields as a blank template. Delete the existing device before entering new device information. The following sample is a template generated from an existing device.

    ../../_images/batch_import_device_sample_template.png


  5. Click Upload File to browse and select the completed template and upload it. The template to be uploaded must meet the following requirements.

    • The format must be in .xlsx.

    • The file size should not be more than 2M.

    • A maximum of 1,000 records are supported in one template file. If you need to upload more than 1,000 device records, split the device records into multiple template files and upload them one at a time.

    • The number of the devices under one product should not exceed 10, and the number of the devices in the list plus the device records in the template should not exceed 100,000. Otherwise a prompt saying that the upper limit is reached will be displayed.

  6. Click OK, and EnOS will parse the template.

Results

  • If any invalid record is included in the template, you can select Export Invalid Records to download a .txt file named errmsg.txt. The file contains records in the format of “Line n: error_message“, where n refers to the line where the invalid record is located, and error_message refers to the error. Common errors include:

    • The data format is illegal or its length exceeds the limit.

    • There is no data in one or more of the required fields.

    • The DeviceKey is not unique.


  • If the template has valid records, you can click Import to import these records into EnOS and view the batch imported devices in the device list.

Next Steps

To store the telemetry data in EnOS TSDB, you will need to configure the TSDB policy before activating the device. Otherwise, the data sent from the device will not be stored in TSDB by default. For more information, see Configuring TSDB Storage.


Any devices not connected to EnOS will be tagged as “not activated”. If you wish to activate these devices, you need establish connection by using the client SDK. For more information, see Using EnOS Device SDKs.