BeerSmith integration

Wow that is awesome @robvdw and @Bob_Steers! I was thinking of building something like this, but now I can already use it. Really happy with this integration!

1 Like

@robvdw thanks a lot mate. It will save me dev time :wink:

Thanks @Bob_Steers, using the running averages makes a lot of sense. Iā€™ll give it a try as soon as my current beer is finished fermenting.

The script is running every 900s but Iā€™m not getting any values in Brewfather. I tried serveral different configurations variables but probably not the right onesā€¦somebody can help me out?

Could you please show your used configuration? (Donā€™t forget to edit out your stream ID)

By the looks of it, your url is missing /history/query/last_values. It should be:

https://192.168.1.117/history/query/last_values

I didnā€™t exactly have user friendliness in mind when I threw this together :slight_smile:

Your variable names might differ from mine (depending on your install), e.g. I think I defined ā€œKamertemperatuur sensorā€ myself, so it should probably not be in your config file. The aux_temp also does not look right. Unless you also happen to have a Blue Tilt hydrometer and the j616 plugin-in, remove the tilt device and gravity line from the config. Finally, itā€™s best not to touch the defaults in the bottom block unless to change the units (you changed the default value for the beer temperature to a string).

You can get a list of whatā€™s available on your system with (thereā€™s probably an easier way to do this):
docker-compose exec influx influx -database brewblox -execute "show field keys;"

If you donā€™t see Ferment Beer Sensor/value[degC] in the list generated by the above command, make sure to exactly copy the variable name related to your beer sensor to the yaml file.

Try this to start with (minimal version with just beer temp). Be sure to replace XXXā€™s again with your Brewfather custom stream ID:

brewblox: 
  url: https://192.168.1.117/history/query/last_values
  devices:
    - spark-one:
        temp: "Ferment Beer Sensor/value[degC]"

brewfather:
  url: http://log.brewfather.net/stream?id=XXXXXXXXXXXXXX
  interval: 0

# Data to be submitted & defaults
brewfatherdata:
  name: Cabrito          # Device name
  temp: None             # Beer temp
  aux_temp: None         # Fridge temp
  ext_temp: None         # Room temp
  temp_unit: C           # C, F, K
  gravity: None          # Gravity
  gravity_unit: G        # G, P
  pressure: None         # Pressure
  pressure_unit: None    # PSI, BAR, KPA
  ph: None               # pH
  comment: None          # comment
  beer: None             # Beer name

With the correct URL I get some data in Brewfather.

The other variable names where just some experiments to get it working. With 900 seconds to wait every change in de yml Iā€™ve tried different possibilities every update :slight_smile: .
I have a Black Tilt so now I know itā€™s working Iā€™m gonna try the hydrometer. Thanks for the extra info about the variable names.

thatā€™d be /history/query/objects

You can also get an overview of whatā€™s possible by visiting /history/api/doc in your browser.

Everything (incl. Tilt) is working. Thanks!

Hi Rob,

Got this working! Many thanks, but I am strugling with crontab.

*/15 * * * * /usr/bin/python3 /home/pi/brewblox/brewblox_to_brewfather.py &

Can you post your crontab entry for this?

thanks,
Douwe

Hi Douwe,

Your line should work if your paths are correct, python3 is installed and if the config file is good, so I donā€™t know what the problem is. You may want to to try running /usr/bin/python3 /home/pi/brewblox/brewblox_to_brewfather.py from the command line and see if you get any errors. You edited your crontab from the correct user (pi) with crontab -e ?

FYI: Iā€™ve made my python-script executable (chmod +x brewblox_to_brewfather.py) my crontab entry is:

*/15 * * * * /home/pi/brewblox_to_brewfather/brewblox_to_brewfather.py 2>&1 > /dev/null

No need for the & behind lines in crontab (because cron is always run in the background). The 2>&1 > /dev/null in my line redirects errors (2) to stdout (1) and the whole thing to /dev/null to avoid output (and emails from cron), but it should have no impact on the functioning.

Hi Rob,

Thanks for your help. Itā€™s working now. Many thanks!

Trying to get the script running to integrate into BrewFather. Everything seems to be working, Iā€™m just not getting any values over in BrewFather. Testing via the ā€˜history/api/docā€™ seems to show the value being ā€˜nullā€™. I confirmed that this is the correct fieldKey shown in BrewBlox, so Iā€™m not sure why itā€™s null? Definitely seeing a value from the web dashboard

[
{
ā€œfieldā€: ā€œFerm Beer Sensor/value[degF]ā€,
ā€œtimeā€: null,
ā€œvalueā€: null
}
]

Could you please post your used configuration, and the query arguments you use in history/api/doc? (donā€™t forget to anonymize your brewfather stream key)

Query:

{
ā€œdatabaseā€: ā€œbrewbloxā€,
ā€œmeasurementā€: ā€œtemperatureā€,
ā€œfieldsā€: [
ā€œFerm Beer Sensor/value[degF]ā€
]
}

config:

brewblox:
url: https://bsbrewpi/history/query/last_values
devices:
- spark-one:
temp: ā€œFerm Beer Sensor/value[degF]ā€
aux_temp: ā€œFerm Fridge Sensor/value[degF]ā€

brewfather:
url: http://log.brewfather.net/stream?id=###########
interval: 900

brewfatherdata:
name: BeerFridge # Device name
temp: None # Beer temp
aux_temp: None # Fridge temp
ext_temp: None # Room temp
temp_unit: F # C, F, K
gravity: None # Gravity
gravity_unit: G # G, P
pressure: None # Pressure
pressure_unit: None # PSI, BAR, KPA
ph: None # pH
comment: None # comment
beer: None # Beer name

The ā€œmeasurementā€ key in your query should be the service name (spark-one by the looks of it).

I canā€™t comment on any indenting issues in your yml config, due to formatting in the quote.

Aha! Iā€™m definitely not familiar with querying with JSON. that corrected the API query and returned the valueā€¦

But Iā€™m still getting no data in BrewFather. Obviously, I didnā€™t format my pasted config correctly, but it is correctly indented in the config file.

formatted to show the indenting

brewblox:
  url: https://bsbrewpi/history/query/last_values            # URL of brewblox install
  devices:                                                 # List of Brewblox "measurement" devices
    - spark-one:
        temp: "Ferm Beer Sensor/value[degF]"            # Every item is defined as with the brewfather variable as key
        aux_temp: "Ferm Fridge Sensor/value[degF]"      # and the Breblox variable name as value

brewfather:
  url: http://log.brewfather.net/stream?id=#########  # replace with your URL from brewfather settings page (Custom Stream)
  interval: 900                                              # number of seconds between updates, minimum 900 seconds, 0 stop after run

# Data to be submitted & defaults
brewfatherdata:
  name: BeerFridge               # Device name
  temp: None             # Beer temp
  aux_temp: None         # Fridge temp
  ext_temp: None         # Room temp
  temp_unit: F           # C, F, K
  gravity: None          # Gravity
  gravity_unit: G        # G, P
  pressure: None         # Pressure
  pressure_unit: None    # PSI, BAR, KPA
  ph: None               # pH
  comment: None          # comment
  beer: None             # Beer name