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

# MQTT

### Required Parameters

To add an MQTT device, the following parameters are required.

<ParamField path="id" type="string" required>
  A unique identifier for the device.

  **Example:** `aculink_meter`
</ParamField>

<ParamField path="type" type="string" required>
  Indicates the type of device. For this type of device, it is always `other`.

  **Example:** `other`
</ParamField>

<ParamField path="protocol" type="string" required>
  The communication protocol between the controller and the device. For this type of device, it will always be `MQTT`.

  **Example:** `MQTT`
</ParamField>

<ParamField path="addressMap" type="string" required>
  The name of the device’s address map on the controller.

  **Example:** `aculink_meter_address_map`
</ParamField>

<ParamField path="disabled" type="bool" required>
  Indicates whether the device is enabled or disabled. A value of true means the device is disabled, while false means the device is enabled.
</ParamField>

<ParamField path="topic" type="string" required>
  The MQTT topic of the device to which the controller will subscribe.

  **Example:** `DCMG_meter`
</ParamField>

### Optional Parameters

The following parameters can be added to MQTT devices; however, they are optional and not required. These parameters provide additional functionality to the device.

<ParamField path="forward" type="dict">
  This parameter lists the registers to forward to another device.

  **Example:**

  ```json icon="code" theme={null}
  {
    "forward": {
      "register1": "device2.register1",
      "register2": "device2.register2"
    }
  }
  ```
</ParamField>

### Example

The snippet below demonstrates two different MQTT devices, highlighting both the required and optional parameters.

```json icon="code" theme={null}
{
  "id": "aculink_meter",
  "type": "other",
  "protocol": "MQTT",
  "addressMap": "aculink_meter_address_map",
  "disabled": false,
  "topic": "DCMG_meter",
  "forward": {
    "measure.voltage": "battery1_precharge.control.voltage"
  }
}
```
