Converting Templates

Command-line interface only

The instructions below use the command-line interface (CLI).

You can convert data in various formats to device templates using formats supported by The Things Stack. Input formats can be vendor-specific information about devices or device data to migrate from another LoRaWAN server stack.

Start with listing the supported formats:

$ ttn-lw-cli end-device template list-formats

This gives the supported formats. For example:

{
  "formats": {
    "microchip-atecc608a-mahtn-t": {
      "name": "Microchip ATECC608A-MAHTN-T Manifest File",
      "description": "JSON manifest file received through Microchip Purchasing \u0026 Client Services."
    }
  }
}

Given input data, you can use the end-device template from-data command to get the device template using the specified formatter.

Example

This example uses a Microchip ATECC608A-MAHTN-T Manifest File. This file contains provisioning data for The Things Industries Join Server. You can download the example file.

$ ttn-lw-cli end-device template from-data microchip-atecc608a-mahtn-t --local-file example.json

Output:

{
  "end_device": {
    // ...
    "provisioner_id": "microchip",
    "provisioning_data": {
        "distributor": {
              "organizationName": "Microchip Technology Inc",
              "organizationalUnitName": "Microchip Direct"
            },
        "groupId": "J2D3YNT8Y8WJDC27",
        "manufacturer": {
              "organizationName": "Microchip Technology Inc",
              "organizationalUnitName": "Secure Products Group"
            },
        "model": "ATECC608A",
        // ...
      }
  },
  "field_mask": {
    "paths": [
      "provisioner_id",
      "provisioning_data"
    ]
  },
  "mapping_key": "0123d34fb176c66f27"
}

In this example, only the provisioner_id and provisioning_data fields are set with the mapping_key set to the serial number. Device makers can use the template to assign the JoinEUI and DevEUIs (see Assigning EUIs) as well as other device fields (see Creating and Mapping Templates).