KegMon#

Self Hosted Cloud Hosted

A KegMon weighs a keg on a load cell and reports pours and the remaining volume of the keg on a tap. This page shows how to point the KegMon at BrewGraph. It works on Self Hosted and Cloud Hosted.

What you need#

  • A tap added in BrewGraph, with a keg on it. The KegMon belongs to the tap, not to a device: BrewGraph shows the tap token on the tap page, followed by how to configure the device, including the server address to enter.

  • A KegMon with its web interface reachable on your network.

Configure the KegMon#

In the KegMon web interface, fill in:

Field

Value

Server

The server only, without a path: https://<your-ingest-host>. The KegMon adds /ingest/kegmon for pours and levels and /ingest/kegmon/beer to fetch the beer shown on its display.

Token

The tap token from the BrewGraph tap page. The KegMon sends it in the body of every request.

Payload#

A pour is sent when the KegMon detects one. All volumes are in litres:

{
  "token": "<tap token>",
  "eventId": "a1b2c3d4",
  "pour": 0.35,
  "volume": 14.2,
  "maxVolume": 19.0,
  "temperature": 4.2
}

When the measured volume has settled, the KegMon sends the level without a pour:

{
  "token": "<tap token>",
  "volume": 14.2,
  "maxVolume": 19.0,
  "temperature": 4.2
}
  • volume is the keg’s remaining volume and maxVolume its capacity. Both are required. The KegMon is the source of truth for the level, so BrewGraph sets the keg’s volume to what it reports, whether that is lower (a pour), higher (a refill) or the same.

  • eventId is optional on a pour: a text of at most 128 characters that is unique for each pour. If the KegMon sends the same pour again, for example after a lost answer, BrewGraph records it once. An eventId that is not text, is blank or is too long is dropped and the pour is stored as without one. A request can carry the same value in an Idempotency-Key header instead.

  • pour is optional. A pour event records one pour of that size. A level event never records a pour. A pour that is not a number is dropped and the event is stored as a level.

  • temperature (°C) is optional on both events. It is stored as the keg’s temperature and shows in its temperature chart. It never changes what the event does.

  • A tap with no keg on it accepts the report and ignores it: nothing is stored.

The beer request carries only the token:

{
  "token": "<tap token>"
}

The answer holds name, abv, ibu and ebc of the beer on the tap. It is 401 when the token is unknown or the tap has no keg.

Check that it works#

  1. Save the configuration and pour a small amount.

  2. Open the tap in BrewGraph. The pour and the new volume of the keg should appear.

Troubleshooting#

  • 401: the tap token is missing or mistyped. Copy it again from the tap page.

  • 422: volume or maxVolume is missing, negative or not a number.

  • 404: the server was entered with a path. Enter the server only.

  • A quiet tap is normal: a KegMon reports only when the level changes, so BrewGraph does not treat a tap without reports as a failed device.

For every status code and what to do about it, see Ingest error codes.

More information#