Node-RED for Raspberry pi-based brewery control

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

jangevaa

Well-Known Member
Joined
Nov 22, 2010
Messages
251
Reaction score
74
Location
Guelph
I've mentioned this in a few comments on HBT I think. I started using Strangebrew elsinore for a few years until development stopped, then Craftbeerpi until development stopped (and wrote some plugins along the way).

For the last year or so I've been blazing my own path using Node-RED for my brewery. I really like it. I'm not doing full brewery automation at this point with it, but such potential exists. All the talk about craftbeerpi and similar seems to end up in this forum so I thought it was most appropriate.

I'm at a point with my dashboard that I'm pretty happy with it functionally and aesthetically so sharing it here.

I've implemented PID and limited-output PID for an inline heater (RIMS), and PID and manual control for my boil kettle. I also have software blocking and alerts to prevent me from firing two elements at once (there is some hardware control for this as well, don't fear), since my panel feed isn't capable of running 2 5500watt elements at once.

I also have volume sensing set up but I need to add more ports to my kettles for the pressure transducers - so those are hidden in the screenshots. I've been meaning to add communication with my VFD controlled pump for awhile now, but it remains as just a basic on/off on my dashboard for now.

Here's the github repo: https://github.com/jangevaare/brew2
Here's more or less the state of my brewery that it is controlling https://onbrewing.com/2018-brewery-update/

main.png

mash_settings.png
 
Thank you for posting this, I'll check it out. I'm currently using craftbeerpi for my single kettle eBIAB setup. It's a shame that development seems to have all but stopped. I've considered switching to the Auber EZ Boil, but would like to keep some form of automation/connectivity.
 
I've been looking at Node-RED since you mentioned it a while back on the CBPi Facebook forum. Considering how vague the future development of CBPi has become I like the idea of having other options that don't rely on other people's software packages. I've also been looking at the practicality of running Node-Red on a PC with a USB GPIO board and eliminating the Pi and it's occasional stability issues altogether.
 
I posted something about this on the CBPi FB usergroup yesterday and was banned and post deleted as a result almost immediately, which is too bad. That group had been the main avenue that I provided support for my several CBPi Plugins. I'm going to leave the plugin repositories up, but I'm archiving all of them now. I may or may not request that they are removed from the plugins list.

jangevaare/cbpi-CascadeControl
jangevaare/cbpi-OnAtStartup
jangevaare/cbpi-OneWireAdvanced
jangevaare/cbpi-DependentActor

@Gravitysucks I would think that an RPi would be more stable than a windows machine. Something that happens a lot seemingly is corrupt SD cards, which I think is the combined result of poor quality/old SDs frequently bundled with budget pi starter kits, and software that writes to sd cards with very high frequency over long periods of time (e.g. CBPi is constantly outputting several log files to the SD card I believe). A small cheap UPS can really bring up pi reliability as well, as power interruption during writing can lead to SD card corruption.
 
Last edited:
I posted something about this on the CBPi FB usergroup yesterday and was banned and post deleted as a result almost immediately, which is too bad. That group had been the main avenue that I provided support for my several CBPi Plugins. I'm going to leave the repositories up, but I'm archiving all of them now. I may or may not request that they are removed from the plugins list.

jangevaare/cbpi-CascadeControl
jangevaare/cbpi-OnAtStartup
jangevaare/cbpi-OneWireAdvanced
jangevaare/cbpi-DependentActor

@Gravitysucks I would think that an RPi would be more stable than a windows machine. Something that happens a lot seemingly is corrupt SD cards, which I think is the combined result of poor quality/old SDs frequently bundled with Pi budget pi starter kits, and software that writes to sd cards with very high frequency over long periods of time (e.g. CBPi is constantly outputting several log files to the SD card I believe). A small cheap UPS can really bring up pi reliability as well, as power interruption during writing can lead to SD card corruption.

I'm sorry to hear that you were banned over at the CBPi Fb forum. You contributed a lot over there. I missed your post yesterday but I remember you mentioning Node-RED in a thread dealing with one of your CBPi addons a while ago. That, and the fact that there has been no real news about CBPi development for a while prompted me to take a look at Node-RED.
You are probably right about Windows. It was just a thought. I haven't actually had any issues with my Pi yet but I also boot Raspbian off a thumb drive rather than an SD card. I do keep several SD cards as back ups so I'll probably be fine.
 
I wish I were smarter with this software. given time i could probably figure it out. I have the Rpi. I installed brewpi and kind of have it working, but the lack of actual support and development have me questioning my decision. I also have a BCS 460 which is set up to run my fermentation control. I'm still building the panel, but I'm almost there. The lack of support there seems to be an issue as well. I would buy a new one, but with the documentation being incomplete, it's not a good way to spend $300 either. I may just have to be lame with my wifi inkbirds. lol
 
