I have a two functions that successfully read the temperature from a MAX31865 serial connection via Arduino and sends out a 0 or 1 if it is above or below the max temp I set within the function. I will use this message to send a digital output from my raspberry pi's gpio pins to activate some relays for two heating elements to maintain the temperature based off which "button is pressed"( or "mode" the user has selected). I am trying to selectively pass this message on based on whether one of two modes is activated, or have an off override. cook=80 clean=75 off= turns heating elements off. It works fine if i am just passing one function off to the heating element nodes. I am not sure how to activate a function based off a button press while deactivating the other. How would I go about making it worked as I described?
[{"id":"b1bca559.6da498","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8137d337.eab6c","type":"ui_button","z":"b1bca559.6da498","name":"","group":"e914427c.3d1e4","order":2,"width":0,"height":0,"passthru":false,"label":"OFF","tooltip":"","color":"","bgcolor":"","icon":"","payload":"0","payloadType":"num","topic":"","x":610,"y":440,"wires":[["887c004c.00aea","81c4e2cc.1de6d"]]},{"id":"9f01f220.8a3b","type":"debug","z":"b1bca559.6da498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":620,"wires":},{"id":"41125cea.7d5764","type":"debug","z":"b1bca559.6da498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":110,"y":480,"wires":},{"id":"452faa87.79cb34","type":"serial in","z":"b1bca559.6da498","name":"","serial":"e26eb068.22c22","x":110,"y":420,"wires":[["dc3c1ac5.4f5018","41125cea.7d5764","71dbe268.26d73c","19507758.1b3f69"]]},{"id":"71dbe268.26d73c","type":"function","z":"b1bca559.6da498","name":"set temp 75 F","func":"if (msg.payload < 75){\n msg.payload = 1;\n return msg;\n} else { \n msg.payload = 0\n return msg;\n}\nreturn null;","outputs":1,"noerr":0,"x":360,"y":360,"wires":[["51858fa2.e1e4e","56ed2197.5847b"]]},{"id":"dc3c1ac5.4f5018","type":"ui_gauge","z":"b1bca559.6da498","name":"","group":"e914427c.3d1e4","order":4,"width":0,"height":0,"gtype":"gage","title":"","label":"F","format":"{{value}}","min":0,"max":"400","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":110,"y":360,"wires":},{"id":"887c004c.00aea","type":"rpi-gpio out","z":"b1bca559.6da498","name":"heater1 ","pin":"13","set":"","level":"0","freq":"","out":"out","x":1060,"y":440,"wires":},{"id":"81c4e2cc.1de6d","type":"rpi-gpio out","z":"b1bca559.6da498","name":"heater2 ","pin":"11","set":"","level":"0","freq":"","out":"out","x":1060,"y":500,"wires":},{"id":"19507758.1b3f69","type":"function","z":"b1bca559.6da498","name":"set temp 80 F","func":"if (msg.payload < 80){\n msg.payload = 1;\n return msg;\n} else { \n msg.payload = 0;\n return msg;\n}\nreturn null;","outputs":1,"noerr":0,"x":360,"y":580,"wires":[["9f01f220.8a3b","2807251c.bc8ada"]]},{"id":"51858fa2.e1e4e","type":"debug","z":"b1bca559.6da498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":400,"wires":},{"id":"56ed2197.5847b","type":"ui_button","z":"b1bca559.6da498","name":"","group":"e914427c.3d1e4","order":2,"width":0,"height":0,"passthru":false,"label":"Clean","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":610,"y":480,"wires":[["887c004c.00aea","81c4e2cc.1de6d"]]},{"id":"2807251c.bc8ada","type":"ui_button","z":"b1bca559.6da498","name":"","group":"e914427c.3d1e4","order":2,"width":0,"height":0,"passthru":false,"label":"Cook","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":610,"y":520,"wires":[["81c4e2cc.1de6d","887c004c.00aea"]]},{"id":"e914427c.3d1e4","type":"ui_group","z":"","name":"","tab":"889d85c3.3adc18","disp":true,"width":"6","collapse":false},{"id":"e26eb068.22c22","type":"serial-port","z":"","serialport":"/dev/ttyACM0","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","waitfor":"","newline":"\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"},{"id":"889d85c3.3adc18","type":"ui_tab","z":"","name":"Niki's Donuts","icon":"dashboard","disabled":false,"hidden":false}]