Device Types & Decoders

Learn how to create custom device types, write payload decoders, and activate them within your data flows.

If your IoT devices are not supported by KPN Things out of the box, you can easily integrate them by defining a custom Device Type and creating a Decoder to parse their incoming payloads.

Step 1: Manage Custom Device Types

Create a New Device Type

  1. From the Things Creator menu, click All Device Types.

  2. Click Add new Device Type.

  3. Fill in the required details, such as Name, Description, and any specific properties.

  4. Click Add Device Type to save.

Once created, this custom device type will immediately become available in the Things Manager when adding new devices to your projects.

Edit or Delete a Device Type

If you need to make changes, navigate to All Device Types, select the device type from the list, and click Edit or Delete on its details page.

Step 2: Create and Test a Decoder

Decoders translate raw, device-specific payload data into a structured format. You can create multiple decoders for a single device type.

You can only create decoders for your own custom device types. Ensure you have completed Step 1 before proceeding.

Create a New Decoder

  1. From the Things Creator menu, click All Decoders.

  2. Click Add new Decoder.

  3. Select your custom device type from the drop-down menu.

  4. Enter a Name and Description for the decoder, then click Add Decoder.

Write and Test the Decoder Script

  1. On the decoder details page, locate the Script section and click Create.

  2. Write your JavaScript parsing logic in the provided editor.

  3. To test your script, use the built-in test payload section. You can use the provided sample payloads or paste your own raw device payload.

  4. Click Run script with test payload to review the output and logs.

  5. Once your script is validating data correctly, click Save.

For advanced guidance on writing decoder logic, please refer to the DIY Decoder Scripts Documentation.

Edit or Delete a Decoder Script

To update a script, open the decoder's details page and click Edit. Make your adjustments and click Save. If you wish to remove the script entirely, click Delete within the edit dialog.

Step 3: Activate the Decoder in Your Flow

After creating your device type and writing its decoder, you must activate the decoder within your project's data flow using the Things Manager application.

  1. Open the Things Manager and navigate to your project.

  2. Select the specific Flow where your custom devices are active.

  3. Click on Data Processing.

  4. Locate your custom device type in the list and toggle on the decoder you wish to use.

Tip: If you realize you need a new decoder while configuring your flow, you can click Add new Decoder directly from this screen to jump back into Things Creator.

Last updated

Was this helpful?