Temperature controls cooling control and a separate control for heating

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}]
1 Like

i never asked the questions dang.
my beers need to ferment for 7 days at a specific temp and then change for 3 days , then 2 , then 1 after that i need to hold at serving temp till i disable the chilling.
one of examples in my flow is for heating setting a 0 for off and a 1 for on. my problem with that is my coil relay board uses an active low for on. and an active high for off.

You could, for example, use node-red-contrib-cron-plus for the setpoint scheduling.

It is easy to invert the logic. For example, assuming the values are 1 and 0, then in a function node you could put
msg.payload = 1 - msg.payload
return msg
If they are true and false then
msg.payload = msg.payload ? false : true
or, dependent on where the value is coming from before that, you may be able to invert it there.

Ok maybe i should word differently. Sorry my grammar stinks.
I have the ramp thermostat node figured out as far as how to change a profile with a drop down. I do not have a ds18b20 node hooked up yet. I do know if i read the same sensor with 2 nodes(copies) node red tends to crash on me. So i have to be careful with that.
So do i just connect sensor node to the ramp thermostat so it knows what actual temp is. I also want to figure out how to override the temp control, aka change temp manually. And hold till i reinstate a profile. Or until itrigger off.
I did decide for now ill just have a profile for normal fermentation temp,(for ales 68)(lagers50)(a rest period 70) and a cold crash 38. Instead of being able to have all those in a single profile(i need to learn more lol)
So the way i understand basics.
Ramp needs to know setpoint, tolerance, and actual temp.
There is three ports coming off of the thermostat what does each do. Aka wich goes to gpio, gauge, and ...

I think i found my own answer,


I just need to run a switch node changing true boolean to zero and a false boolean to a 1 then run that to gpio for control.
I guess my next step is how do i make s control loop to disable profile when manually inputting temp

ok update on flow but several questions.

