> For the complete documentation index, see [llms.txt](https://docs.brewtools.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brewtools.com/fcs/custom-mqtt-guide.md).

# Custom MQTT Guide

## Introduction

The FCS custom MQTT integration works with Home Assistant (HA).

Enter your Home Assistant MQTT broker credentials in FCS. Home Assistant then detects and configures FCS automatically.

You can also use another MQTT broker with Node-RED or a custom application.

{% hint style="danger" %}
If you decide to use a custom MQTT broker, you will not be able to use [brewtools.cloud](https://brewtools.cloud/) simultaneously.&#x20;
{% endhint %}

### Before you start

1. Connect FCS to your network.
2. Configure an MQTT broker and create credentials for FCS.
3. Enter the broker credentials in FCS.

Use the same broker for Home Assistant and FCS. Home Assistant must have MQTT configured.

## Typical MQTT JSON payload from FCS Fermentation

FCS publishes device data to `fcs-fermentation/<mcu_id>/state`.

The following example uses a standard 24V, 2A setup. It has one temperature sensor and one pressure sensor. Connected density and level sensors add their related fields.

Subscribe to `fcs-fermentation/#` to find your mcu ID. Then subscribe to its state topic. For example:

```
fcs-fermentation/20414116222657176/state
```

{% hint style="warning" %}
All MQTT values use fixed units: temperature uses Celsius, pressure uses bar, density uses SG, volume uses liters and AC/DC current uses ampere.
{% endhint %}

```json
{
  "mcu_id": "20414116222657176",
  "temperature_1": 25.109434127807617,
  "temperature_2": null,
  "temperature_selected_sensor_value": 25.109434127807617,
  "temperature_setpoint": 50,
  "current_total": 0.15119613707065582,
  "current_display": 0.10309077054262161,
  "current_relay_1": 0.00043160573113709688,
  "current_relay_2": 0.00043160573113709688,
  "current_can_1": 0.01646907813847065,
  "current_can_2": 0.000896490819286555,
  "state_relay_1": 0,
  "state_relay_2": 0,
  "state_can_1": 1,
  "state_can_2": 1,
  "pressure": 0.0013385240454226732,
  "pressure_setpoint": 0,
  "current_relay_3": 0.00043160573113709688,
  "current_relay_4": 0.00043160573113709688,
  "current_can_3": 0.000896490819286555,
  "current_can_4": 0.000894834694918245,
  "state_relay_3": 0,
  "state_relay_4": 0,
  "state_can_3": 1,
  "state_can_4": 1,
  "external_relay_state": 0,
  "current_acc_1": 0,
  "current_acc_2": 0
}
```

### Payload fields

| Field                                                  | Description                                                                                  |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| `mcu_id`                                               | Unique FCS mcu ID.                                                                           |
| `temperature_1`, `temperature_2`                       | Temperature sensor readings in Celsius. A disconnected or unavailable sensor returns `null`. |
| `temperature_selected_sensor_value`                    | Temperature used by the control system in Celsius.                                           |
| `temperature_setpoint`                                 | Configured temperature target in Celsius.                                                    |
| `pressure`                                             | Measured pressure in bar.                                                                    |
| `pressure_setpoint`                                    | Configured pressure target in bar.                                                           |
| `current_total`, `current_display`                     | Total system and display current readings in ampere.                                         |
| `current_relay_*`, `current_can_*`                     | Current readings for relay and CAN connections in ampere.                                    |
| `current_acc_*`                                        | AC current readings in ampere.                                                               |
| `state_relay_*`, `state_can_*`, `external_relay_state` | State values for relay, CAN, and external relay connections.                                 |

Connected hardware determines which fields appear in the payload. Handle missing fields and `null` values in custom integrations.

## Updating Control System Setpoints

Publish a numeric payload to update a control system setpoint:

* `fcs-fermentation/<mcu_id>/set/temperature_setpoint`
* `fcs-fermentation/<mcu_id>/set/pressure_setpoint`

FCS enforces the allowed ranges. Subscribe to `fcs-fermentation/<mcu_id>/state` to confirm the updated value.

### Example payloads

Temperature: `0–85 °C` (`32–185 °F`)

```
18
```

Pressure: `0–2 bar` (`0–29 psi`)

```
0.8
```

## Auto Detected FCS Fermentation Device on HA Server

The image below shows a correctly detected FCS Fermentation device in Home Assistant.

<figure><img src="/files/33lpThsJuu6mhrI4ciOh" alt=""><figcaption></figcaption></figure>
