# Fermentation Controller

**URL:** <https://discourse.nodered.org/t/fermentation-controller/65517>\
**Category:** Share Your Projects\
**Created:** [24 July 2022 04:40 UTC](https://discourse.nodered.org/t/fermentation-controller/65517 "2022-07-24T04:40:35Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![ryanprel](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@ryanprel](https://discourse.nodered.org/u/ryanprel)\
**Post date:** [1 August 2022 19:19 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/22 "2022-08-01T19:19:55Z")

</div>

I'd love to see what your flow looks like if you don't mind sharing!

---

<div class="post-metadata">

**Author:** ![mauromago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mauromago/32/6576_2.png) [@mauromago](https://discourse.nodered.org/u/mauromago)\
**Post date:** [2 August 2022 21:06 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/23 "2022-08-02T21:06:21Z")

</div>

Sorry, busy busy days 😀

> [@Colin](#):
>
> Is it node-red-contrib-pid that you are using (possibly with node-red-contrib-timeprop)?

No it isn't. It is code inside a function node. It is quite coarse, set up is done directly in function node.

> [@ryanprel](#):
>
> I'd love to see what your flow looks like if you don't mind sharing!

No problem to share it, but now it is not loaded on system (RPi3). I suppose we will have harvest in middle of September, so I will have to set it up soon, I looks to do it asap and then post it here.

---

<div class="post-metadata">

**Author:** ![ryanprel](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@ryanprel](https://discourse.nodered.org/u/ryanprel)\
**Post date:** [5 August 2022 16:33 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/24 "2022-08-05T16:33:47Z")

</div>

Thanks! We'll start harvest in early September. I think my core functionality is mostly setup but lots of tweaking to do yet.

---

<div class="post-metadata">

**Author:** ![SonoraTechnical](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sonoratechnical/32/20033_2.png) [@SonoraTechnical](https://discourse.nodered.org/u/SonoraTechnical)\
**Post date:** [5 August 2022 19:01 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/25 "2022-08-05T19:01:56Z")

</div>

I use i2c enabled relay boards and digital input boards from

> **[8-Channel General Purpose SPDT Relay Controller with I2C Interface](https://store.ncd.io/product/8-channel-general-purpose-spdt-relay-controller-with-i2c-interface/)**
>
> 8 channel relay controller Board for arduino USB raspberry pi beaglebone RS485 with i2c expansion ideal for home automation industrial application

I do have the burden of then having to wire up my own sockets.... But I like the integration that NCD has with NodeRED for these devices.

---

<div class="post-metadata">

**Author:** ![ryanprel](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@ryanprel](https://discourse.nodered.org/u/ryanprel)\
**Post date:** [6 August 2022 04:49 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/26 "2022-08-06T04:49:34Z")

</div>

![Screen Shot 2022-08-05 at 11.43.38 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/47a7e2a4f9504b948570c180d18d13f09e8a5a70.png)  
Any idea how to get these dashboard setpoints and the Off/On status to load on deploy/dashboard refresh?

Here's a screen shot of the flow

 ![Screen Shot 2022-08-05 at 11.45.39 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d3c79cc54aa4c9b289b5d88568f76949c67c123e.png)

Here's the flow

```auto
[{"id":"f6200681b265563b","type":"tab","label":"Prod","disabled":false,"info":"","env":[]},{"id":"bbb2148c9420f548","type":"group","z":"f6200681b265563b","name":"Tank T1","style":{"fill":"#e3f3d3","label":true,"label-position":"n"},"nodes":["a95558832e711631","7c8d261e5f6d0998","79ef3fe1a242a713","bd1daf1565ee885c","897ba8f3f231a1f0","83830bf4b0698084","49cd2c020d59c024","bccca8d40a6d63f8","e016d9b888302a93","7b73ace1b6cdb759","10ba642e6415f895","694b4fe4d5a16fe4","ba17d2d3bffdffdc","d00cc0bcd37d570a","36355bdc381b94de","0d755e19e6dfa112","e2df700bbffcf19c","281d2c0adf9fce83","b1e07a828296e378","e777b04cf3dcd444","876bf077bc5133ad","243b63027f532058","d6968efefdcf0985","5e673bd9ab566df8","fd8336d590e9745e","d6526e17959cd5b1","fa5eeedaed9f31e2","73cf7760eb69342b","42beff1b1c1f36b1","8d16a88be38e878a","e39e566a7f7e8e14","729b93d56e548fa5","7f004df53f2dab01"],"x":14,"y":19,"w":1112,"h":542},{"id":"a95558832e711631","type":"debug","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-On","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":950,"y":100,"wires":[]},{"id":"7c8d261e5f6d0998","type":"mqtt out","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","topic":"Power1/outlet/1/set","qos":"2","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"8aa408ca715b9482","x":980,"y":160,"wires":[]},{"id":"79ef3fe1a242a713","type":"debug","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Off","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":870,"y":220,"wires":[]},{"id":"bd1daf1565ee885c","type":"change","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"Upper","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":140,"wires":[["7c8d261e5f6d0998"]]},{"id":"897ba8f3f231a1f0","type":"change","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"Lower","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":180,"wires":[["7c8d261e5f6d0998"]]},{"id":"83830bf4b0698084","type":"mqtt in","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-MQTT","topic":"TankT1-Temp/temperature","qos":"2","datatype":"auto","broker":"8aa408ca715b9482","nl":false,"rap":true,"rh":0,"inputs":0,"x":110,"y":180,"wires":[["e39e566a7f7e8e14","8d16a88be38e878a"]]},{"id":"49cd2c020d59c024","type":"influxdb out","z":"f6200681b265563b","g":"bbb2148c9420f548","influxdb":"2e2baf68b726c3bb","name":"Temp","measurement":"Temp","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":350,"y":220,"wires":[]},{"id":"bccca8d40a6d63f8","type":"switch","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"Valve","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"TankT1-Upper-SP","vt":"flow"},{"t":"lte","v":"TankT1-Lower-SP","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":550,"y":160,"wires":[["bd1daf1565ee885c","a95558832e711631"],["897ba8f3f231a1f0","79ef3fe1a242a713"],["e016d9b888302a93"]]},{"id":"e016d9b888302a93","type":"debug","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"In-Range","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":660,"y":220,"wires":[]},{"id":"7b73ace1b6cdb759","type":"unit-converter","z":"f6200681b265563b","g":"bbb2148c9420f548","category":"temperature","inputUnit":"F","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":true,"outputFieldDecimals":"1","name":"Convert","x":340,"y":180,"wires":[["49cd2c020d59c024","876bf077bc5133ad","bccca8d40a6d63f8","fa5eeedaed9f31e2"]]},{"id":"10ba642e6415f895","type":"inject","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"80","payloadType":"num","x":110,"y":260,"wires":[["e2df700bbffcf19c"]]},{"id":"694b4fe4d5a16fe4","type":"inject","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":110,"y":300,"wires":[["e2df700bbffcf19c"]]},{"id":"ba17d2d3bffdffdc","type":"inject","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"72","payloadType":"num","x":110,"y":340,"wires":[["e2df700bbffcf19c"]]},{"id":"d00cc0bcd37d570a","type":"inject","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"77","payloadType":"num","x":110,"y":420,"wires":[["281d2c0adf9fce83"]]},{"id":"36355bdc381b94de","type":"inject","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"71","payloadType":"num","x":110,"y":460,"wires":[["281d2c0adf9fce83"]]},{"id":"0d755e19e6dfa112","type":"inject","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"65","payloadType":"num","x":110,"y":500,"wires":[["281d2c0adf9fce83"]]},{"id":"e2df700bbffcf19c","type":"change","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Upper Temp","rules":[{"t":"set","p":"TankT1-Upper-SP","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":280,"wires":[["b1e07a828296e378","d6526e17959cd5b1"]]},{"id":"281d2c0adf9fce83","type":"change","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"Tank1-Lower Temp","rules":[{"t":"set","p":"TankT1-Lower-SP","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":380,"wires":[["e777b04cf3dcd444","73cf7760eb69342b"]]},{"id":"b1e07a828296e378","type":"debug","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"Upper Temp","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":280,"wires":[]},{"id":"e777b04cf3dcd444","type":"debug","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"Lower Temp","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":380,"wires":[]},{"id":"876bf077bc5133ad","type":"debug","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":120,"wires":[]},{"id":"243b63027f532058","type":"inject","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Upper","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"TankT1-Upper-SP","payloadType":"flow","x":430,"y":480,"wires":[["d6968efefdcf0985"]]},{"id":"d6968efefdcf0985","type":"debug","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Setpoints","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":500,"wires":[]},{"id":"5e673bd9ab566df8","type":"inject","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Lower","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"TankT1-Lower-SP","payloadType":"flow","x":430,"y":520,"wires":[["d6968efefdcf0985"]]},{"id":"fd8336d590e9745e","type":"ui_chart","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","group":"a23b2bf2f261c86b","order":1,"width":"6","height":"6","label":"Tank-Graph","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":950,"y":440,"wires":[[]]},{"id":"d6526e17959cd5b1","type":"ui_numeric","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","label":"TankT1-Upper","tooltip":"","group":"2df3817beb943471","order":2,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"topic","topicType":"msg","format":"{{value}}","min":"60","max":"75","step":1,"className":"","x":420,"y":320,"wires":[["e2df700bbffcf19c"]]},{"id":"fa5eeedaed9f31e2","type":"warp","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"","scope":["fd8336d590e9745e"],"destination":"selected","x":500,"y":220,"wires":[]},{"id":"73cf7760eb69342b","type":"ui_numeric","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Lower","label":"TankT1-Lower","tooltip":"","group":"2df3817beb943471","order":2,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"topic","topicType":"msg","format":"{{value}}","min":"60","max":"75","step":1,"className":"","x":420,"y":420,"wires":[["281d2c0adf9fce83"]]},{"id":"42beff1b1c1f36b1","type":"ui_switch","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"Off/On","label":"Off/On","tooltip":"","group":"2df3817beb943471","order":2,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"control","topicType":"str","style":"","onvalue":"open","onvalueType":"str","onicon":"","oncolor":"","offvalue":"close","offvalueType":"str","officon":"","offcolor":"","animate":false,"className":"","x":90,"y":60,"wires":[["e39e566a7f7e8e14"]]},{"id":"8d16a88be38e878a","type":"dead-man-switch","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Deadman","delay":"10","delayUnit":"minutes","x":130,"y":120,"wires":[[]]},{"id":"e39e566a7f7e8e14","type":"gate","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Control","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":true,"storeName":"default","x":360,"y":120,"wires":[["7b73ace1b6cdb759"]]},{"id":"729b93d56e548fa5","type":"status","z":"f6200681b265563b","g":"bbb2148c9420f548","name":"TankT1-Status","scope":["e39e566a7f7e8e14"],"x":840,"y":280,"wires":[["7f004df53f2dab01"]]},{"id":"7f004df53f2dab01","type":"ui_text","z":"f6200681b265563b","g":"bbb2148c9420f548","group":"2df3817beb943471","order":1,"width":0,"height":0,"name":"TankT1-Status","label":"Status","format":"{{msg.status.text}}","layout":"row-spread","className":"","x":1020,"y":280,"wires":[]},{"id":"13b36e68627b7415","type":"debug","z":"f6200681b265563b","name":"TankT15-On","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":950,"y":640,"wires":[]},{"id":"9b64498f6f9a74e8","type":"mqtt out","z":"f6200681b265563b","name":"","topic":"Power1/outlet/1/set","qos":"2","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"8aa408ca715b9482","x":980,"y":700,"wires":[]},{"id":"8c5ba3e681acbf64","type":"debug","z":"f6200681b265563b","name":"TankT15-Off","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":870,"y":760,"wires":[]},{"id":"67041ee0543d564d","type":"change","z":"f6200681b265563b","name":"Upper","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":680,"wires":[["9b64498f6f9a74e8"]]},{"id":"4e3497978ce50396","type":"change","z":"f6200681b265563b","name":"Lower","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":720,"wires":[["9b64498f6f9a74e8"]]},{"id":"7ecdfb771dacb4ca","type":"mqtt in","z":"f6200681b265563b","name":"TankT15-MQTT","topic":"TankT15-Temp/temperature","qos":"2","datatype":"auto","broker":"8aa408ca715b9482","nl":false,"rap":true,"rh":0,"inputs":0,"x":120,"y":720,"wires":[["80efe291626ed1e3","1e4ddd927053060a"]]},{"id":"e9312467d83315eb","type":"influxdb out","z":"f6200681b265563b","influxdb":"2e2baf68b726c3bb","name":"Temp","measurement":"Temp","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":350,"y":760,"wires":[]},{"id":"0416ca7367ab7a83","type":"switch","z":"f6200681b265563b","name":"Valve","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"TankT15-Upper-SP","vt":"flow"},{"t":"lte","v":"TankT15-Lower-SP","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":550,"y":700,"wires":[["67041ee0543d564d","13b36e68627b7415"],["4e3497978ce50396","8c5ba3e681acbf64"],["6c34139c2a594d33"]]},{"id":"6c34139c2a594d33","type":"debug","z":"f6200681b265563b","name":"In-Range","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":660,"y":760,"wires":[]},{"id":"3bb28087b69c0b90","type":"unit-converter","z":"f6200681b265563b","category":"temperature","inputUnit":"F","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":true,"outputFieldDecimals":"1","name":"Convert","x":340,"y":720,"wires":[["e9312467d83315eb","08c2661f9b299d23","0416ca7367ab7a83","cff9fd1d236db3a6"]]},{"id":"c67c3ba121b65d0f","type":"inject","z":"f6200681b265563b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"80","payloadType":"num","x":110,"y":800,"wires":[["4e87f3c106c2d52e"]]},{"id":"fe5ed785e8ce38ec","type":"comment","z":"f6200681b265563b","name":"Lower limit","info":"","x":100,"y":920,"wires":[]},{"id":"de17094dc849a95d","type":"inject","z":"f6200681b265563b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":110,"y":840,"wires":[["4e87f3c106c2d52e"]]},{"id":"b4879c5fd9e2d414","type":"inject","z":"f6200681b265563b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"72","payloadType":"num","x":110,"y":880,"wires":[["4e87f3c106c2d52e"]]},{"id":"c57a6d3c06c3bd12","type":"inject","z":"f6200681b265563b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"77","payloadType":"num","x":110,"y":960,"wires":[["b752b4e853ee0cc4"]]},{"id":"1299d6d41122e14a","type":"inject","z":"f6200681b265563b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"71","payloadType":"num","x":110,"y":1000,"wires":[["b752b4e853ee0cc4"]]},{"id":"65bc82e157c347d2","type":"inject","z":"f6200681b265563b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"65","payloadType":"num","x":110,"y":1040,"wires":[["b752b4e853ee0cc4"]]},{"id":"4e87f3c106c2d52e","type":"change","z":"f6200681b265563b","name":"TankT15-Upper Temp","rules":[{"t":"set","p":"TankT15-Upper-SP","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":820,"wires":[["9f9c9d9cbe9688fa","c65a89c9b07b23c9"]]},{"id":"b752b4e853ee0cc4","type":"change","z":"f6200681b265563b","name":"Tank15-Lower Temp","rules":[{"t":"set","p":"TankT15-Lower-SP","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":920,"wires":[["61e601c59b377dc6","91668060c875ce77"]]},{"id":"9f9c9d9cbe9688fa","type":"debug","z":"f6200681b265563b","name":"Upper Temp","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":800,"wires":[]},{"id":"61e601c59b377dc6","type":"debug","z":"f6200681b265563b","name":"Lower Temp","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":900,"wires":[]},{"id":"08c2661f9b299d23","type":"debug","z":"f6200681b265563b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":660,"wires":[]},{"id":"c65a89c9b07b23c9","type":"ui_numeric","z":"f6200681b265563b","name":"","label":"TankT15-Upper","tooltip":"","group":"b0de8850acfb7f3a","order":2,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"topic","topicType":"msg","format":"{{value}}","min":"60","max":"75","step":1,"className":"","x":420,"y":860,"wires":[["4e87f3c106c2d52e"]]},{"id":"cff9fd1d236db3a6","type":"warp","z":"f6200681b265563b","name":"","scope":["fd8336d590e9745e"],"destination":"selected","x":500,"y":760,"wires":[]},{"id":"91668060c875ce77","type":"ui_numeric","z":"f6200681b265563b","name":"TankT15-Lower","label":"TankT15-Lower","tooltip":"","group":"b0de8850acfb7f3a","order":2,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"topic","topicType":"msg","format":"{{value}}","min":"60","max":"75","step":1,"className":"","x":420,"y":960,"wires":[["b752b4e853ee0cc4"]]},{"id":"48c8657434577994","type":"ui_switch","z":"f6200681b265563b","name":"Off/On","label":"Off/On","tooltip":"","group":"b0de8850acfb7f3a","order":2,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"control","topicType":"str","style":"","onvalue":"open","onvalueType":"str","onicon":"","oncolor":"","offvalue":"close","offvalueType":"str","officon":"","offcolor":"","animate":false,"className":"","x":90,"y":600,"wires":[["80efe291626ed1e3"]]},{"id":"1e4ddd927053060a","type":"dead-man-switch","z":"f6200681b265563b","name":"TankT15-Deadman","delay":"10","delayUnit":"minutes","x":130,"y":660,"wires":[[]]},{"id":"80efe291626ed1e3","type":"gate","z":"f6200681b265563b","name":"TankT15-Control","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":true,"storeName":"default","x":370,"y":660,"wires":[["3bb28087b69c0b90"]]},{"id":"e0540125c53ffe22","type":"status","z":"f6200681b265563b","name":"TankT15-Status","scope":["80efe291626ed1e3"],"x":820,"y":840,"wires":[["c1d9dd74c6c2a932"]]},{"id":"c1d9dd74c6c2a932","type":"ui_text","z":"f6200681b265563b","group":"b0de8850acfb7f3a","order":1,"width":0,"height":0,"name":"TankT15-Status","label":"Status","format":"{{msg.status.text}}","layout":"row-spread","className":"","x":1000,"y":840,"wires":[]},{"id":"8aa408ca715b9482","type":"mqtt-broker","name":"MQTTBroker","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"2e2baf68b726c3bb","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"sensors","name":"Sensors","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true},{"id":"a23b2bf2f261c86b","type":"ui_group","name":"Graph","tab":"75e2c4a4bae21b23","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"2df3817beb943471","type":"ui_group","name":"TankT1-Controls","tab":"75e2c4a4bae21b23","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"b0de8850acfb7f3a","type":"ui_group","name":"TankT15-Controls","tab":"75e2c4a4bae21b23","order":3,"disp":true,"width":"6","collapse":false,"className":""},{"id":"75e2c4a4bae21b23","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [6 August 2022 07:09 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/27 "2022-08-06T07:09:44Z")

</div>

> [@ryanprel](#):
>
> Any idea how to get these dashboard setpoints and the Off/On status to load on deploy/dashboard refresh?

Take a look at the ui\_ui\_control as that allows dynamic control of the dashboard.  
 ![ui_control](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fb9f9bd3f14c5c50b49fe3d2c86b2dc0e436b36e.png)  
Yo could connect the output of this node to a change node or a function node that sends a msg.payload with the default setpoints to the ui\_numeric node.

**Edit:** Sorry just looked again at your flow. I don't think the ui\_numeric node will accept an input to set the 'min' or 'max' values dynamically.

**Edit: Edit:** The ui\_switch does allow an external input (msg.payload) to affect the switch node.  
 ![switch](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/57ee39e69f1d3662b5fe8a507872af3a79dc04f6.png)

---

<div class="post-metadata">

**Author:** ![ryanprel](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@ryanprel](https://discourse.nodered.org/u/ryanprel)\
**Post date:** [8 August 2022 22:15 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/28 "2022-08-08T22:15:14Z")

</div>

The min/max numbers don't have to change. I would just be trying to accurately show what the current setpoint numbers are. How would I load the current status into ui\_switch on NR startup?

---

<div class="post-metadata">

**Author:** ![ryanprel](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@ryanprel](https://discourse.nodered.org/u/ryanprel)\
**Post date:** [14 August 2022 04:32 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/29 "2022-08-14T04:32:52Z")

</div>

I have roughly 17 tanks that I'll be doing temperature control on and I'm trying to figure out how to use some variable based naming so that I can set the name for a portion of each variable once for an entire group.  
For example, I'd like to set Tank1 once somewhere in the logic for this group and then be able to reference that variable in the naming scheme for each group. Any thoughts on how to do that? In this case, Tank1 would be replaced by a variable that would be set somewhere else.

 ![Screen Shot 2022-08-13 at 11.26.52 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e88f1ed9f597d1575b35f153d45e9331c5537b01.png)

Trying to limit the amount of work needed when duplicating this logic 17 times and also when I'm changing things later on.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 August 2022 06:11 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/30 "2022-08-14T06:11:25Z")

</div>

You could design the control flow as a subflow and set the id in the subflow settings for each one.

If there are subtle differences between the tanks then those differences could also be configured through the subflow settings.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [14 August 2022 22:03 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/31 "2022-08-14T22:03:35Z")

</div>

> [@ryanprel](#):
>
> Tank1 would be replaced by a variable that would be set somewhere else.

I'm not sure exactly what you need, but this might help. When I want to control a system with many identical or nearly identical devices, I define the system state as an array of objects. In your case, it might be something like

```auto
let state = [tank0,tank1,tank2]; // and so on
let tank0 = {"temperature":80,"capacity":50,startDate:new Date()}; 

```

A device can be addressed by its array index, and its properties obtained in the usual way. This flow should give you the general idea.

```auto
[{"id":"597738a8269d2dd1","type":"function","z":"341d67332362b102","name":"state","func":"let tank0 = {\"temperature\":80,\"capacity\":50,startDate:new Date()}\nlet tank1 = { \"temperature\": 70, \"capacity\": 60, startDate: new Date() }\nlet tank2 = { \"temperature\": 75, \"capacity\": 70, startDate: new Date() }\nlet state = [tank0,tank1,tank2]\nmsg.payload = state\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":380,"wires":[["e5ac0ed4d948efbb"]]},{"id":"cc8158943af47217","type":"inject","z":"341d67332362b102","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":420,"y":380,"wires":[["597738a8269d2dd1"]]},{"id":"e5ac0ed4d948efbb","type":"change","z":"341d67332362b102","name":"","rules":[{"t":"set","p":"state","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":380,"wires":[[]]},{"id":"fb2945d5c997c06c","type":"change","z":"341d67332362b102","name":"temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"state[msg.payload]temperature","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":440,"wires":[["8591d20017759858"]]},{"id":"8591d20017759858","type":"debug","z":"341d67332362b102","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":500,"wires":[]},{"id":"e967adc5e24a84a9","type":"inject","z":"341d67332362b102","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":410,"y":460,"wires":[["8ae1df5b8ac98e2d"]]},{"id":"92cd5a46016445fe","type":"inject","z":"341d67332362b102","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":410,"y":500,"wires":[["8ae1df5b8ac98e2d"]]},{"id":"dde491cf2ee260fe","type":"inject","z":"341d67332362b102","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2","payloadType":"num","x":410,"y":540,"wires":[["8ae1df5b8ac98e2d"]]},{"id":"ba236388614f6877","type":"change","z":"341d67332362b102","name":"capacity","rules":[{"t":"set","p":"payload","pt":"msg","to":"state[msg.payload]capacity","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":480,"wires":[["8591d20017759858"]]},{"id":"fc5c04c45b4ba20c","type":"change","z":"341d67332362b102","name":"start","rules":[{"t":"set","p":"payload","pt":"msg","to":"state[msg.payload]startDate","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":520,"wires":[["8591d20017759858"]]},{"id":"a236d97d893e1430","type":"change","z":"341d67332362b102","name":"tank","rules":[{"t":"set","p":"payload","pt":"msg","to":"state[msg.payload]","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":560,"wires":[["8591d20017759858"]]},{"id":"8ae1df5b8ac98e2d","type":"junction","z":"341d67332362b102","x":500,"y":500,"wires":[["fb2945d5c997c06c","ba236388614f6877","fc5c04c45b4ba20c","a236d97d893e1430"]]}]

```

---

<div class="post-metadata">

**Author:** ![ryanprel](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@ryanprel](https://discourse.nodered.org/u/ryanprel)\
**Post date:** [15 August 2022 03:20 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/32 "2022-08-15T03:20:00Z")

</div>

What I'm trying to do is have each tank in a separate flow and then for every time (for example) Tank-T1 or Tank-T15 or Tank-C7 shows up in a Title or variable name, make it so that the specific tank name is pulled from a variable set somewhere in that flow. For example [Tank-ID]-Valve becomes TankT1-Valve or [Tank-ID]-Upper-SP becomes TankT1-Upper-SP. Does that make more sense?

 ![Screen Shot 2022-08-14 at 10.15.19 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/78c895a18f38ba4c5baf4921ad652d59813a7e01.png)

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [16 August 2022 07:24 UTC](https://discourse.nodered.org/t/fermentation-controller/65517/33 "2022-08-16T07:24:59Z")

</div>

did you look at my flow i added to the post .  
I use drop down window for target temps on my temp controller.  
I actually broke my vessels up to keep clean in dashbard.  
here is what it looks like. (I only have 3 fermenters)

 ![dashboardexample.PNG](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/8/882366eefc3e44e22c94e9208daecd3f9503e058.jpeg)  
I use the 8 channel relay board like shared above also, however pay attention to how they work.  
Mine uses an active low to trigger relay, where my solo coil relays use a high to trigger the relay.

[Previous page](https://discourse.nodered.org/t/fermentation-controller/65517.md?page=1)
