Skip to main content

Brewfather smart home integration, free and open source

Brewfather integration for Gladys Assistant

Brewfather home brewing: hydrometers, batches, fermentation profile, scenes and widgets.

Overview​

This integration brings your Brewfather home-brewing batches into Gladys: the readings of your hydrometer (iSpindel, Tilt, RAPT Pill, Float, Plaato…), the fermentation profile of the batch and its reminders. It uses the official Brewfather API v2, with your user id and an API key you create in Brewfather.

  • One Gladys device per hydrometer, kept from one batch to the next: gravity (SG), wort temperature, alcohol by volume, the temperature of the current step of the fermentation profile, the batch and the step in words.
  • Scene triggers (status of a batch changed, fermentation stable, fermentation step started, batch reminder due, hydrometer stopped or back) and scene actions (set the status of a batch, read now).
  • Three dashboard widgets: the batches fermenting and conditioning, the gravity curve of a batch, and the connection.

Transport: cloud. Your hydrometer sends its readings to Brewfather; Gladys reads them there every 5 to 30 minutes (10 by default), never from the hydrometer itself. Your brewing data already live at Brewfather; the integration only adds the copy Gladys keeps.

Not affiliated with Brewfather. Not yet tested with a real Brewfather account: please report what works and what does not.

Generated illustration of the three widgets: the fermentations (Pale Ale at 1.014, 19.4 °C, 5 % ABV; Oatmeal Stout conditioning), the gravity curve of the Pale Ale with its gravity, alcohol and attenuation, and the connection to the Brewfather API — not a screenshot

Prerequisites​

  • Gladys Assistant 5.3.0 or later.
  • A Brewfather account whose plan includes the API, and a hydrometer that sends its readings to Brewfather (set up in Brewfather, Settings → Integrations).
  • An API key: in Brewfather, open Settings → API keys, create a key with the Read Batches scope (add Edit Batches if a scene should change the status of a batch), and note the user id shown there. Use a key for Gladys only: you can revoke it at any time without touching your other tools.

Configuration​

In Gladys, open Integrations → Brewfather:

FieldDescription
User idShown in Brewfather, Settings → API keys.
API keyScope "Read Batches" (and "Edit Batches" for the status action). Sent to Brewfather only.
Reading intervalEvery 5, 10, 15 or 30 minutes (10 by default). Brewfather allows 500 calls an hour.
Stable gravity after24, 48 or 72 hours (48 by default): the window of the "fermentation stable" trigger.
No reading after (hours)1 to 48 (3 by default): the "hydrometer stops sending" trigger.
Language of the device textsNames of the features, batch and step texts; automatic by default.

Click Test the connection: the integration reads your batches and lists those in progress with their hydrometer. Then open the Discover tab and add your hydrometers: nothing is created without you. A hydrometer appears once it has sent a reading to a batch that is fermenting or conditioning.

Usage​

Devices​

FeatureGladys typeNotes
Gravity (SG)Counter sensor, no unitThe last reading, e.g. 1.014 (Gladys has no gravity unit).
Wort temperatureTemperature sensor (°C)Measured by the hydrometer.
Alcohol (% ABV)Counter sensor, no unit(OG − SG) × 131.25, with the measured OG (else the planned one).
Profile temperatureTemperature sensor (°C)The temperature of the current step of the fermentation profile.
BatchText"#12 Pale Ale · Fermenting", or "No batch in progress".
Fermentation stepText"Primary · 19 °C".

The step of the profile is computed from the fermentation start date and the duration of each step (ramp then time), as Brewfather plans them.

Dashboard widgets​

  • Fermentations: each batch fermenting or conditioning with its gravity, temperature and ABV, a badge (fermenting, stable, conditioning, no reading). Tap a batch for its details: style, original and expected final gravity, attenuation, days of fermentation, step until when, next step, next reminder, hydrometer and its battery. Refresh reads now.
  • Gravity curve: the gravity of one batch since its start (300 points at most), with its gravity, alcohol and attenuation now. Choose the hydrometer in the widget settings; empty, the first batch fermenting.
  • Brewfather: the batches fermenting and conditioning, the state of the connection, the last reading, the calls of the last hour against the 500 allowed, a Refresh button.

