I recently bought a Tilt hydrometer, an excellent piece of homebrew equipment. You put it into your fermenter and can see exactly how your beer is brewing on an app on your smartphone. But this still requires you to get your phone close to the fermenter, especially if you use a a stainless stell one like I do.
But there is another way, Tilt Pi. The guys at Baron brew created as system that can be loaded onto a Raspberry Pi Zero that you can leave near your fermenter, but can access anywhere when you are on the same network or Wifi. The Tilt Pi also logs to Google spreadsheets so you can integrate the data into a number of brewing software systems, cool.
But I wanted more, I wanted the data in my home automation system.
After some investigation it became clear that the system was built using NodeRed, and I was able to see the flows that drive the web site on the Pi. http://IPaddress of PI:1880
Next the task was to find one of the nodes in Nodered where I could access the raw data.
Eventually I found a node called 'Add parameters' as shown above. All the data (and more) that you need is available as javascript variables. Now it is relatively easy to get the data to other systems that you may have available. I sent to information to 2 places.
Influx is a great time series database and if you have one running its a great place to put the data. The data can be stored directly into Influx from NodeRed running on the Pi.
1. Install Influx nodes to Nodered (node-red-contrib-influxdb)
2. Add a function node to process the data for Influx. The influx data entry node expects an array of 2 elements: the first is an array of the data elements, or those elements that are subject to change, I called this 'fields' below. The second array is tags for Influx.
tags = {};
tags.Nodename = "Fermentor";
delete msg.payload.Nodename;
if (typeof(msg.payload.Beer[0]) !== 'undefined') {
tags.Beer = msg.payload.Beer[0];
}
if (typeof(msg.payload.Color) !== 'undefined') {
tags.Colour = msg.payload.Color;
}
if (typeof(msg.payload.SG) !== 'undefined') {
fields.SG = msg.payload.SG;
}
if (typeof(msg.payload.rssi) !== 'undefined') {
fields.RSSI = msg.payload.rssi;
}
if (typeof(msg.payload.Temp) !== 'undefined') {
fields.Temp = ((msg.payload.Temp-32)*5/9);
}
msg.payload = [fields, tags];
msg.measurement = "Beer";
return msg;
3 Add an influx node to store the data in Influx.
The flow will look something like this when you have finished:
And that's it really. The data will be in InfluxDB, I use Grafana to display the data.
1 comment:
Good write-up. Even better job at finding the solution. Well done and thank you.
Post a Comment