Arduino serial data and alarms

I was trying to use a max31855 with node red but didnt have much success. I did how ever have a Arduino nano thats able to read the data with no issue. Im currently seeing data from the Arduino over the serial node. Im able to publish that to the dashboard as a text number. What i want to do is have a alarm set that if the temperature gets either too high or low it will send a email. Can i do that with this setup or do i need another way? One way i thought of was using the Arduino node pin input and set a alarm from there.

well you will need to add more nodes. Take a look at the Node-RED switch node that can direct a message to a different output based on its value.

You may need to convert from a string (i assume that what text number means?) to a number. But that’s come up lots of times on the forum and you should be able to find it

So i ended up getting it to work. Now my issue is i copied a node from a site where someone wanted only 1 email if the system tripped alarm. They didnt want it to keep sending emails. Well for this setup i want it to keep sending them until its resolved. this is the node.

[{"id":"fa0616f7.495f78","type":"function","z":"ad234f7.ae5a4b","name":"Hot Water Setpoint","func":"var upperThreshold = 200;\nvar lowerThreshold = 60;\n\n\nvar previousTemp = context.previousTemp || \n        (upperThreshold - lowerThreshold)/2;\n        \nvar temp = msg.payload;\n\ncontext.previousTemp = temp;\n\n\n// Check if the new temp is different from the previous\nif (previousTemp != temp){\n\tif ((previousTemp < upperThreshold) \n\t    && (temp >= upperThreshold)){\n\t\tmsg.payload = \"BOILER OVERHEATING! Current temperature is \" + String(temp) + \"°F\";\n\t\treturn msg;\n\t}\n\telse if ((previousTemp > lowerThreshold) \n\t && (temp <= lowerThreshold)){\n\t\tmsg.payload = \"Boiler SHUTTING DOWN! Current temperature is \" + String(temp) + \"°F\";\n\t\treturn msg;\n\t}\n}","outputs":1,"noerr":0,"x":891.4285507202148,"y":521.4285478591919,"wires":[["8fb7e0b9.3ed4f"]]}] 

Please look at this thread about inserting flows

and then edit your post and fix it.

i believe its fixed.

You fixed the issue or the flow you posted?
The flow just shows a function node. If you question is how to keep emailing the message that comes out, what does the rest of the flow do?

Yes its just the function node. Right now its receiving a signal from Arduino through serial and being given a number. All that works fine. When the number hits one of the set points it does send a email but only one. I want it to keep sending them.

what is the flow that is sending the email?

this is the entire flow

