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!
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
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 .
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.
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: 900brewfatherdata:
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