Registering Devices in Batch


Use this feature to create a large number of devices of the same product.

Task description

When you have a large number of devices of the same product to create, you can create them in batch 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

Ensure the product that the devices belong to exists in EnOS. For information about how to create a product, see Creating a Product.

Procedure

  1. Select Device Management > Devices.

  2. Select Batch Import and select the product that 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 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 according to device key 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 that 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
    DeviceKey The device key. It is recommended to use the SN, IMEI or MAC address as the device key. Supports uppercase and lowercase alphabets, numbers, hyphen (-), underscore (_), period (.) and colon (:). The length should be 4 - 64 characters. The DeviceKey must be unique within an OU.
    Device Name The name is used to search for devices in the device list. Supports Chinese characters, uppercase and lowercase alphabets, numbers, hyphen (-), underscore (_), period (.) and colon (:). No more than 64 characters.
    Time Zone Refers to the time zone where the device is located. If the DST is used in this location, you should select the city to which DST is applicable from the drop-down list.

    Other fields in the template include attributes of the device. The attribute name, data type, and whether the field is mandatory 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. The attributes of the existing device are in the third row of the template (.xlsx). You need to delete the existing device information 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 is displayed to indicate that the upper limit is reached and adding device cannot be continued.
  6. Click OK, and EnOS will parse the template.

Results

Check the result of importing:

  • 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 mandatory 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 data uploaded by the device in TSDB for subsequent data analysis, you need to configure TSDB storage.