ok so I am still wet behind the ears on node red but I have help and i have learned a lot.
However im confused on what to do for chilling my fermenters in my brewery.
i have been playing with some different ways people have done things in the forum.
however im still lost and i have figured out somethings.
here is my test flow. with different options. these flows were not created by me. but i have modified a little.
important info raspberry pi4b+ node version 2.2.1
[{"id":"b4973237.46ab6","type":"subflow","name":"Process Simulation","info":"","in":[{"x":37,"y":103,"wires":[{"id":"ec719d4d.0d54f8"}]}],"out":[{"x":728.5,"y":294,"wires":[{"id":"ae1a6e5.d4c0d9","port":0}]}]},{"id":"7fe4b5c3.32e58c","type":"function","z":"b4973237.46ab6","name":"30 sec RC + 20","func":"// Applies a simple RC low pass filter to incoming payload values\nvar tc = 30*1000; // time constant in milliseconds\n\nvar lastValue = context.get('lastValue');\nif (typeof lastValue == \"undefined\") lastValue = msg.payload;\nvar lastTime = context.get('lastTime') || null;\nvar now = new Date();\nvar currentValue = msg.payload;\nif (lastTime === null) {\n // first time through\n newValue = currentValue;\n} else {\n var dt = now - lastTime;\n var newValue;\n \n if (dt > 0) {\n var dtotc = dt / tc;\n newValue = lastValue * (1 - dtotc) + currentValue * dtotc;\n } else {\n // no time has elapsed leave output the same as last time\n newValue = lastValue;\n }\n}\ncontext.set('lastValue', newValue);\ncontext.set('lastTime', now);\n\nmsg.payload = newValue + 20;\nreturn msg;","outputs":1,"noerr":0,"x":626.5,"y":207,"wires":[["ae1a6e5.d4c0d9"]]},{"id":"1bacd004.9753c","type":"inject","z":"b4973237.46ab6","name":"Inject -0.2 at start","repeat":"","crontab":"","once":true,"topic":"","payload":"-0.2","payloadType":"num","x":134.5,"y":30,"wires":[["ec719d4d.0d54f8"]]},{"id":"999a52c2.f465f","type":"function","z":"b4973237.46ab6","name":"10 sec RC","func":"// Applies a simple RC low pass filter to incoming payload values\nvar tc = 10*1000; // time constant in milliseconds\n\nvar lastValue = context.get('lastValue');\nif (typeof lastValue == \"undefined\") lastValue = msg.payload;\nvar lastTime = context.get('lastTime') || null;\nvar now = new Date();\nvar currentValue = msg.payload;\nif (lastTime === null) {\n // first time through\n newValue = currentValue;\n} else {\n var dt = now - lastTime;\n var newValue;\n \n if (dt > 0) {\n var dtotc = dt / tc;\n newValue = lastValue * (1 - dtotc) + currentValue * dtotc;\n } else {\n // no time has elapsed leave output the same as last time\n newValue = lastValue;\n }\n}\ncontext.set('lastValue', newValue);\ncontext.set('lastTime', now);\n\nmsg.payload = newValue;\nreturn msg;","outputs":1,"noerr":0,"x":451,"y":207,"wires":[["7fe4b5c3.32e58c"]]},{"id":"ec719d4d.0d54f8","type":"delay","z":"b4973237.46ab6","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":268,"y":104,"wires":[["ede39236.1961f8"]]},{"id":"a823c9cf.2a6178","type":"function","z":"b4973237.46ab6","name":"2 msg transport delay","func":"// stores messages in a fifo until the specified number have been received, \n// then releases them as new messages are received.\n// during the filling phase the earliest message is passed on each time \n// a message is received, but it is also left in the fifo\nvar fifoMaxLength = 2;\nvar fifo = context.get('fifo') || [];\n// push the new message onto the top of the array, messages are shifted down and\n// drop off the front\nvar length = fifo.push(msg); // returns new length\nif (length > fifoMaxLength) {\n newMsg = fifo.shift();\n} else {\n // not full yet, make a copy of the msg and pass it on\n var newMsg = JSON.parse(JSON.stringify(fifo[0]));\n}\ncontext.set('fifo', fifo);\nreturn newMsg;","outputs":1,"noerr":0,"x":258,"y":208,"wires":[["999a52c2.f465f"]]},{"id":"ae1a6e5.d4c0d9","type":"function","z":"b4973237.46ab6","name":"Clear all except payload","func":"msg2 = {payload: msg.payload};\nreturn msg2;","outputs":1,"noerr":0,"x":545,"y":293,"wires":[[]]},{"id":"ede39236.1961f8","type":"range","z":"b4973237.46ab6","minin":"0","maxin":"1","minout":"0","maxout":"100","action":"scale","round":false,"name":"","x":87,"y":208,"wires":[["a823c9cf.2a6178"]]},{"id":"f5f5d3a26603b1a4","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"e0cb2a8c.4402a8","type":"PID","z":"f5f5d3a26603b1a4","name":"","setpoint":"50","pb":"22","ti":"24","td":"6","integral_default":"0","smooth_factor":"0","max_interval":600,"enable":"0","disabled_op":"1","x":501.6666564941406,"y":261.00000762939453,"wires":[["5ec4239b.34e174","e94f888a.130a88"]]},{"id":"f70949c8.aab988","type":"change","z":"f5f5d3a26603b1a4","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"op","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":741.1666564941406,"y":336.00000762939453,"wires":[["9f58a52d.076dd"]]},{"id":"2792f805.066c78","type":"inject","z":"f5f5d3a26603b1a4","name":"Setpoint 30","repeat":"","crontab":"","once":false,"topic":"setpoint","payload":"30","payloadType":"num","x":243.66665649414062,"y":284.00000762939453,"wires":[["e0cb2a8c.4402a8"]]},{"id":"1bf3ce16.c3ae02","type":"inject","z":"f5f5d3a26603b1a4","name":"Setpoint 80","repeat":"","crontab":"","once":false,"topic":"setpoint","payload":"80","payloadType":"num","x":242.16665649414062,"y":333.00000762939453,"wires":[["e0cb2a8c.4402a8"]]},{"id":"f69bbf05.bdd49","type":"inject","z":"f5f5d3a26603b1a4","name":"enable","repeat":"","crontab":"","once":false,"topic":"enable","payload":"true","payloadType":"bool","x":234.66665649414062,"y":169.00000762939453,"wires":[["e0cb2a8c.4402a8"]]},{"id":"143523b2.2f165c","type":"inject","z":"f5f5d3a26603b1a4","name":"disable","repeat":"","crontab":"","once":false,"topic":"enable","payload":"false","payloadType":"bool","x":235.16665649414062,"y":219.00000762939453,"wires":[["e0cb2a8c.4402a8"]]},{"id":"5ec4239b.34e174","type":"subflow:b4973237.46ab6","z":"f5f5d3a26603b1a4","x":504.6666564941406,"y":188.00000762939453,"wires":[["de738fc5.75e4c8","e0cb2a8c.4402a8"]]},{"id":"de738fc5.75e4c8","type":"change","z":"f5f5d3a26603b1a4","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"pv","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":725.6666564941406,"y":187.00000762939453,"wires":[["9f58a52d.076dd"]]},{"id":"e94f888a.130a88","type":"range","z":"f5f5d3a26603b1a4","minin":"0","maxin":"1","minout":"0","maxout":"25","action":"scale","round":false,"name":"Scale power","x":566.6666564941406,"y":336.00000762939453,"wires":[["f70949c8.aab988"]]},{"id":"9f58a52d.076dd","type":"ui_chart","z":"f5f5d3a26603b1a4","name":"","group":"c45a83a3.d00908","order":0,"width":"6","height":"6","label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"100","removeOlder":"3","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"colors":["#1f77b4","#cf0005","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":930.6666564941406,"y":261.00000762939453,"wires":[[],[]]},{"id":"bef0a1f8.2e2cf","type":"inject","z":"f5f5d3a26603b1a4","name":"Clear chart on deploy","repeat":"","crontab":"","once":true,"topic":"","payload":"{\"data\":[]}","payloadType":"json","x":491.6666564941406,"y":404.00000762939453,"wires":[["9079ffaf.4a096"]]},{"id":"9079ffaf.4a096","type":"change","z":"f5f5d3a26603b1a4","name":"","rules":[{"t":"move","p":"payload.data","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":727.6666564941406,"y":404.00000762939453,"wires":[["9f58a52d.076dd"]]},{"id":"33aa1cd.c73cce4","type":"ui_chart","z":"f5f5d3a26603b1a4","name":"","group":"251e880a.3e91e8","order":0,"width":"10","height":"5","label":"{{msg.label}}","chartType":"line","legend":"false","xformat":"HH","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1104,"y":1058,"wires":[[]]},{"id":"702e7146.70cdc","type":"ramp-thermostat","z":"f5f5d3a26603b1a4","name":"profiles","profile":"f0b7f6f376448e9a","hysteresisplus":".5","hysteresisminus":"0","x":794,"y":1058,"wires":[[],[],["7afc28cc.743e08"]]},{"id":"7afc28cc.743e08","type":"function","z":"f5f5d3a26603b1a4","name":"map","func":"var p = msg.payload;\nvar c = {};\nc.data = [];\nvar data = [];\n\np.points.forEach(function(point) {\n var key = Object.keys(point);\n data.push({\"x\": \"2018-11-21T\"+key+\":00\", \"y\":point[key]});\n});\n\nc.series = [\"Profile\"];\nc.data = [data];\nc.labels = [\"\"];\n\nmsg.label = p.name;\nmsg.payload = [c];\n\nreturn msg;","outputs":1,"noerr":0,"x":964,"y":1058,"wires":[["33aa1cd.c73cce4"]]},{"id":"208cc6eb.54a05a","type":"inject","z":"f5f5d3a26603b1a4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"getProfile","payload":"office","payloadType":"str","x":1130,"y":867,"wires":[["702e7146.70cdc"]]},{"id":"56d0c1f7131de7c3","type":"inject","z":"f5f5d3a26603b1a4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"getProfile","payload":"brewery","payloadType":"str","x":620,"y":1137,"wires":[["702e7146.70cdc"]]},{"id":"b7616cc2d3d1611e","type":"ui_dropdown","z":"f5f5d3a26603b1a4","name":"","label":"Beerschedules","tooltip":"","place":"Select option","group":"251e880a.3e91e8","order":13,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"brewery","value":"brewery","type":"str"},{"label":"office","value":"office","type":"str"},{"label":"Rusty Dicks","value":"Rusty Dicks IPA","type":"str"}],"payload":"","topic":"getProfile","x":414,"y":697,"wires":[["2a59f0857c928d24"]]},{"id":"2a59f0857c928d24","type":"switch","z":"f5f5d3a26603b1a4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"brewery","vt":"str"},{"t":"eq","v":"office","vt":"str"},{"t":"eq","v":"Rusty Dicks IPA","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":613,"y":695,"wires":[["702e7146.70cdc"],["702e7146.70cdc"],["702e7146.70cdc"]]},{"id":"85f30912a739dca5","type":"inject","z":"f5f5d3a26603b1a4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"PT","payload":"ecb7","payloadType":"global","x":562,"y":1040,"wires":[["702e7146.70cdc"]]},{"id":"bc4e34d1e54f3075","type":"switch","z":"f5f5d3a26603b1a4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"Mashlimit","vt":"global"},{"t":"eq","v":"Mashlimit","vt":"global"},{"t":"gt","v":"Mashlimit","vt":"global"}],"checkall":"true","repair":false,"outputs":3,"x":753,"y":1395,"wires":[[],[],["6cee116cc364aece"]]},{"id":"6cee116cc364aece","type":"change","z":"f5f5d3a26603b1a4","name":"Higher than limit value (remove power from element)","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1083,"y":1395,"wires":[["1657929d7dae820f"]]},{"id":"d30e19ff5fd093e6","type":"change","z":"f5f5d3a26603b1a4","name":"","rules":[{"t":"set","p":"Mashlimit","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":713,"y":1275,"wires":[[]]},{"id":"1657929d7dae820f","type":"change","z":"f5f5d3a26603b1a4","name":"power to 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1453,"y":1395,"wires":[["dadc08ea1053780c","3f21604ee04369fd","ab8738f27e5edf05","01c41db68cecae84"]]},{"id":"06ea836a98bfe38a","type":"ui_switch","z":"f5f5d3a26603b1a4","name":"Power on/off","label":"","tooltip":"","group":"19ad7abf6c8af815","order":4,"width":6,"height":1,"passthru":false,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1873,"y":1395,"wires":[["f03e96163a27a4d1","2204a3151339b23b"]]},{"id":"19fe658070871b72","type":"change","z":"f5f5d3a26603b1a4","name":"blocked sends message false","rules":[{"t":"set","p":"blocked","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2313,"y":1415,"wires":[["fd295445f712ca8b"]]},{"id":"dadc08ea1053780c","type":"change","z":"f5f5d3a26603b1a4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1663,"y":1395,"wires":[["06ea836a98bfe38a"]]},{"id":"f03e96163a27a4d1","type":"switch","z":"f5f5d3a26603b1a4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":2053,"y":1395,"wires":[["8d1b9df4b24f1f84","ffa11e798a95ca4a"],["19fe658070871b72","ffa11e798a95ca4a"]]},{"id":"8d1b9df4b24f1f84","type":"change","z":"f5f5d3a26603b1a4","name":"unblocked gives message true","rules":[{"t":"set","p":"blocked","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2313,"y":1375,"wires":[[]]},{"id":"2204a3151339b23b","type":"ui_led","z":"f5f5d3a26603b1a4","order":6,"group":"19ad7abf6c8af815","width":6,"height":1,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#ff0000","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"Mash ","x":2053,"y":1355,"wires":[]},{"id":"662efd1c98676612","type":"ui_text","z":"f5f5d3a26603b1a4","group":"19ad7abf6c8af815","order":9,"width":6,"height":1,"name":"MashTemperature shut off value ","label":"MashTemperature shut off value ","format":"{{msg.payload}}","layout":"row-left","x":373,"y":1235,"wires":[]},{"id":"e7fea69da329345e","type":"ui_text","z":"f5f5d3a26603b1a4","group":"19ad7abf6c8af815","order":10,"width":6,"height":1,"name":"Mash Power","label":"Mash Power","format":"{{msg.payload}}","layout":"row-spread","x":1883,"y":1355,"wires":[]},{"id":"3f21604ee04369fd","type":"ui_gauge","z":"f5f5d3a26603b1a4","name":"Mash Current power gauge","group":"19ad7abf6c8af815","order":7,"width":6,"height":6,"gtype":"gage","title":"Mash Current power","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#ff0000","#00ff00","#ff0000"],"seg1":"40","seg2":"60","x":1823,"y":1235,"wires":[]},{"id":"ab8738f27e5edf05","type":"rpi-gpio out","z":"f5f5d3a26603b1a4","name":"Mash ","pin":"22","set":"","level":"0","freq":"1","out":"pwm","bcm":true,"x":1753,"y":1275,"wires":[]},{"id":"3be95de8754230eb","type":"switch","z":"f5f5d3a26603b1a4","name":"","property":"blocked","propertyType":"global","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1553,"y":1255,"wires":[["3f21604ee04369fd","ab8738f27e5edf05"],[]]},{"id":"ffa11e798a95ca4a","type":"change","z":"f5f5d3a26603b1a4","name":"Reset at On and Off (safety feature)","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2323,"y":1335,"wires":[["37191648f61701d8"]]},{"id":"01c41db68cecae84","type":"ui_text_input","z":"f5f5d3a26603b1a4","name":"Mash Power Setting","label":"Mash Power Setting","tooltip":"","group":"19ad7abf6c8af815","order":12,"width":6,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"topic","x":1383,"y":1275,"wires":[["3be95de8754230eb"]]},{"id":"0acec77af8b81ddb","type":"ui_button","z":"f5f5d3a26603b1a4","name":"Mash Power to 0 (Soft Stop)","group":"19ad7abf6c8af815","order":14,"width":12,"height":1,"passthru":true,"label":"Mash Power to 0 (Soft Stop)","tooltip":"","color":"","bgcolor":"","icon":"","payload":"0","payloadType":"str","topic":"topic","x":1363,"y":1235,"wires":[["3be95de8754230eb","01c41db68cecae84"]]},{"id":"8149a6b294d457f9","type":"ui_text_input","z":"f5f5d3a26603b1a4","name":"MashTemperature shut off value ","label":"","tooltip":"Mash","group":"19ad7abf6c8af815","order":11,"width":6,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"topic","x":373,"y":1275,"wires":[["d30e19ff5fd093e6"]]},{"id":"410d0f915f2f185a","type":"inject","z":"f5f5d3a26603b1a4","name":"Shut off test (simulated temperature input celcius)","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"103","payloadType":"num","x":443,"y":1395,"wires":[["bc4e34d1e54f3075"]]},{"id":"37191648f61701d8","type":"link out","z":"f5f5d3a26603b1a4","name":"Send 0 At Power Off","mode":"link","links":["c7adf7ce3ca37e96"],"x":2498,"y":1335,"wires":[]},{"id":"c7adf7ce3ca37e96","type":"link in","z":"f5f5d3a26603b1a4","name":"Receive 0 At Power Off","links":["37191648f61701d8"],"x":1188,"y":1275,"wires":[["01c41db68cecae84"]]},{"id":"1d66777e15ab1afe","type":"inject","z":"f5f5d3a26603b1a4","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1673,"y":1355,"wires":[["06ea836a98bfe38a"]]},{"id":"fd295445f712ca8b","type":"link out","z":"f5f5d3a26603b1a4","name":"Send geblokkeerd geeft false bericht","mode":"link","links":["4cb7603f9897a645"],"x":2498,"y":1415,"wires":[]},{"id":"4cb7603f9897a645","type":"link in","z":"f5f5d3a26603b1a4","name":"Receive geblokkeerd geeft false bericht","links":["fd295445f712ca8b"],"x":1288,"y":1355,"wires":[["1657929d7dae820f"]]},{"id":"c45a83a3.d00908","type":"ui_group","name":"PID","tab":"80cd4062.93a5","order":1,"disp":true,"width":"6"},{"id":"251e880a.3e91e8","type":"ui_group","name":"Profile","tab":"42b914b0.66a0ac","order":1,"disp":true,"width":"10","collapse":false},{"id":"f0b7f6f376448e9a","type":"profile","name":"brewery","time1":"00:00","temp1":"70","time2":"23:59","temp2":"70","time3":"","temp3":"","time4":"","temp4":"","time5":"","temp5":"","time6":"","temp6":"","time7":"","temp7":"","time8":"","temp8":"","time9":"","temp9":"","time10":"","temp10":""},{"id":"19ad7abf6c8af815","type":"ui_group","name":"MashTun","tab":"a74ffe3d.4eb73","order":3,"disp":true,"width":12,"collapse":false},{"id":"80cd4062.93a5","type":"ui_tab","name":"Home","icon":"dashboard"},{"id":"42b914b0.66a0ac","type":"ui_tab","name":"Main","icon":"dashboard","order":1},{"id":"a74ffe3d.4eb73","type":"ui_tab","name":"Brewery","icon":"dashboard","order":1,"disabled":false,"hidden":false}]