Skip to content

Instantly share code, notes, and snippets.

@abhishekkarigar
Last active February 6, 2021 15:55
Show Gist options
  • Save abhishekkarigar/ce086e9500e0fb83cc6a220e594c3495 to your computer and use it in GitHub Desktop.
Save abhishekkarigar/ce086e9500e0fb83cc6a220e594c3495 to your computer and use it in GitHub Desktop.
node-red tank_pressure flow
[{"id":"7cbdca5b.2b6364","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"6ed6d777.7b7aa8","type":"inject","z":"7cbdca5b.2b6364","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"","payloadType":"date","x":120,"y":220,"wires":[["27cc5ecd.dc31b2"]]},{"id":"27cc5ecd.dc31b2","type":"random","z":"7cbdca5b.2b6364","name":"sensor","low":1,"high":10,"inte":"true","property":"sensor","x":270,"y":220,"wires":[["b4f8f977.b54248"]]},{"id":"b4f8f977.b54248","type":"function","z":"7cbdca5b.2b6364","name":"condition","func":"var sensor = msg.sensor\nif(sensor>=5)\n{\n msg.payload = {\n numValue: sensor,\n strValue: \"high\",\n valveCond:0\n}}\nelse if(sensor<5)\n{\n msg.payload = {\n numValue: sensor,\n strValue: \"low\",\n valveCond:1\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":420,"y":220,"wires":[["23920b5b.004cf4","fd81ea8a.3beee8"]]},{"id":"23920b5b.004cf4","type":"debug","z":"7cbdca5b.2b6364","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":220,"wires":[]},{"id":"fd81ea8a.3beee8","type":"influxdb out","z":"7cbdca5b.2b6364","influxdb":"1763f2d1.f3327d","name":"TANK PRESSURE","measurement":"TANK_PRESSURE","precision":"","retentionPolicy":"","database":"WEATHER","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":550,"y":120,"wires":[]},{"id":"1763f2d1.f3327d","type":"influxdb","hostname":"192.168.99.114","port":"8086","protocol":"http","database":"WEATHER","name":"Weather","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://192.168.99.114:8086","rejectUnauthorized":false}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment