> For the complete documentation index, see [llms.txt](https://docs.kpnthings.com/kpn-things/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpnthings.com/kpn-things/the-portal-explained/things-creator/device-types-and-decoders.md).

# Device Types & Decoders

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.

{% hint style="info" %}
You can only create decoders for your own custom device types. Ensure you have completed Step 1 before proceeding.
{% endhint %}

#### 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*](/kpn-things/building-blocks/data-processing/decoders-and-encoders/diy-decoder/diy-decoder-scripts.md)*.*

#### 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.

{% hint style="info" %}
**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.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kpnthings.com/kpn-things/the-portal-explained/things-creator/device-types-and-decoders.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