[{"id":"6eb9ec82.e35d84","type":"inject","z":"ad234f7.ae5a4b","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":241.00001525878906,"y":70,"wires":[["d280d73c.e00198"]]},{"id":"d280d73c.e00198","type":"rpi-ds18b20","z":"ad234f7.ae5a4b","topic":"","array":false,"name":"","x":386.00001525878906,"y":313.3333134651184,"wires":[["b028f2a4.494f1","851f9af0.7431c8"]]},{"id":"b028f2a4.494f1","type":"switch","z":"ad234f7.ae5a4b","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"270243982500","vt":"str"},{"t":"eq","v":"3B0B4398FF00","vt":"str"},{"t":"eq","v":"2B2543981800","vt":"str"},{"t":"eq","v":"7C0043982200","vt":"str"},{"t":"eq","v":"921C43982400","vt":"str"},{"t":"eq","v":"C61F43980800","vt":"str"}],"checkall":"true","repair":false,"outputs":6,"x":488.00001525878906,"y":119,"wires":[["e18ebb44.093f08"],["8411ca07.8626d8"],["896a5123.2bd37"],["8fd84410.ef1118"],["6ff1dca7.b89054"],["1ffdcf77.330e61"]]},{"id":"616cdf03.a9dd7","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"b88bfd2.868d9","order":4,"width":"6","height":"6","gtype":"gage","title":"Outdoor","label":"Degrees F","format":"{{value}}","min":"-30","max":"120","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1253.000015258789,"y":48,"wires":[]},{"id":"749e5780.b4c788","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"7b8721db.f7bbb","order":3,"width":0,"height":0,"gtype":"gage","title":"ahu-s","label":"Degrees F","format":"{{value}}","min":"40","max":"120","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1242.000015258789,"y":81,"wires":[]},{"id":"c71564ce.ad79f8","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"64563538.0a454c","order":1,"width":0,"height":0,"gtype":"gage","title":"ahu-r","label":"Degrees F","format":"{{value}}","min":"40","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1243.000015258789,"y":113,"wires":[]},{"id":"b17ddc37.89499","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"18418068.df366","order":1,"width":0,"height":0,"gtype":"gage","title":"water heater","label":"Degrees F","format":"{{value}}","min":"60","max":"240","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1259.000015258789,"y":146,"wires":[]},{"id":"c802e5ac.554808","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"45f4393e.cfbcf8","order":2,"width":0,"height":0,"gtype":"gage","title":"Boiler Return","label":"Degrees F","format":"{{value}}","min":"60","max":"240","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1262.000015258789,"y":177,"wires":[]},{"id":"539ec283.ff066c","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"551f9ac.454a664","order":6,"width":0,"height":0,"gtype":"gage","title":"Boiler Supply","label":"Degrees F","format":"{{value}}","min":"60","max":"240","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1259.000015258789,"y":207,"wires":[]},{"id":"8411ca07.8626d8","type":"function","z":"ad234f7.ae5a4b","name":"convert C to F","func":"var tempc = msg.payload;\n    tempf = tempc * 9/5 + 32;\n    tempf = Math.round(tempf * 10) / 10;\n    msg.payload = tempf;\n    return msg;\n","outputs":1,"noerr":0,"x":696.0000152587891,"y":42,"wires":[["616cdf03.a9dd7","895b70c7.8afef"]]},{"id":"a35424de.424c98","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"551f9ac.454a664","order":0,"width":0,"height":0,"label":"Boiler Supply","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":975.0000152587891,"y":390,"wires":[[],[]]},{"id":"895b70c7.8afef","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"b88bfd2.868d9","order":0,"width":0,"height":0,"label":"OUTDOOR TEMP","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":997.0000152587891,"y":422,"wires":[[],[]]},{"id":"c9a605d6.7136a8","type":"debug","z":"ad234f7.ae5a4b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1296.000015258789,"y":251,"wires":[]},{"id":"e18ebb44.093f08","type":"function","z":"ad234f7.ae5a4b","name":"convert C to F","func":"var tempc = msg.payload;\n    tempf = tempc * 9/5 + 32;\n    tempf = Math.round(tempf * 10) / 10;\n    msg.payload = tempf;\n    return msg;\n","outputs":1,"noerr":0,"x":696.0000152587891,"y":74,"wires":[["749e5780.b4c788","b9d88c8.935ca7"]]},{"id":"896a5123.2bd37","type":"function","z":"ad234f7.ae5a4b","name":"convert C to F","func":"var tempc = msg.payload;\n    tempf = tempc * 9/5 + 32;\n    tempf = Math.round(tempf * 10) / 10;\n    msg.payload = tempf;\n    return msg;\n","outputs":1,"noerr":0,"x":695.0000152587891,"y":106,"wires":[["c71564ce.ad79f8","c88a6e42.04a8"]]},{"id":"8fd84410.ef1118","type":"function","z":"ad234f7.ae5a4b","name":"convert C to F","func":"var tempc = msg.payload;\n    tempf = tempc * 9/5 + 32;\n    tempf = Math.round(tempf * 10) / 10;\n    msg.payload = tempf;\n    return msg;\n","outputs":1,"noerr":0,"x":697.0000152587891,"y":136,"wires":[["b17ddc37.89499","23f99c52.aaf8b4"]]},{"id":"6ff1dca7.b89054","type":"function","z":"ad234f7.ae5a4b","name":"convert C to F","func":"var tempc = msg.payload;\n    tempf = tempc * 9/5 + 32;\n    tempf = Math.round(tempf * 10) / 10;\n    msg.payload = tempf;\n    return msg;\n","outputs":1,"noerr":0,"x":696.0000152587891,"y":168,"wires":[["c802e5ac.554808","333247b1.2acd98","7e3a685e.4386f8"]]},{"id":"1ffdcf77.330e61","type":"function","z":"ad234f7.ae5a4b","name":"convert C to F","func":"var tempc = msg.payload;\n    tempf = tempc * 9/5 + 32;\n    tempf = Math.round(tempf * 10) / 10;\n    msg.payload = tempf;\n    return msg;\n","outputs":1,"noerr":0,"x":701.0000152587891,"y":198,"wires":[["539ec283.ff066c","a35424de.424c98","7e3a685e.4386f8","c9a605d6.7136a8"]]},{"id":"b9d88c8.935ca7","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"7b8721db.f7bbb","order":0,"width":0,"height":0,"label":"Air Handler Supply","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":989.0000152587891,"y":261,"wires":[[],[]]},{"id":"c88a6e42.04a8","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"64563538.0a454c","order":0,"width":0,"height":0,"label":"Air Handler Return","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":990.0000152587891,"y":293,"wires":[[],[]]},{"id":"23f99c52.aaf8b4","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"18418068.df366","order":0,"width":0,"height":0,"label":"Water Heater","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":977.0000152587891,"y":325,"wires":[[],[]]},{"id":"333247b1.2acd98","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"45f4393e.cfbcf8","order":0,"width":0,"height":0,"label":"Boiler Return","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":975.0000152587891,"y":358,"wires":[[],[]]},{"id":"851f9af0.7431c8","type":"debug","z":"ad234f7.ae5a4b","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":430.00001525878906,"y":232,"wires":[]},{"id":"480790f9.dacf1","type":"ui_button","z":"ad234f7.ae5a4b","name":"","group":"551f9ac.454a664","order":0,"width":0,"height":0,"passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":232.00001525878906,"y":102,"wires":[["d280d73c.e00198"]]},{"id":"7760256f.9a84dc","type":"ui_button","z":"ad234f7.ae5a4b","name":"","group":"45f4393e.cfbcf8","order":0,"width":0,"height":0,"passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":231.00001525878906,"y":135,"wires":[["d280d73c.e00198"]]},{"id":"36533382.a3a3ec","type":"ui_button","z":"ad234f7.ae5a4b","name":"","group":"7b8721db.f7bbb","order":0,"width":0,"height":0,"passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":232.00001525878906,"y":166,"wires":[["d280d73c.e00198"]]},{"id":"2e5810c0.91d38","type":"ui_button","z":"ad234f7.ae5a4b","name":"","group":"64563538.0a454c","order":0,"width":0,"height":0,"passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":229.00001525878906,"y":198,"wires":[["d280d73c.e00198"]]},{"id":"f5d9c8b.0be5038","type":"ui_button","z":"ad234f7.ae5a4b","name":"","group":"18418068.df366","order":0,"width":0,"height":0,"passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":227.00001525878906,"y":230,"wires":[["d280d73c.e00198"]]},{"id":"8fb7e0b9.3ed4f","type":"e-mail","z":"ad234f7.ae5a4b","server":"smtp.gmail.com","port":"465","secure":true,"name":"boiler.node.red@gmail.com","dname":"Email for boiler","x":1466.0714225769043,"y":332.57146978378296,"wires":[]},{"id":"7e3a685e.4386f8","type":"function","z":"ad234f7.ae5a4b","name":"Hot Water Setpoint","func":"var upperThreshold = 200;\nvar lowerThreshold = 60;\n\n\nvar previousTemp = context.previousTemp || \n        (upperThreshold - lowerThreshold)/2;\n        \nvar temp = msg.payload;\n\ncontext.previousTemp = temp;\n\n\n// Check if the new temp is different from the previous\nif (previousTemp != temp){\n\tif ((previousTemp < upperThreshold) \n\t    && (temp >= upperThreshold)){\n\t\tmsg.payload = \"BOILER OVERHEATING! Current temperature is \" + String(temp) + \"°F\";\n\t\treturn msg;\n\t}\n\telse if ((previousTemp > lowerThreshold) \n\t && (temp <= lowerThreshold)){\n\t\tmsg.payload = \"Boiler SHUTTING DOWN! Current temperature is \" + String(temp) + \"°F\";\n\t\treturn msg;\n\t}\n}","outputs":1,"noerr":0,"x":1221.428482055664,"y":322.92857456207275,"wires":[["fda18b54.110b78","8fb7e0b9.3ed4f"]]},{"id":"fda18b54.110b78","type":"debug","z":"ad234f7.ae5a4b","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1339.9999999999998,"y":494.2857142857142,"wires":[]},{"id":"20605e98.decd32","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"c62ae2e5.bd8c3","order":0,"width":0,"height":0,"gtype":"gage","title":"Boiler Flue","label":"Degrees F","format":"{{value}}","min":"50","max":"800","colors":["#f1ff01","#ffa50a","#ff0000"],"seg1":"","seg2":"","x":604.2857131958008,"y":440.0000057220459,"wires":[]},{"id":"4f87340f.6c21ac","type":"debug","z":"ad234f7.ae5a4b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":598.5714492797852,"y":534.2857093811035,"wires":[]},{"id":"34c4fa10.366f86","type":"function","z":"ad234f7.ae5a4b","name":"String to Number","func":"msg.payload = Number(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":377.1428571428571,"y":444.2857142857142,"wires":[["4f87340f.6c21ac","20605e98.decd32","fa0616f7.495f78","ed001498.5f9d98"]]},{"id":"fa0616f7.495f78","type":"function","z":"ad234f7.ae5a4b","name":"Flue OVERFIRE","func":"var upperThreshold = 600;\nvar lowerThreshold = 60;\n\n\nvar previousTemp = context.previousTemp || \n        (upperThreshold - lowerThreshold)/2;\n        \nvar temp = msg.payload;\n\ncontext.previousTemp = temp;\n\n\n// Check if the new temp is different from the previous\nif (previousTemp != temp){\n\tif ((previousTemp < upperThreshold) \n\t    && (temp >= upperThreshold)){\n\t\tmsg.payload = \"BOILER OVERFIRE! Current temperature is \" + String(temp) + \"°F\";\n\t\treturn msg;\n\t}\n\telse if ((previousTemp > lowerThreshold) \n\t && (temp <= lowerThreshold)){\n\t\tmsg.payload = \"Boiler SHUTTING DOWN! Current temperature is \" + String(temp) + \"°F\";\n\t\treturn msg;\n\t}\n}","outputs":1,"noerr":0,"x":635.7142868041992,"y":385.7142276763916,"wires":[["8fb7e0b9.3ed4f"]]},{"id":"4ff4c11d.e3169","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"7c931889.29be08","order":0,"width":0,"height":0,"label":"Heatpump Suction Line","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"8","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1018.571403503418,"y":455.71430015563965,"wires":[[],[]]},{"id":"4e5181a7.a9709","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"5e29ceef.983b7","order":0,"width":0,"height":0,"label":"Heatpump Liquid Line","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"8","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1011.4285736083984,"y":487.1428394317627,"wires":[[],[]]},{"id":"242c209f.8cb55","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"7c931889.29be08","order":0,"width":0,"height":0,"gtype":"gage","title":"Heatpump Suction Line","label":"Degrees F","format":"{{value}}","min":"30","max":"160","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1022.8570919036865,"y":522.8570899963379,"wires":[]},{"id":"ee66df22.684","type":"ui_gauge","z":"ad234f7.ae5a4b","name":"","group":"5e29ceef.983b7","order":0,"width":0,"height":0,"gtype":"gage","title":"Heatpump Liquid Line","label":"Degrees F","format":"{{value}}","min":"30","max":"160","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1017.142858505249,"y":555.7142848968506,"wires":[]},{"id":"f4803a49.b1ff08","type":"ui_button","z":"ad234f7.ae5a4b","name":"","group":"7c931889.29be08","order":0,"width":0,"height":0,"passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":222.85714721679688,"y":260,"wires":[["d280d73c.e00198"]]},{"id":"af14b1a8.116e9","type":"ui_button","z":"ad234f7.ae5a4b","name":"","group":"5e29ceef.983b7","order":0,"width":0,"height":0,"passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":221.42857360839844,"y":290,"wires":[["d280d73c.e00198"]]},{"id":"7d27725d.2cccac","type":"function","z":"ad234f7.ae5a4b","name":"convert C to F","func":"var tempc = msg.payload;\n    tempf = tempc * 9/5 + 32;\n    tempf = Math.round(tempf * 10) / 10;\n    msg.payload = tempf;\n    return msg;\n","outputs":1,"noerr":0,"x":700,"y":231.42857360839844,"wires":[["4ff4c11d.e3169","4e5181a7.a9709"]]},{"id":"fa7abec9.b07e9","type":"function","z":"ad234f7.ae5a4b","name":"convert C to F","func":"var tempc = msg.payload;\n    tempf = tempc * 9/5 + 32;\n    tempf = Math.round(tempf * 10) / 10;\n    msg.payload = tempf;\n    return msg;\n","outputs":1,"noerr":0,"x":701.4285888671875,"y":267.1428527832031,"wires":[["242c209f.8cb55","ee66df22.684"]]},{"id":"3c7a0293.d1f64e","type":"debug","z":"ad234f7.ae5a4b","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":365.71427154541016,"y":510.00000381469727,"wires":[]},{"id":"4335bd94.931704","type":"serial in","z":"ad234f7.ae5a4b","name":"","serial":"9258008e.18cef","x":153,"y":478,"wires":[["3c7a0293.d1f64e","34c4fa10.366f86"]]},{"id":"ed001498.5f9d98","type":"ui_chart","z":"ad234f7.ae5a4b","name":"","group":"c62ae2e5.bd8c3","order":0,"width":0,"height":0,"label":"Boiler Flue","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"8","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":604,"y":477,"wires":[[],[]]},{"id":"b88bfd2.868d9","type":"ui_group","z":"","name":"Outdoor","tab":"99d87d9c.d4003","disp":true,"width":"6","collapse":false},{"id":"7b8721db.f7bbb","type":"ui_group","z":"","name":"Air Handler Supply","tab":"d2ce0a8b.4e53c8","disp":true,"width":"6","collapse":false},{"id":"64563538.0a454c","type":"ui_group","z":"","name":"Air Handler Return","tab":"d2ce0a8b.4e53c8","disp":true,"width":"6","collapse":false},{"id":"18418068.df366","type":"ui_group","z":"","name":"Water Heater","tab":"1350bd8b.73ed62","order":3,"disp":true,"width":"6","collapse":false},{"id":"45f4393e.cfbcf8","type":"ui_group","z":"","name":"Boiler Return","tab":"8d4692ec.a9bc6","disp":true,"width":"6","collapse":false},{"id":"551f9ac.454a664","type":"ui_group","z":"","name":"Boiler Supply","tab":"8d4692ec.a9bc6","disp":true,"width":"6","collapse":false},{"id":"c62ae2e5.bd8c3","type":"ui_group","z":"","name":"Boiler Flue","tab":"8d4692ec.a9bc6","disp":true,"width":"6","collapse":false},{"id":"7c931889.29be08","type":"ui_group","z":"","name":"Heatpump Suction Line","tab":"40288001.19ec9","order":5,"disp":true,"width":"6","collapse":false},{"id":"5e29ceef.983b7","type":"ui_group","z":"","name":"Heatpump Liquid Line","tab":"40288001.19ec9","disp":true,"width":"6","collapse":false},{"id":"9258008e.18cef","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false,"responsetimeout":"10000"},{"id":"99d87d9c.d4003","type":"ui_tab","z":"","name":"Outdoor","icon":"dashboard","order":2},{"id":"d2ce0a8b.4e53c8","type":"ui_tab","z":"","name":"Air Handler","icon":"dashboard","order":2},{"id":"1350bd8b.73ed62","type":"ui_tab","z":"","name":"Water Heater","icon":"dashboard","order":2},{"id":"8d4692ec.a9bc6","type":"ui_tab","z":"","name":"Boiler Room","icon":"dashboard"},{"id":"40288001.19ec9","type":"ui_tab","z":"","name":"Heat Pump","icon":"dashboard","order":2}]

Ok if you want to send the msg every time a msg comes into that function, change the logic in the function. This will send the boiler message if the temp is greater than the threshold:

// Check if the new temp is different from the previous
//if (previousTemp != temp){
//	if ((previousTemp < upperThreshold) 
//	    && (temp >= upperThreshold)){
	    if (temp >= upperThreshold){
		msg.payload = "BOILER OVERHEATING! Current temperature is " + String(temp) + "°F";
		return msg;
	}
	else if ((previousTemp > lowerThreshold) 
	 && (temp <= lowerThreshold)){
		msg.payload = "Boiler SHUTTING DOWN! Current temperature is " + String(temp) + "°F";
		return msg;
	}
//}

You can test this by adding an inject node that sends in a numeric value and putting a debug on the output of the function. (disconnect the email node for testing)

One thing, depending on the frequency of the data being sent in, you could get flooded with emails so you may want to limit the emails to one every 5 minutes or something.

Thank you i got it working how i wanted. Thanks