This is exciting. I'm thinking I can run Node-Red in a docker, and use one or more ESP8266 to sense temps and trip relays. That way I avoid the RPi SD card point of failure.
 
This is exciting. I'm thinking I can run Node-Red in a docker, and use one or more ESP8266 to sense temps and trip relays. That way I avoid the RPi SD card point of failure.
You definitely could.

I've sometimes had wifi issues with my ESP8266's, so I'd personally be cautious of this set up, and prefer a solution like brewpi-esp8266 or brewpiless for cold-side, where the ESP8266 still knows what to do when connectivity is lost. For hot-side as long as you are monitoring things, and latency was in check (no idea what this would be in this set up). I'd probably build in some dashboard notifications based on connectivity rather than relying on "oh it looks like this temperature hasn't changed in awhile..." :D as well
 
Thanks so much for posting this. Node RED is much easier to modify than anything else I've seen, and your flows are well done and easy to follow. [FWIW, the TiltPi monitoring program is also NodeRED, but much harder to follow.]

I loaded your flows into a fresh install of Node RED. Only needed to add:
node-red-contrib-sensor-ds18b20
node-red-dashboard
node-red-node-smooth​

Plus you have widgetlords-analog-in to measure volumes. I get the sense that's not a requirement to making everything else work. Is that correct?

Also, thanks for the insight on ESP8266. Given what you've said, I'll stick with RPi, and I'm looking into ordering your PCB.

Thanks again!
 
Thanks so much for posting this. Node RED is much easier to modify than anything else I've seen, and your flows are well done and easy to follow. [FWIW, the TiltPi monitoring program is also NodeRED, but much harder to follow.]

I loaded your flows into a fresh install of Node RED. Only needed to add:
node-red-contrib-sensor-ds18b20
node-red-dashboard
node-red-node-smooth​

Plus you have widgetlords-analog-in to measure volumes. I get the sense that's not a requirement to making everything else work. Is that correct?

Also, thanks for the insight on ESP8266. Given what you've said, I'll stick with RPi, and I'm looking into ordering your PCB.

Thanks again!

Hey! Glad to hear it! Widgetlords plugin was only to measure volumes, correct. I know it says on the repo that I'm not offering assistance with it, but if you need nudges or have any suggestions, let me know. That's just there to scare away users looking for a plug-n-play solution.
 
Cheers. I just ordered the PCB. :yes:

Now I'm working on electronics, and I'm open to suggestions. Looking at Hosehead or maybe sourcing parts from theelectricbrewery
 
Last edited:
Thanks for posting this. I've been interested in moving my setup to Node-Red. Craftbeerpi has worked well enough, but there are some random funny things that happen and I've been hopeful that a new version will fix it for a while. I will take a look at your flow. I was looking at using node-red-node-pi-gpiod since it allows me to use the node-red instance I'm running on my server. However, I've done absolutely nothing for this so far.
 
Thanks for posting that. I have most of the parts for my controller. Waiting for the time to put it together.

Cheers, Richard
 
@jangevaa Node Red seems really cool, finally got around to enabling it on my pi, and working on adapting your code to my single vessel ebiab. Certainly not plug and play, and excited to dive in to Node Red.
My basic setup has a thermometer in the kettle and on the kettle out for controlling the mash when I recirculate, sometimes I don't recirculate and would use the kettle thermometer to maintain temps. Would I be able to adapt the Boil PID to use one temp or the other depending on if the pump actor is on, and be suitable to maintain mash temps?

Also do you have any insight into setting up automated timers, or do you just use external timers and manually adjust the interface as needed.
 
@jangevaa Node Red seems really cool, finally got around to enabling it on my pi, and working on adapting your code to my single vessel ebiab. Certainly not plug and play, and excited to dive in to Node Red.
My basic setup has a thermometer in the kettle and on the kettle out for controlling the mash when I recirculate, sometimes I don't recirculate and would use the kettle thermometer to maintain temps. Would I be able to adapt the Boil PID to use one temp or the other depending on if the pump actor is on, and be suitable to maintain mash temps?

Also do you have any insight into setting up automated timers, or do you just use external timers and manually adjust the interface as needed.
I'll start by saying in a lot of cases here I think it will make more sense for somebody to start a new node-red app for their brewery and just borrow parts from mine here and there, e.g. a PID. Particularly if you haven't used node-red before. I do think you could add some logic here to do what you describe though. You may want 2 different PID parametrizations based on process, and perhaps a limiter function for mashing as well. Worth noting there are several PID plugins that are less... sprawling than what I've written. I did what I did because I wanted to output all the internal PID calculations to help with my tuning, the others otherwise likely work just as well (I'd hope).

