# Custom Stream

Integrate your logging device with a custom **HTTP POST** to the **URL** you are given in the settings.

![Enable custom stream in the settings page](https://771697612-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEzhWP2LGeXaKgS2qr4%2F-LVoJmWUAgCP9xw8EZDV%2F-LVoJnF0ydPfaP8sxA6P%2Fimage.png?alt=media\&token=378ee1ad-6bf8-4344-9717-a3b53a660b5e)

### Where do I find the `logging-id`?

1. Open **Settings → Power-ups → Custom Stream** in Brewfather.
2. Enable Custom Stream if needed.
3. Copy the integration URL/ID shown there.
4. Use that value in your endpoint URL as `?id=...`.

Example:

* `https://log.brewfather.net/stream?id=your-logging-id`

Use the following **JSON** format in the body of the **POST:**

## Supported fields for custom streaming device entry

<mark style="color:green;">`POST`</mark> `https://log.brewfather.net/stream?id=:logging-id`

Integrate any custom devices by posting data to Brewfather. When the first POST is logged a new device will be created using the "name" field. Requests can also be posted as HTTPS if your device supports it.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Name                                   | Type   | Description                                                                                                                                                                          |
| -------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| name<mark style="color:red;">\*</mark> | string | Unique name for your device. Used to identify the device. Required field.                                                                                                            |
| temp                                   | number | Temperature                                                                                                                                                                          |
| aux\_temp                              | number | Appears as Fridge Temp                                                                                                                                                               |
| ext\_temp                              | number | Appears as Room Temp                                                                                                                                                                 |
| temp\_unit                             | string | Temperature units "**C**" for Celsius, "**F**" for Fahrenheit, "**K**" for kelvin. Default value is "C"                                                                              |
| gravity                                | number | Gravity                                                                                                                                                                              |
| gravity\_unit                          | string | Gravity units "**G**" for SG (1.XXX) and "**P**" for Plato (X.XX). Default value is "G".                                                                                             |
| pressure                               | number | Pressure                                                                                                                                                                             |
| pressure\_unit                         | string | Pressure units "**PSI**", "**BAR**", "**KPA**". Default is "PSI".                                                                                                                    |
| ph                                     | number | pH                                                                                                                                                                                   |
| bpm                                    | number | Bubbles Per Minute                                                                                                                                                                   |
| comment                                | string | Free Text                                                                                                                                                                            |
| beer                                   | string | Beer Style Text                                                                                                                                                                      |
| battery                                | number | Battery level as volts (decimal number)                                                                                                                                              |
| device\_integration                    | string | Type of device integration. Only value "default" is possible now. Default value is "**default**". More values can be added in the future to support different kinds of integrations. |
| device\_source                         | string | Device that is source for the logged values, for example "Tilt", "iSpindel", "X Sensor".                                                                                             |
| report\_source                         | string | Device that is used to report the values to the service, for example "MyBrewbot", "MyCustomBuild", "HomeAutomation".                                                                 |
| device\_state                          | string | State of device, example: "heating", "cooling", "on", "off"                                                                                                                          |
| temp\_target                           | number | Target Temperature. Uses unit from "temp\_unit"                                                                                                                                      |
| gravity\_target                        | number | Target Gravity. Uses unit from "gravity\_unit"                                                                                                                                       |
| hysteresis                             | number |                                                                                                                                                                                      |
| angle                                  | number | Angle on a floating hydrometer                                                                                                                                                       |
| rssi                                   | number | Received Signal Strength Indicator                                                                                                                                                   |
| count                                  | number | Counter value, for example total amount of bubbles, or number of pours                                                                                                               |
| volume                                 | number | Volume left in container                                                                                                                                                             |
| volume\_unit                           | string | Volume units "L", "GAL", "OZ". Default is "L".                                                                                                                                       |
| pour\_volume                           | number | Last pour volume                                                                                                                                                                     |
| max\_volume                            | number | Max total volume in container                                                                                                                                                        |
| percentage                             | number | Value that will be displayed as a percentage                                                                                                                                         |

{% tabs %}
{% tab title="200: OK Success response" %}

```html
{ "result": "OK" }
```

{% endtab %}
{% endtabs %}

Example POST data:

```
{
  "name": "YourDeviceName", // Required field, this will be the ID in Brewfather
  "temp": 20.32,
  "aux_temp": 15.61, // Fridge Temp
  "ext_temp": 6.51, // Room Temp
  "temp_unit": "C", // C, F, K
  "gravity": 1.042,
  "gravity_unit": "G", // G, P
  "pressure": 10,
  "pressure_unit": "PSI", // PSI, BAR, KPA
  "ph": 4.12,
  "bpm": 123, // Bubbles Per Minute
  "comment": "Hello World",
  "beer": "Pale Ale",
  "battery": 4.98
}
```

Temperature units "**C**" for Celsius, "**F**" for Fahrenheit, "**K**" for kelvin.\
Gravity units "**G**" for SG and "**P**" for Plato.\
Pressure units "**PSI**", "**BAR**", "**KPA**".

**Never log more than once every 15 minutes per device name**, requests logged more often than that will be ignored. If you are logging more than one device give them each a unique name, maximum rate: one POST per device per 15 minutes.

**Field "name" is required**. Other fields are optional. At least **one value** field must be provided (Temp, gravity or pressure, etc).

If your device supports https you can also replace HTTP with HTTPS in the logging URL.

#### **Example HTTP POST**

```
POST /stream?id=yourpersonalid HTTP/1.1
Host: log.brewfather.net
Content-Type: application/json
Content-Length: 57

{
"name": "YourDeviceName",
"pressure": 2.43
}
```

## Related docs

* [Devices](https://docs.brewfather.app/devices)
* [Webhook (Device Forwarding)](https://docs.brewfather.app/integrations/webhook)
* [API](https://docs.brewfather.app/api)
