-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathNote-Red Flow
1 lines (1 loc) · 2.88 KB
/
Note-Red Flow
1
[{"id":"a0a5e768aba2d3ca","type":"tab","label":"Fuel-oil Tank alarm","disabled":false,"info":""},{"id":"cd0970bb7b9cafb1","type":"mqtt in","z":"a0a5e768aba2d3ca","name":"Maine Fuel-Tank","topic":"MAINE/TASMOTA/110180/SENSOR","qos":"0","datatype":"auto","broker":"386e425790269597","nl":false,"rap":false,"x":160,"y":100,"wires":[["63de83556eb3ec71","fb4cfc92cfee2512","a8559310e8d8cc11"]]},{"id":"63de83556eb3ec71","type":"debug","z":"a0a5e768aba2d3ca","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":390,"y":100,"wires":[]},{"id":"fb4cfc92cfee2512","type":"json","z":"a0a5e768aba2d3ca","name":"","property":"payload","action":"","pretty":false,"x":370,"y":160,"wires":[["e6691c5f9982dca5"]]},{"id":"9f96ad75abb0fe62","type":"comment","z":"a0a5e768aba2d3ca","name":"","info":"","x":140,"y":40,"wires":[]},{"id":"e6691c5f9982dca5","type":"debug","z":"a0a5e768aba2d3ca","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":160,"wires":[]},{"id":"a8559310e8d8cc11","type":"function","z":"a0a5e768aba2d3ca","name":"Check for tank alert","func":"\n// test tank for percent full and send an email if it's at lower limit\nvar msgx = {};\nvar msg1 = {};\nvar msg2 = {};\nvar msg3 = {};\n\nmsgx.payload = JSON.parse(msg.payload);\nmsg1.payload = msgx.payload.Tank.Volume;\nmsg2.payload = msgx.payload.Tank.Percent_Full;\n\nif (msg2.payload <= 35)\n{\nmsg3.payload = \"Warning, Maine Fuel-Oil Tank is at: \" + msg2.payload + \" Percent full, \" + msg1.payload + \" Gal's\";\nreturn msg3;\n}\nreturn","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":220,"wires":[["3fd8f21eae91e47c","d590586acd34da72"]]},{"id":"3fd8f21eae91e47c","type":"debug","z":"a0a5e768aba2d3ca","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":280,"wires":[]},{"id":"d590586acd34da72","type":"delay","z":"a0a5e768aba2d3ca","name":"Limit 1 msgs / 3-day","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"day","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"x":640,"y":220,"wires":[["a1fc5cad32771e7e"]]},{"id":"a1fc5cad32771e7e","type":"e-mail","z":"a0a5e768aba2d3ca","server":"smtp.gmail.com","port":"587","secure":false,"tls":false,"name":"myemail@gmail.com","dname":"Email Event --> to me","x":880,"y":220,"wires":[]},{"id":"386e425790269597","type":"mqtt-broker","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]