I've played around with different things for timers; I've been working on mash schedule functionality here and there but it's not ready yet. There are several node-red plugins that offer timer functionality but integrating seamlessly into my dashboard is the more challenging part. At this point I can't personally recommend any particular plugin to get it done. A single timer is a simpler problem than mash scheduling at least...

Let me know how you get on here! There are folks a lot better with node-red than me on the node-red forum, which is a good resource as well.
 
I'll start by saying in a lot of cases here I think it will make more sense for somebody to start a new node-red app for their brewery and just borrow parts from mine here and there, e.g. a PID. Particularly if you haven't used node-red before. I do think you could add some logic here to do what you describe though. You may want 2 different PID parametrizations based on process, and perhaps a limiter function for mashing as well. Worth noting there are several PID plugins that are less... sprawling than what I've written. I did what I did because I wanted to output all the internal PID calculations to help with my tuning, the others otherwise likely work just as well (I'd hope).

I've played around with different things for timers; I've been working on mash schedule functionality here and there but it's not ready yet. There are several node-red plugins that offer timer functionality but integrating seamlessly into my dashboard is the more challenging part. At this point I can't personally recommend any particular plugin to get it done. A single timer is a simpler problem than mash scheduling at least...

Let me know how you get on here! There are folks a lot better with node-red than me on the node-red forum, which is a good resource as well.

Yeah I think just so I can understand everything better, I'll start from scratch and incorporate the things you've done, and add some things I've been thinking about, I'd assume with a node-red dashboard I could display a sort of real time temperature graph, and probably even color code based on if the pump is on or not, I'm thinking about tracking mash times and whirlpool times with temperature data. Might be a little ambitious just starting out though.

Could you give me a quick example of what a limiter function would do for mashing?
 
I'd assume with a node-red dashboard I could display a sort of real time temperature graph, and probably even color code based on if the pump is on or not, I'm thinking about tracking mash times and whirlpool times with temperature data. Might be a little ambitious just starting out though.
I highly recommend using influx db for this sort of time series data. If you are more experienced with data visualization, you could use something like vega for highly customizable plots. There is also a plug and play timeseries chart included in node-red-dashboard, but it leaves something to be desired.

I personally look at my temperature data on a separate dashboard (currently grafana), as I'm mostly using that for retro-analysis and tweaking rather than needing that displayed during a brew. Some of these visualization libraries are quite resource intensive, so for long time series especially, you may find incorporating it into your dashboard slows down your experience. Maybe.

Screen Shot 2020-05-28 at 12.04.05 PM.png


Could you give me a quick example of what a limiter function would do for mashing?

Basically instead of having your element from 0-100%, I limit mine usually to 0-30% output for mash temperature control. Using RIMS can be a little chaotic, for aggressive tunings especially, and I find that this mitigates a lot of that, and also addresses concerns of scorching. You could implement this various ways. The simplest would just be a switch that when active replaced your output from your PID algorithm to the minimum between that value and your limit value.
 
You definitely could.

I've sometimes had wifi issues with my ESP8266's, so I'd personally be cautious of this set up, and prefer a solution like brewpi-esp8266 or brewpiless for cold-side, where the ESP8266 still knows what to do when connectivity is lost. For hot-side as long as you are monitoring things, and latency was in check (no idea what this would be in this set up). I'd probably build in some dashboard notifications based on connectivity rather than relying on "oh it looks like this temperature hasn't changed in awhile..." :D as well
I came across your blog posts a few weeks back and now this.

I am mostly wrapping up my first build using Fermentrack and Brewpi-esp8266. I like this setup as I've had plenty of esp(s) laying around and I have a server that can host various VMs to meet my UI needs.

Obviously Node-Red is meant to be used with a Pi. But would you be able to nudge me towards any information about using my current setup (brewpi, esp, VMs) rather than a Pi? My goal would be to use it for fermentation control and honestly I think it would just be fun to dabble with. I'm pretty invested in Fermentrack for the time being but at the same time I am never satisfied if I don't have a project in shambles at any given point :) .
 
Node-RED is not restricted to raspberry pi by any means, and is often ran in a VM. It's been awhile, but if you can push JSON to brewpi like fermentrack does, I think that would do what you want. I don't recall exactly how that communication works, as it's been awhile since I was using fermentrack (now just use brewpiless as I am only controlling 1 fermentation chamber).

If you're interested in node-red for homebrewing applications, you may want to check out this new facebook group (not created by me, but I did join)
 

Latest posts

Back
Top