[{"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,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1158,"y":1145,"wires":[[]]},{"id":"702e7146.70cdc","type":"ramp-thermostat","z":"f5f5d3a26603b1a4","name":"profiles","profile":"332b9d2fc46e6cc7","hysteresisplus":".5","hysteresisminus":"0","x":799,"y":1058,"wires":[["dac510a4546ce5bc"],["2666a6153b540f6f","7afc28cc.743e08","13a05042f3d70c35"],["7afc28cc.743e08","13a05042f3d70c35"]]},{"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,"initialize":"","finalize":"","libs":[],"x":985,"y":1117,"wires":[["33aa1cd.c73cce4"]]},{"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":"ALEs","value":"ALEs","type":"str"},{"label":"COLDCrash","value":"COLDCrash","type":"str"},{"label":"Diacetyl Rest","value":"Diacetyl Rest","type":"str"},{"label":"LAGERS","value":"LAGERS","type":"str"}],"payload":"","topic":"getProfile","x":545,"y":983,"wires":[["702e7146.70cdc"]]},{"id":"85f30912a739dca5","type":"inject","z":"f5f5d3a26603b1a4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"2","crontab":"","once":true,"onceDelay":0.1,"topic":"setCurrent","payload":"ecb7","payloadType":"global","x":542,"y":1042,"wires":[["702e7146.70cdc"]]},{"id":"dac510a4546ce5bc","type":"debug","z":"f5f5d3a26603b1a4","name":"state","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1211,"y":845,"wires":[]},{"id":"2666a6153b540f6f","type":"debug","z":"f5f5d3a26603b1a4","name":"current temp","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1224,"y":894,"wires":[]},{"id":"13a05042f3d70c35","type":"ui_chart","z":"f5f5d3a26603b1a4","name":"Mash","group":"251e880a.3e91e8","order":2,"width":0,"height":0,"label":"","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ebfb09","#2ca02c","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1145,"y":1055,"wires":[[]]},{"id":"251e880a.3e91e8","type":"ui_group","name":"Profile","tab":"42b914b0.66a0ac","order":1,"disp":true,"width":"10","collapse":false},{"id":"332b9d2fc46e6cc7","type":"profile","name":"Diacetyl Rest","time1":"00:00","temp1":"68","time2":"23:59","temp2":"68","time3":"","temp3":"","time4":"","temp4":"","time5":"","temp5":"","time6":"","temp6":"","time7":"","temp7":"","time8":"","temp8":"","time9":"","temp9":"","time10":"","temp10":""},{"id":"42b914b0.66a0ac","type":"ui_tab","name":"Main","icon":"dashboard","order":1}]

I have 2 chart nodes. one from another flow with function in it. attached is screen shot of the programing in the function node. i have barely any knowledge on programing so i'd like to understand what its doing.
also why isnt my current temp showing up on my lower graph. and why doesnt the upper graph update when i make a change to profile?


Also you will notice, I figured out how to make a global message from the ds18b20 node some im not duplicating the node causing crashing issues within node red.

1 Like

If posting code please copy/paste the text please, and use the </> button at the top of the forum entry window when pasting it in. Then it will be easier to read and we can copy/paste it if necessary. You have posted the code but not told us in what way it isn't working. If you add debug nodes showing what is going into it and what is coming out and tell us what is wrong then it will be easier to help.

Do you mean why is the graph not updating? If so then attach a debug node and see what information you are feeding to the graph to show the current temp.

The actual temp is updating the set value isn't changing

Use debug nodes to work out at what point the flow goes wrong.

ok here is the function code going to chart

var p = msg.payload;
var c = {};
c.data = [];
var data = [];

p.points.forEach(function(point) {
    var key = Object.keys(point);
    data.push({"x": "2018-11-21T"+key+":00", "y":point[key]});
});

c.series = ["Profile"];
c.data = [data];
c.labels = [""];

msg.label = p.name;
msg.payload = [c];

return msg;

when i have a debug node going to each out on the ramp thermostat. i see correct temp but not correct profile setting on that debug. but after the code i just shared above i get correct profile setting.
what my issue is i have both actual temp going to chart and this function node going to chart and the only thing that will display is the profile setting no temp.
what am i doing wrong here or what am i over looking.
here is flow changed a little. (sorry was out of town for a week)

var p = msg.payload;
var c = {};
c.data = [];
var data = [];

p.points.forEach(function(point) {
    var key = Object.keys(point);
    data.push({"x": "2018-11-21T"+key+":00", "y":point[key]});
});

c.series = ["Profile"];
c.data = [data];
c.labels = [""];

msg.label = p.name;
msg.payload = [c];

return msg;

Are you trying to update the chart in real time, or fill the chart with historical data?

with Real time.
if i have the temp going to one chart it shows correctly.
if i have the side of the ramp thermostat going to function node and to a chart it shows correctly.
but when i have both going to a chart it only shows the set temp not the actual temp.




the node example is to lines connecting the chart from ramp thermostat directly no function node that creates the chart with 2 lines however bottom line isnt updating correctly but temp is.
the second chart picture is what i get when going from function node to the chart.
i try adding the temp and no go.
i have also found this info on line charts, but not really sure best way to change the topic name as this states to do.

this is what i am trying to do to change topic

To send two values to the chart in real time you should send two messages, one with the value to be plotted in the payload and the name of the line in the topic, and another message with the other value in the payload and the other name in that topic. Is that what you are doing?

thats what i think im doing.
do i need to join the 2 data streems together with different topic?
i shared the flow here.
i am still wet behind the ears here, I do not know any programing for one.
and 2 even though i speak english my grammar sucks so im sure im very hard to understand.

No. Two separate messages, each with a topic and a numeric value.

Add a debug node showing the messages that are fed into the chart and show us what you see.

This node:

is very helpful as it has a built-in scheduler. it's good for a week anyway...

I use it for temp control - heating (reverse-acting) and pH Control - CO2 fertilisation (direct-acting).

Might be something you can modify for your purposes.

yes its in my flow above.
but im having issues with the profile or set temp showing correctly in charts with actual temps.
im playing with a esp8266 right now to gather temps and seeing if its more reliable. the ds18b20 nodes
all seem to have issues. so if i get esp8266 running right i will learn mqtt. then ill go back to the thermostat issues.

What issues are you seeing?