Skip to content

Configuration

Adam Dorsey edited this page May 13, 2020 · 8 revisions

Configuration

By default Hoplite looks in the current directory for a file named config.json. A specific configuration file can be selected with the --config argument.

If the config doesn't exist, Hoplite will create an empty config at that location. You'll need to use the API to set up the rest.

Global config options

weight_mode

Determines the format of the weight output. This is printed below the fill bar on the LCD, and to the right of the fill bar on the web interface.

Valid options are:

  • as_kg_gross: Raw weight in kg
  • as_kg_net: Raw weight in kg, compensated for empty keg weight
  • as_pint: Rough estimate of remaining pints
  • as_pct: Percentage of keg remaining

hx

The hx object defines parameters for each HX711 module used to monitor keg weight. It is an array of objects where each object defines another HX711. You can monitor up to two kegs per HX711, if you have a two-channel version. The channels are defined as A and B, like the labels on the module itself.

The pd_sck and dout parameters tell Hoplite which GPIO pins (Broadcom-style GPIO pin numbers, not physical pin numbers) the HX711 is connected to.

Per-channel settings

For each channel, you can define a keg to be monitored. If you're not using a channel, you can leave it out, but all parameters must be defined for a channel or Hoplite will probably crash.

name is the display name of the keg for this channel. For the LCD display, it's truncated to 13 characters, but it will be displayed full length in the web interface.

refunit and offset are the calibration unit and tare offset, respectively. They can be set with the --cal and --tare parameters. If you plan to do that, it's OK to leave those two null and set them later.

size_name is based off of an internal dictionary containing data for the most common keg sizes. size is set according to the data in this dictionary. size_name looks like this:

# keg data dictionary
# value is list( volume in liters, empty weight in kg )
self.keg_data = {
    'half_bbl': (58.6, 13.6),
    'tall_qtr_bbl': (29.3, 10),
    'short_qtr_bbl': (29.3, 10),
    'sixth_bbl': (19.5, 7.5),
    'corny': (18.9, 4),
}

These approximations should be roughly accurate for monitoring the current level of your keg. If you know you have less beer or a different tare weight, you can set size_name to custom and specify size directly. This can be done via the web interface once Hoplite is started.

co2

The co2 section defines the HX711 used to monitor CO2 levels. This is simpler than the sections used for kegs, because we assume that we're only using channel A, and the tare weights and capacity weights are usually printed on the CO2 tanks directly.

pd_sck, dout, offset and refunit are the same as the keg sensors. --tare will set the tare for this sensor as well, and --cal can be used to calibrate this scale by using the special co2 sensor index.

size is similar to the keg's size_namedictionary. size[0] is the CO2 tank's capacity in kg, and size[1] is the tanks tare weight, also in kg. Both of these values should be printed on the tank itself. If either value is in pounds, convert them to kilograms before using.

Make sure you weigh your CO2 valve and regulator as well! Add the weight of the valve and regulator in kg to the empty ('tare') weight of the CO2 canister.

Clone this wiki locally