Scenes​

Triggers:

  • The status of a batch changes (can be limited to one status): in Brewfather, never by Gladys itself. Variables: batch, number, status, previous status.
  • The fermentation is stable (by hydrometer): the gravity moved by 0.001 at most over the window of the configuration. Variables: gravity, ABV, attenuation.
  • A fermentation step starts (by hydrometer): a new step of the profile, with its temperature and the previous one.
  • A batch reminder is due (can be limited to one kind: dry hop, bottling day, end of fermentation…).
  • A hydrometer stops sending / sends again (by hydrometer): no reading for the hours of the configuration while its batch is active.

Actions:

  • Set the status of a batch: the batch of a hydrometer, or a recent batch by its number (needs "Edit Batches"; outputs: batch name, status).
  • Read Brewfather now: outputs the batches fermenting and conditioning.

Examples:

  • When a fermentation step starts → set the thermostat of the fermentation chamber to {{triggerEvent.data.target_temperature}} °C.
  • When the fermentation is stable → send a notification "{{triggerEvent.data.batch_name}} is done: {{triggerEvent.data.gravity}}, {{triggerEvent.data.abv}} % ABV", and set the batch to Conditioning.
  • When a "dry hop" reminder is due → notify "Time to dry hop {{triggerEvent.data.batch_name}}".
  • When a hydrometer stops sending → alert: its battery is probably empty.

Transport​

The catalog shows the cloud badge: every request goes to api.brewfather.app with your user id and key. The integration only reads your batches and readings, and changes a batch status only when a scene asks for it; nothing goes to the author of the integration nor to any other service, and what it keeps (the gravity of the last 7 days, for the triggers) stays in your Gladys. Use of the API follows the Brewfather API Terms of Service.

Troubleshooting​

  • "Brewfather refuses the user id or the API key": check both in Settings → API keys, or create a new key.
  • "Missing scope": the key lacks "Read Batches"; create a key with it. Without "Edit Batches", only the status action fails.
  • No hydrometer in Discover: the hydrometer must have sent a reading to a batch fermenting or conditioning; a manual reading has no hydrometer.
  • "Too many requests": the key is shared with other tools; the integration waits as long as Brewfather asks. Give Gladys its own key.
  • "No reading" badge: the hydrometer has sent nothing for the hours of the configuration (battery, Wi-Fi, logging set up on another batch).
  • Report a problem on GitHub with your Gladys version, the integration version and the result of "Test the connection".

Configuration settings​

These are the settings Brewfather asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
BrewfathersectionNoHow to connect: 1. In Brewfather, open Settings → API keys and create a key with the “Read Batches” scope (add “Edit Batches” to change a batch status from a scene). 2. Copy the user id and the key shown there below. 3. Your hydrometer (iSpindel, Tilt, RAPT Pill, Float…) must send its readings to Brewfather. 4. In the Discover tab, add your hydrometers. Brewfather is a cloud service: Gladys reads it every few minutes.
User idstringYesShown in Brewfather, Settings → API keys.
API keysecretYesScope “Read Batches” (and “Edit Batches” for the status action). Sent to Brewfather only.
Reading intervalselectNoA hydrometer sends a reading every 15 minutes or so: reading every 10 minutes is enough.
Stable gravity afterselectNoThe “fermentation stable” trigger fires when the gravity moves by 0.001 at most over this window.
No reading after (hours)numberNoThe “readings stopped” trigger fires when an active batch gets no reading for this long (empty battery, Wi-Fi).
Language of the device textsselectNoFeature names, batch and step texts. Automatic: the language of the dashboard.
Your datasectionNoThe integration reads your batches and their readings (and changes a batch status only when a scene asks for it), with your own key. It talks to api.brewfather.app only: nothing goes to the author of the integration nor to any other service, and what it keeps (the gravity of the last 7 days, for the triggers) stays in your Gladys. Delete the key in Brewfather to stop it at any time.

How to install Brewfather in Gladys​

  1. In Gladys, open Integrations: Brewfather appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/william-de71/gladys-brewfather:0.1.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/William-De71/gladys-brewfather.

Brewfather requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Brewfather is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by William-De71, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