Where do I've beer temp?

Hi, I was thinking loggin by beer temp through MQTT and I don’t really understand in which file/row I have the received beer temp so I can call shell to execute a mosquitto_pub. Any help showing direction would be much appreciated :slight_smile:


By “received beer temp” you mean the logged temp received from the micro controller (spark/photon/arduino) and recorded on the pi? Or the temperature that the micro controller receives from the temperature probe?

If you are asking where it is logged on the pi. With the current docker image each session has a folder in /home/brewpi/data. For example, the included sample data is in /home/brewpi/sample\ data. There is a .json file for each day, and a .csv file which appears to aggregate everything.

root@c58bfe7a3eaf:/home/brewpi/data/Sample Data# ls
Sample Data-2012-09-26.json  Sample Data.csv

I mean when Pi receives the temp from my spark, in my case through wifi

Okay, then you can find the new lines representing the most recently received data from the spark in the /home/brewpi/data session folders as described in my above post. Alternately, it also logs the received data in the log files (/home/brewpi/logs) but they will also have lines showing errors and other information which would require a more complicated script to just extract the most recent temperature reading. I would just use the .csv file as it seems like the simplest to use regular expressions to extract from.

/home/brewpi/data/Treaty%20Port%20Porter%2017-1-06# tail -n 1 Treaty%20Port%20Porter%2017-1-06.csv
Jan 10 2018 11:13:22;18.0;18.0;null;18.0;18.0;null;3;6.81;21.06;21.06

The first column is the date and time, second is the beer temp, third is beer setpoint, fifth is the chamber temp, sixth is the chamber setpoint, the last three are the logging temps (if used). I’m not sure what the nulls are or where it records heatting/cooling/idle state.

Hope this helps.

You could insert something here:

Cheers both, great, this will help a lot :slight_smile: I’m working with integrate my beer with my home-assistant and want to use Grafana as graph generator, makes it easier to integrate Tilt and Plaato. I love my brewpi


In case someone else wants to get brewpi temperature elseware.

I’m running brewpi as an image in docker. I’ve a perl script that runs every minute as a cron job on my host os (ubuntu) and pushes the values through MQTT to a influxdb database. I then use grafana to generate all the graphs from brewpi and also from my tilt hydrometer (which also pushes MQTT to influxdb) I also added beer temp and SG as sensors to my home-assistant (hass.io), all my important data at one place :slight_smile:

#!/usr/bin/perl -w
use strict;
use warnings;
my $IP = “IP_ADDRESS -u “user” -P “password””;
my $beer_string = tail -n 1 /usr/local/bin/brew.csv;
my @values = split(’;’, $beer_string);
if ($values[1] ne “null”) { system(“mosquitto_pub -h $IP -t brew/beer/temp -m $values[1]”); }
if ($values[2] ne “null”) { system(“mosquitto_pub -h $IP -t brew/beer/setTemp -m $values[2]”); }
if ($values[4] ne “null”) { system(“mosquitto_pub -h $IP -t brew/chamber/temp -m $values[4]”); }
if ($values[5] ne “null”) { system(“mosquitto_pub -h $IP -t brew/chamber/setTemp -m $values[5]”); }
exit 0;

I notice that ampersands and backslash are removed so above code will not work, you need to know where to add them

thanks again.