---
title: "MQTT Client | Custom Payload Example | N3uron KB V1.22"
slug: "mqtt-client-custom-payload-example"
description: "MQTT Client is a N3uron module designed to connect to any MQTT broker in order to send and receive tag events. Mqtt Client implements a bidirectional…"
updated: 2025-09-30T15:55:31Z
published: 2025-12-23T10:03:05Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.n3uron.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Payload

## How to create a Custom Payload

Note:This feature is new in N3uron version **1.21.3**

**[Embedded content](https://www.youtube.com/embed/ynTZn2AMp5c?&amp;t=2s&amp;wmode=opaque&amp;rel=0)**

- **Step 1:** Create the module: *(*Config => Modules =>Model=> New module*)*

![Figure - New module(1)](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20-%20New%20module(1).png)

- **Step 2:**Provide a name for the module (in this case MQTTClient), assign the module type to MqttClient and save the new configuration.

![Figure MQTT - Creating a Module Instance](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20MQTT%20-%20Creating%20a%20Module%20Instance.png)

- **Step 3:** Configure the **Logger** and **API** sections (usually the default values are sufficient). Save the configuration.

![Figure MQTT - Logger](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20MQTT%20-%20Logger.png)

- **Step 4:** Create the connection to the MQTT Server. Each connection is an independent **MQTT****client**.

![Figure - New Connection](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20-%20New%20Connection.png)

- **Step 5:** Configure the **MQTT Client.** In this case, select version MQTT 5.

![Figure - Custom Payload Config](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20-%20Custom%20Payload%20Config.png)

- **Step 6:** Once configured, let's create a new**Publisher**. To do this, click on **Agents** and select ****New Publisher MQTT 5****.

![Figure - Custom Payload Config 2](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20-%20Custom%20Payload%20Config%202.png)

- **Step 7:** Now, select Custom in **Serialization**, to allow the creation of a Custom Payload.

![Figure - Example 3](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20-%20Example%203.png)

- **Step 8:** As we can see, when Custom is selected, the possibility to create the corresponding script is available. To do so, click on the button to the left of the **Script**field.

![Figure - MQTT Script](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20-%20MQTT%20Script.png)

- **Step 9:** The following figure shows an example of a script that can be used to parse events to the custom payload.

![Figure - Script(1)](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%20-%20Script(1).png)

[MQTT Client Full Product Details](https://n3uron.com/iiot-platform-modules/mqtt-client/)
