Brewfather
Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →
Qué hace
¡Atención cerveceros! Mantente al día con el estado de tu lote de Brewfather directamente en tu línea de comandos usando el segmento brewfather.
Necesitarás tu ID de usuario y clave API generados en la pantalla de Configuración de Brewfather, habilitados con los permisos batches.read y recipes.read.
Configuración de ejemplo
Este ejemplo utiliza la plantilla predeterminada del segmento para mostrar un nivel de detalle adecuado al estado del lote.
Además, el fondo del segmento se volverá rojo si la última lectura tiene más de 4 horas, lo que podría indicar un problema si, por ejemplo, existe un dispositivo Tilt o similar que debería registrar datos en Brewfather cada 15 minutos.
Las unidades de temperatura están en grados Celsius y la gravedad específica se expresa en valores X.XXX.
- json
- yaml
- toml
{
"type": "brewfather",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#ffffff",
"background": "#33158A",
"background_templates": [
"{{ if and (.Reading) (eq .Status \"Fermenting\") (gt .ReadingAge 4) }}#cc1515{{end}}"
],
"options": {
"user_id": "abcdefg123456",
"api_key": "qrstuvw78910",
"batch_id": "hijklmno098765"
}
}
type: brewfather
style: powerline
powerline_symbol:
foreground: "#ffffff"
background: "#33158A"
background_templates:
- '{{ if and (.Reading) (eq .Status "Fermenting") (gt .ReadingAge 4)
}}#cc1515{{end}}'
options:
user_id: abcdefg123456
api_key: qrstuvw78910
batch_id: hijklmno098765
type = "brewfather"
style = "powerline"
powerline_symbol = ""
foreground = "#ffffff"
background = "#33158A"
background_templates = [ "{{ if and (.Reading) (eq .Status \"Fermenting\") (gt .ReadingAge 4) }}#cc1515{{end}}" ]
[options]
user_id = "abcdefg123456"
api_key = "qrstuvw78910"
batch_id = "hijklmno098765"
Opciones
| Name | Type | Default | Description |
|---|---|---|---|
user_id | string | as provided by Brewfather's Generate API Key screen | |
api_key | template | as provided by Brewfather's Generate API Key screen | |
batch_id | string | Get this by navigating to the desired batch on the brewfather website, the batch id is at the end of the URL in the address bar | |
day_icon | string | d | icon or letter to use to indicate days |
http_timeout | int | 20 | in milliseconds - How long to wait for the Brewfather service to answer the request |
Iconos
Puedes personalizar los iconos de tendencia de temperatura usados por la propiedad de plantilla .TemperatureTrendIcon con:
| Name | Default | Description |
|---|---|---|
doubleup_icon | ↑↑ | increases of more than 4°C |
singleup_icon | ↑ | increase 2-4°C |
fortyfiveup_icon | ↗ | increase 0.5-2°C |
flat_icon | → | change less than 0.5°C |
fortyfivedown_icon | ↘ | decrease 0.5-2°C |
singledown_icon | ↓ | decrease 2-4°C |
doubledown_icon | ↓↓ | decrease more than 4°C |
Puedes personalizar los iconos predeterminados del estado del lote usados por la propiedad de plantilla .StatusIcon con:
| Name | Default |
|---|---|
planning_status_icon | \uF8EA |
brewing_status_icon | \uF7DE |
fermenting_status_icon | \uF499 |
conditioning_status_icon | \uE372 |
completed_status_icon | \uF7A5 |
archived_status_icon | \uF187 |
Plantilla (info)
{{ .StatusIcon }} {{ if .DaysBottledOrFermented }}{{ .DaysBottledOrFermented }}{{ .DayIcon }} {{ end }}{{ url .Recipe.Name .URL }} {{ printf \"%.1f\" .MeasuredAbv }}%{{ if and (.Reading) (eq .Status \"Fermenting\") }} {{ printf \"%.3f\" .Reading.Gravity }} {{ .Reading.Temperature }}\u00b0 {{ .TemperatureTrendIcon }}{{ end }}
Propiedades
| Name | Type | Description |
|---|---|---|
.Status | string | One of "Planning", "Brewing", "Fermenting", "Conditioning", "Completed" or "Archived" |
.StatusIcon | string | Icon representing above stats. Can be overridden with properties shown above |
.TemperatureTrendIcon | string | Icon showing temperature trend based on latest and previous reading |
.DaysFermenting | int | days since start of fermentation |
.DaysBottled | int | days since bottled/kegged |
.DaysBottledOrFermented | int | one of the above, chosen automatically based on batch status |
.Recipe.Name | string | The recipe being brewed in this batch |
.BatchName | string | The name of this batch |
.BatchNumber | int | The number of this batch |
.MeasuredAbv | float | The ABV for the batch - either estimated from recipe or calculated from entered OG and FG values |
.ReadingAge | int | age in hours of most recent reading or -1 if there are no readings available |
Lectura
.Reading contiene los datos más recientes de dispositivos o entradas manuales visibles en el gráfico de Lecturas del lote de Brewfather. Si no hay lecturas disponibles, .Reading será nulo.
| Name | Type | Description |
|---|---|---|
.Reading.Gravity | float | specific gravity (in decimal point format) |
.Reading.Temperature | float | temperature in °C |
.Reading.Time | int | unix timestamp of reading |
.Reading.Comment | string | comment attached to this reading |
.Reading.DeviceType | string | source of the reading, e.g. "Tilt" |
.Reading.DeviceID | string | id of the device, e.g. "PINK" |
Propiedades adicionales
| Name | Type | Description |
|---|---|---|
.MeasuredOg | float | The OG for the batch as manually entered into Brewfather |
.MeasuredFg | float | The FG for the batch as manually entered into Brewfather |
.BrewDate | int | The unix timestamp of the brew day |
.FermentStartDate | int | The unix timestamp when fermentation was started |
.BottlingDate | time | The unix timestamp when bottled/kegged |
.TemperatureTrend | float | The difference between the most recent and previous temperature in °C |
.DayIcon | string | given by "day_icon", or "d" by default |
Soporte de hipervínculos
| Name | Type | Description |
|---|---|---|
.URL | string | the URL for the batch in the Brewfather app. You can use this to add a hyperlink to the segment if you are using a terminal that supports it. The default template implements this |
Plantillas avanzadas
La plantilla integrada muestra información clave útil. Sin embargo, puedes usar las propiedades del lote para construir la tuya. Como referencia, la plantilla predeterminada se ve así:
- json
- yaml
- toml
{
"template": "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}{{.DayIcon}} {{end}}[{{.Recipe.Name}}]({{.URL}}) {{printf \"%.1f\" .MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{printf \"%.3f\" .Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}"
}
template: '{{.StatusIcon}} {{if
.DaysBottledOrFermented}}{{.DaysBottledOrFermented}}{{.DayIcon}}
{{end}}[{{.Recipe.Name}}]({{.URL}}) {{printf "%.1f" .MeasuredAbv}}%{{ if and
(.Reading) (eq .Status "Fermenting")}}: {{printf "%.3f" .Reading.Gravity}}
{{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}'
template = "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}{{.DayIcon}} {{end}}[{{.Recipe.Name}}]({{.URL}}) {{printf \"%.1f\" .MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{printf \"%.3f\" .Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}"
Conversión de unidades
Por defecto, las lecturas de temperatura se proporcionan en grados Celsius y las de gravedad en unidades decimales de Gravedad Específica (X.XXX).
Las siguientes funciones de conversión están disponibles en la plantilla para convertir a otras unidades:
Temperatura
| Name | Description |
|---|---|
.DegCToF | input: float degrees in C; output float degrees in F (1 decimal place) |
.DegCToKelvin | input: float degrees in C; output float Kelvin (1 decimal place) |
Gravedad
| Name | Description |
|---|---|
.SGToBrix | input float SG in x.xxx decimal; output float Brix (2 decimal places) |
.SGToPlato | input float SG in x.xxx decimal; output float Plato (2 decimal places) |
(Estas utilizan las conversiones polinómicas de Wikipedia)
Ejemplo
- json
- yaml
- toml
{
"template": "{{if .Reading}}{{.SGToBrix .Reading.Gravity}}°Bx, {{.DegCToF .Reading.Temperature}}°F{{end}}"
}
template: "{{if .Reading}}{{.SGToBrix .Reading.Gravity}}°Bx, {{.DegCToF
.Reading.Temperature}}°F{{end}}"
template = "{{if .Reading}}{{.SGToBrix .Reading.Gravity}}°Bx, {{.DegCToF .Reading.Temperature}}°F{{end}}"
Para mostrar la gravedad como SG en formato XXXX (ej. "1020" en lugar de "1.020"), usa la función de plantilla mulf
- json
- yaml
- toml
{
"template": "{{if .Reading}}{{.mulf 1000 .Reading.Gravity}}, {{.DegCToF .Reading.Temperature}}°F{{end}}"
}
template: "{{if .Reading}}{{.mulf 1000 .Reading.Gravity}}, {{.DegCToF
.Reading.Temperature}}°F{{end}}"
template = "{{if .Reading}}{{.mulf 1000 .Reading.Gravity}}, {{.DegCToF .Reading.Temperature}}°F{{end}}"