Sprinkler Control Example

This flow is my implementation of a sprinkler system with an water pump and 3 zones. It is using Dashboard for UI control, and relay board connected to the GPIO ports. There is a Youtube video explaining in detail what I was planning to accomplish and how I implemented it: https://youtu.be/6iVs8CGY7uw If you watch the video hopefully you understand the logic and adapt it to your needs.

[{"id":"463827ad.2066a8","type":"tab","label":"Irrigation"},{"id":"af4b553a.5c5098","type":"ui_text","z":"463827ad.2066a8","group":"905671d0.3a2cf","order":2,"width":"","height":"","name":"Time:","label":"Time:","format":"{{msg.payload}}","layout":"","x":911,"y":105,"wires":[]},{"id":"a9762b58.fd4138","type":"function","z":"463827ad.2066a8","name":"Calculate time","func":"global.set(msg.topic,msg.payload);\nvar hour = global.get(\"timehour\");\nvar minute = global.get(\"timeminute\");\nif (hour!==undefined && minute!==undefined) {\n    var mytime = new Date();\n    mytime.setHours(hour, minute, 0);\n    mytime.setMilliseconds(0);\n    mytime.setFullYear(2000,01,01);\n    global.set(\"start\",mytime.getTime());\n}\nmsg.payload = hour + \":\" + minute;\nreturn msg;","outputs":1,"noerr":0,"x":729,"y":106,"wires":[["af4b553a.5c5098"]]},{"id":"45bb7d91.870724","type":"inject","z":"463827ad.2066a8","name":"","topic":"TempCheck","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"x":157.14287567138672,"y":488.09522914886475,"wires":[["b47f53d6.d4f53","de531489.e20498"]]},{"id":"b47f53d6.d4f53","type":"function","z":"463827ad.2066a8","name":"Remove date","func":"var current = new Date();\nvar today = new Date();\ncurrent.setFullYear(2000,01,01);\ncurrent.setMilliseconds(0);\nmsg.payload = current.getTime();\n\nif (global.get(\"irrenable\")==1) {\n    msg.payload = (today.getDay() % global.get(\"irrdays\") === 0) ? current.getTime():'0';\n} else {\n    msg.payload = '0';\n}   \n\nreturn msg;","outputs":1,"noerr":0,"x":380.1428756713867,"y":488.09522914886475,"wires":[["d1e5d210.8c577","db060c99.3380d"]]},{"id":"d1e5d210.8c577","type":"switch","z":"463827ad.2066a8","name":"Check start time","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"start","vt":"global"},{"t":"else"}],"checkall":"true","outputs":2,"x":595.1428756713867,"y":487.09522914886475,"wires":[["a9531532.f5ebc8","d500bac0.7b7878","45c07d6c.cf3384"],[]]},{"id":"d500bac0.7b7878","type":"debug","z":"463827ad.2066a8","name":"","active":true,"console":"false","complete":"false","x":788.1428756713867,"y":438.09522914886475,"wires":[]},{"id":"3a8a3729.897b88","type":"comment","z":"463827ad.2066a8","name":"Convert the slider values to time","info":"","x":598,"y":37,"wires":[]},{"id":"f180a970.1a33b8","type":"ui_button","z":"463827ad.2066a8","name":"Start now","group":"ec9718e3.d842b8","order":5,"width":"","height":"","label":"In 1 minute","color":"","icon":"","payload":"now","payloadType":"str","topic":"","x":76,"y":113,"wires":[["4e7a4e6.0e220b","e4c47ab0.3f0aa8"]]},{"id":"5958b9e.2bd4b48","type":"ui_button","z":"463827ad.2066a8","name":"Start dawn","group":"ec9718e3.d842b8","order":6,"width":"","height":"","label":"4am in the morning","color":"","icon":"","payload":"dawn","payloadType":"str","topic":"","x":77,"y":153,"wires":[["5d9bef73.c195b","3ae7d836.04b208"]]},{"id":"357ba13.d7b295e","type":"comment","z":"463827ad.2066a8","name":"Preset times","info":"","x":84,"y":29,"wires":[]},{"id":"5d9bef73.c195b","type":"change","z":"463827ad.2066a8","name":"Dawn hour","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":129,"wires":[["3f2bfef7.b4cf42"]]},{"id":"3ae7d836.04b208","type":"change","z":"463827ad.2066a8","name":"Dawn minute","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":319,"y":171,"wires":[["d0c5ae66.ed048"]]},{"id":"4e7a4e6.0e220b","type":"function","z":"463827ad.2066a8","name":"Now hour","func":"var mydate = new Date();\nmsg.payload = mydate.getHours();\nreturn msg;","outputs":1,"noerr":0,"x":312,"y":35,"wires":[["3f2bfef7.b4cf42"]]},{"id":"e4c47ab0.3f0aa8","type":"function","z":"463827ad.2066a8","name":"Now minute","func":"var mydate = new Date();\nmydate.setTime(mydate.getTime() + 1*60000);\nmsg.payload = mydate.getMinutes();\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":79,"wires":[["d0c5ae66.ed048"]]},{"id":"cf9fa429.9cd718","type":"comment","z":"463827ad.2066a8","name":"Irrigation logic","info":"","x":87.14287567138672,"y":442.09522914886475,"wires":[]},{"id":"2c5a1588.8f7f9a","type":"trigger","z":"463827ad.2066a8","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"units":"s","reset":"","name":"","x":282.1428756713867,"y":624.0952291488647,"wires":[["65e8d655.320448","2de734e2.96228c"]]},{"id":"a9531532.f5ebc8","type":"change","z":"463827ad.2066a8","name":"Change to 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":285.1428756713867,"y":564.0952291488647,"wires":[["2c5a1588.8f7f9a","4c61ad61.e6ef34","56705afc.1fea44"]]},{"id":"7e324e05.3edcd","type":"rpi-gpio out","z":"463827ad.2066a8","name":"Pump","pin":"11","set":true,"level":"1","out":"out","x":422,"y":1116.6666259765625,"wires":[]},{"id":"3123e13f.1dc9de","type":"rpi-gpio out","z":"463827ad.2066a8","name":"Zone 1","pin":"13","set":true,"level":"1","out":"out","x":427,"y":1207.6666259765625,"wires":[]},{"id":"65e8d655.320448","type":"switch","z":"463827ad.2066a8","name":"Wait for 0","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","outputs":1,"x":276.1428756713867,"y":683.0952291488647,"wires":[["306fbfeb.55055"]]},{"id":"306fbfeb.55055","type":"trigger","z":"463827ad.2066a8","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"units":"s","reset":"","name":"","x":491.1428756713867,"y":684.0952291488647,"wires":[["23e64c7.55a53b4","cf9c490b.ee07c8"]]},{"id":"5013bef4.3d678","type":"rpi-gpio out","z":"463827ad.2066a8","name":"Zone 2","pin":"15","set":true,"level":"1","out":"out","x":428,"y":1316.6666259765625,"wires":[]},{"id":"23e64c7.55a53b4","type":"switch","z":"463827ad.2066a8","name":"Wait for 0","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","outputs":1,"x":270.1428756713867,"y":754.0952291488647,"wires":[["6909fe92.ea1d2"]]},{"id":"6909fe92.ea1d2","type":"trigger","z":"463827ad.2066a8","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"units":"s","reset":"","name":"","x":485.1428756713867,"y":755.0952291488647,"wires":[["e1618146.8065a","2917bd24.cfa3d2"]]},{"id":"a426227e.6adfd","type":"rpi-gpio out","z":"463827ad.2066a8","name":"Zone 3","pin":"16","set":true,"level":"1","out":"out","x":435,"y":1408.6666259765625,"wires":[]},{"id":"e1618146.8065a","type":"switch","z":"463827ad.2066a8","name":"Wait for 0","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","outputs":1,"x":270.1428756713867,"y":823.0952291488647,"wires":[["ac0e7d56.92d2b","16f72a23.9edce6","ae1cb2a0.1eee8"]]},{"id":"dc1ed5aa.2e7658","type":"comment","z":"463827ad.2066a8","name":"Start pump","info":"","x":72.14287567138672,"y":566.0952291488647,"wires":[]},{"id":"4be4c047.ace8f","type":"comment","z":"463827ad.2066a8","name":"Zone 1","info":"","x":62.14287567138672,"y":624.0952291488647,"wires":[]},{"id":"22ee949f.62181c","type":"comment","z":"463827ad.2066a8","name":"Zone 2","info":"","x":63.14287567138672,"y":680.0952291488647,"wires":[]},{"id":"34fa36c0.01fdca","type":"comment","z":"463827ad.2066a8","name":"Zone 3","info":"","x":66.14287567138672,"y":753.0952291488647,"wires":[]},{"id":"9d62a710.c40ba8","type":"comment","z":"463827ad.2066a8","name":"Stop pump","info":"","x":76.14287567138672,"y":817.0952291488647,"wires":[]},{"id":"db060c99.3380d","type":"debug","z":"463827ad.2066a8","name":"","active":false,"console":"false","complete":"false","x":586.1428756713867,"y":440.09522914886475,"wires":[]},{"id":"527edea3.ecf54","type":"inject","z":"463827ad.2066a8","name":"","topic":"","payload":"start","payloadType":"global","repeat":"","crontab":"","once":false,"x":742,"y":203,"wires":[["969fa4b7.675548"]]},{"id":"969fa4b7.675548","type":"debug","z":"463827ad.2066a8","name":"","active":true,"console":"false","complete":"false","x":899,"y":204,"wires":[]},{"id":"aca9bf9.839054","type":"ui_template","z":"463827ad.2066a8","group":"8a51f262.40562","name":"Pump","order":7,"width":"","height":"","format":"<div layout=\"row\" layout-align=\"space-between\">\n    <p>Pump</p>\n    <p ng-style=\"{color: msg.payload === '1' ? 'blue' : 'grey'}\">\n        <b>{{(msg.payload === '1') ? 'ON' : 'OFF'}}</b>\n    </p>\n</div>","storeOutMessages":false,"fwdInMessages":false,"x":249,"y":1072,"wires":[[]]},{"id":"dc1eb98a.560d48","type":"ui_template","z":"463827ad.2066a8","group":"8a51f262.40562","name":"Zone 1","order":8,"width":"","height":"","format":"<div layout=\"row\" layout-align=\"space-between\">\n    <p>Zone 1</p>\n    <p ng-style=\"{color: msg.payload === '1' ? 'blue' : 'grey'}\">\n        <b>{{msg.payload === '1' ? 'ON' : 'OFF'}}</b>\n    </p>\n</div>","storeOutMessages":false,"fwdInMessages":false,"x":251,"y":1169,"wires":[[]]},{"id":"af2a8164.e1498","type":"ui_template","z":"463827ad.2066a8","group":"8a51f262.40562","name":"Zone 2","order":9,"width":"","height":"","format":"<div layout=\"row\" layout-align=\"space-between\">\n    <p>Zone 2</p>\n    <p ng-style=\"{color: msg.payload === '1' ? 'blue' : 'grey'}\">\n        <b>{{msg.payload === '1' ? 'ON' : 'OFF'}}</b>\n    </p>\n</div>","storeOutMessages":false,"fwdInMessages":false,"x":252,"y":1276,"wires":[[]]},{"id":"8f07e045.d0309","type":"ui_template","z":"463827ad.2066a8","group":"8a51f262.40562","name":"Zone 3","order":10,"width":"","height":"","format":"<div layout=\"row\" layout-align=\"space-between\">\n    <p>Zone 3</p>\n    <p ng-style=\"{color: msg.payload === '1' ? 'blue' : 'grey'}\">\n        <b>{{msg.payload === '1' ? 'ON' : 'OFF'}}</b>\n    </p>\n</div>","storeOutMessages":false,"fwdInMessages":false,"x":252,"y":1371,"wires":[[]]},{"id":"45c07d6c.cf3384","type":"change","z":"463827ad.2066a8","name":"Toast message","rules":[{"t":"set","p":"topic","pt":"msg","to":"Irrigation","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Irrigation has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":847.1428718566895,"y":482.42858123779297,"wires":[["9030421.aeda1c"]]},{"id":"ac0e7d56.92d2b","type":"change","z":"463827ad.2066a8","name":"Toast message","rules":[{"t":"set","p":"topic","pt":"msg","to":"Irrigation","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Irrigation has completed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":513.1428718566895,"y":889.428581237793,"wires":[["cf24c2db.6742"]]},{"id":"3f2bfef7.b4cf42","type":"ui_dropdown","z":"463827ad.2066a8","name":"Hour","label":"Hour","group":"905671d0.3a2cf","order":3,"width":0,"height":0,"passthru":true,"options":[{"label":"00","value":"0","type":"str"},{"label":"01","value":"1","type":"str"},{"label":"02","value":"2","type":"str"},{"label":"03","value":"3","type":"str"},{"label":"04","value":"4","type":"str"},{"label":"05","value":"5","type":"str"},{"label":"06","value":"6","type":"str"},{"label":"07","value":"7","type":"str"},{"label":"08","value":"8","type":"str"},{"label":"09","value":"9","type":"str"},{"label":"10","value":"10","type":"str"},{"label":"11","value":"11","type":"str"},{"label":"12","value":"12","type":"str"},{"label":"13","value":"13","type":"str"},{"label":"14","value":"14","type":"str"},{"label":"15","value":"15","type":"str"},{"label":"16","value":"16","type":"str"},{"label":"17","value":"17","type":"str"},{"label":"18","value":"18","type":"str"},{"label":"19","value":"19","type":"str"},{"label":"20","value":"20","type":"str"},{"label":"21","value":"21","type":"str"},{"label":"22","value":"22","type":"str"},{"label":"23","value":"23","type":"str"}],"payload":"","topic":"timehour","x":519,"y":92,"wires":[["a9762b58.fd4138"]]},{"id":"d0c5ae66.ed048","type":"ui_dropdown","z":"463827ad.2066a8","name":"Minute","label":"Minute","group":"905671d0.3a2cf","order":4,"width":0,"height":0,"passthru":true,"options":[{"label":"00","value":"0","type":"str"},{"label":"01","value":"1","type":"str"},{"label":"02","value":"2","type":"str"},{"label":"03","value":"3","type":"str"},{"label":"04","value":"4","type":"str"},{"label":"05","value":"5","type":"str"},{"label":"06","value":"6","type":"str"},{"label":"07","value":"7","type":"str"},{"label":"08","value":"8","type":"str"},{"label":"09","value":"9","type":"str"},{"label":"10","value":"10","type":"str"},{"label":"11","value":"11","type":"str"},{"label":"12","value":"12","type":"str"},{"label":"13","value":"13","type":"str"},{"label":"14","value":"14","type":"str"},{"label":"15","value":"15","type":"str"},{"label":"16","value":"16","type":"str"},{"label":"17","value":"17","type":"str"},{"label":"18","value":"18","type":"str"},{"label":"19","value":"19","type":"str"},{"label":"20","value":"20","type":"str"},{"label":"21","value":"21","type":"str"},{"label":"22","value":"22","type":"str"},{"label":"23","value":"23","type":"str"},{"label":"24","value":"24","type":"str"},{"label":"25","value":"25","type":"str"},{"label":"26","value":"26","type":"str"},{"label":"27","value":"27","type":"str"},{"label":"28","value":"28","type":"str"},{"label":"29","value":"29","type":"str"},{"label":"30","value":"30","type":"str"},{"label":"31","value":"31","type":"str"},{"label":"32","value":"32","type":"str"},{"label":"33","value":"33","type":"str"},{"label":"34","value":"34","type":"str"},{"label":"35","value":"35","type":"str"},{"label":"36","value":"36","type":"str"},{"label":"37","value":"37","type":"str"},{"label":"38","value":"38","type":"str"},{"label":"39","value":"39","type":"str"},{"label":"40","value":"40","type":"str"},{"label":"41","value":"41","type":"str"},{"label":"42","value":"42","type":"str"},{"label":"43","value":"43","type":"str"},{"label":"44","value":"44","type":"str"},{"label":"45","value":"45","type":"str"},{"label":"46","value":"46","type":"str"},{"label":"47","value":"47","type":"str"},{"label":"48","value":"48","type":"str"},{"label":"49","value":"49","type":"str"},{"label":"50","value":"50","type":"str"},{"label":"51","value":"51","type":"str"},{"label":"52","value":"52","type":"str"},{"label":"53","value":"53","type":"str"},{"label":"54","value":"54","type":"str"},{"label":"55","value":"55","type":"str"},{"label":"56","value":"56","type":"str"},{"label":"57","value":"57","type":"str"},{"label":"58","value":"58","type":"str"},{"label":"59","value":"59","type":"str"}],"payload":"","topic":"timeminute","x":518,"y":135,"wires":[["a9762b58.fd4138"]]},{"id":"1546347.78b80cc","type":"ui_dropdown","z":"463827ad.2066a8","name":"Irrigate in days","label":"Irrigate in","group":"905671d0.3a2cf","order":5,"width":0,"height":0,"passthru":false,"options":[{"label":"Every day","value":1,"type":"num"},{"label":"Every second day","value":"2","type":"str"},{"label":"Every third day","value":"3","type":"str"},{"label":"Every forth day","value":"4","type":"str"}],"payload":"","topic":"irrdays","x":115,"y":272,"wires":[["509e2e66.ec54b"]]},{"id":"72c7fa06.88a914","type":"function","z":"463827ad.2066a8","name":"Date logic","func":"var today = new Date();\nif (global.get(\"irrenable\")==1) {\n    msg.payload = (today.getDay() % global.get(\"irrdays\") === 0) ? '1':'0';\n} else {\n    msg.payload = '0';\n}    \nreturn msg;","outputs":1,"noerr":0,"x":612,"y":272,"wires":[["aea8ec5.6d8b91"]]},{"id":"aea8ec5.6d8b91","type":"ui_template","z":"463827ad.2066a8","group":"905671d0.3a2cf","name":"Execute today?","order":6,"width":"","height":"","format":"<div layout=\"row\" layout-align=\"space-between\">\n    <p>Run today</p>\n    <p ng-style=\"{color: msg.payload === '1' ? 'green' : 'red'}\">\n        <b>{{(msg.payload === '1') ? 'Yes' : 'No'}}</b>\n    </p>\n</div>","storeOutMessages":false,"fwdInMessages":false,"x":834,"y":272,"wires":[[]]},{"id":"4c61ad61.e6ef34","type":"function","z":"463827ad.2066a8","name":"Start Counter","func":"global.set(\"pump_state\",1);\n\nglobal.set(\"pump_start\",Date.now());\nglobal.set(\"pump_time\",0);\nglobal.set(\"pump_prev\",0);\nmsg.topic = \"counterStart\";\nreturn msg;","outputs":1,"noerr":0,"x":650.1428718566895,"y":600.428581237793,"wires":[["d7fac06a.38e5d"]]},{"id":"62e258d8.dd5f78","type":"function","z":"463827ad.2066a8","name":"Counter","func":"if (global.get(\"pump_state\")==1)\n{\n    global.set(\"pump_prev\",Date.now()-global.get(\"pump_start\")+global.get(\"pump_time\"));\n}\nmsg.payload=global.get(\"pump_prev\");\nmsg.topic=\"counterUpdate\";\nreturn msg;","outputs":1,"noerr":0,"x":599.1428833007812,"y":396.4285888671875,"wires":[["614a37da.555c08"]]},{"id":"f7af77b2.f5e858","type":"ui_text","z":"463827ad.2066a8","group":"8a51f262.40562","order":0,"width":0,"height":0,"name":"Uptime","label":"Uptime","format":"{{msg.payload}}","layout":"col-center","x":464,"y":1486,"wires":[]},{"id":"16f72a23.9edce6","type":"function","z":"463827ad.2066a8","name":"Stop Counter","func":"global.set(\"pump_state\",0);\nglobal.set(\"pump_time\",Date.now()-global.get(\"pump_start\")+global.get(\"pump_time\"));\nmsg.payload=global.get(\"pump_time\");\nmsg.topic=\"counterEnd\";\nreturn msg;","outputs":1,"noerr":0,"x":516.1428718566895,"y":935.428581237793,"wires":[["436b0310.ca777c"]]},{"id":"13c8b9a0.953d76","type":"function","z":"463827ad.2066a8","name":"Format time","func":"var temp = Math.floor(msg.payload / 1000);\nvar s = \"<center>\";\nif (temp<=59) {\n    s = s+ temp + \"s\";\n} else {\n    s = s+ vtemp / 60 + \"m \" + temp % 60 + \"s\";\n}\n\nif (msg.topic===\"counterEnd\") {\n    // Add formatted timestamp\n    var now = new Date();\n    var yyyy = now.getFullYear();\n    var mm = now.getMonth() < 9 ? \"0\" + (now.getMonth() + 1) : (now.getMonth() + 1); // getMonth() is zero-based\n    var dd  = now.getDate() < 10 ? \"0\" + now.getDate() : now.getDate();\n    var hh = now.getHours() < 10 ? \"0\" + now.getHours() : now.getHours();\n    var mmm  = now.getMinutes() < 10 ? \"0\" + now.getMinutes() : now.getMinutes();\n    var ss  = now.getSeconds() < 10 ? \"0\" + now.getSeconds() : now.getSeconds();\n    s = s+ \"<br>\" + dd + \".\" + mm + \".\" + yyyy + \" \" + hh + \":\" + mmm + \":\" + ss;    \n}\n\ns=s+\"</center>\";\nmsg.payload=s;\nreturn msg;","outputs":1,"noerr":0,"x":266,"y":1486,"wires":[["f7af77b2.f5e858"]]},{"id":"4a54cf0f.f8f48","type":"function","z":"463827ad.2066a8","name":"active low","func":"if (msg.payload==1) { \n    msg.payload=0;\n} else {\n    msg.payload=1;\n}\nreturn msg;","outputs":1,"noerr":0,"x":252,"y":1208,"wires":[["3123e13f.1dc9de"]]},{"id":"68d85a6f.f8cc14","type":"function","z":"463827ad.2066a8","name":"active low","func":"if (msg.payload==1) { \n    msg.payload=0;\n} else {\n    msg.payload=1;\n}\nreturn msg;","outputs":1,"noerr":0,"x":252,"y":1117,"wires":[["7e324e05.3edcd"]]},{"id":"bc04c3fe.93741","type":"function","z":"463827ad.2066a8","name":"active low","func":"if (msg.payload==1) { \n    msg.payload=0;\n} else {\n    msg.payload=1;\n}\nreturn msg;","outputs":1,"noerr":0,"x":252,"y":1318,"wires":[["5013bef4.3d678"]]},{"id":"1337f0cb.77b2cf","type":"function","z":"463827ad.2066a8","name":"active low","func":"if (msg.payload==1) { \n    msg.payload=0;\n} else {\n    msg.payload=1;\n}\nreturn msg;","outputs":1,"noerr":0,"x":255,"y":1409,"wires":[["a426227e.6adfd"]]},{"id":"1a4de16c.d4c0bf","type":"comment","z":"463827ad.2066a8","name":"UI Update","info":"","x":81,"y":1036,"wires":[]},{"id":"f9767f4e.69436","type":"link in","z":"463827ad.2066a8","name":"Pump UI","links":["56705afc.1fea44","ae1cb2a0.1eee8","5375d3dc.c140bc"],"x":72,"y":1118,"wires":[["68d85a6f.f8cc14","aca9bf9.839054"]]},{"id":"56705afc.1fea44","type":"link out","z":"463827ad.2066a8","name":"","links":["f9767f4e.69436"],"x":535.1428718566895,"y":562.428581237793,"wires":[]},{"id":"ae1cb2a0.1eee8","type":"link out","z":"463827ad.2066a8","name":"","links":["f9767f4e.69436"],"x":464.14287185668945,"y":823.428581237793,"wires":[]},{"id":"6c0f560c.6003d8","type":"link in","z":"463827ad.2066a8","name":"Zone 1","links":["2de734e2.96228c","9ec74b9f.ce8d78"],"x":72,"y":1209,"wires":[["4a54cf0f.f8f48","dc1eb98a.560d48"]]},{"id":"2de734e2.96228c","type":"link out","z":"463827ad.2066a8","name":"","links":["6c0f560c.6003d8"],"x":488.14287185668945,"y":625.428581237793,"wires":[]},{"id":"7c23918c.22376","type":"link in","z":"463827ad.2066a8","name":"Zone 2","links":["cf9c490b.ee07c8","3d447063.7e7dc"],"x":69,"y":1317,"wires":[["bc04c3fe.93741","af2a8164.e1498"]]},{"id":"cf9c490b.ee07c8","type":"link out","z":"463827ad.2066a8","name":"","links":["7c23918c.22376"],"x":717.1428718566895,"y":684.428581237793,"wires":[]},{"id":"4dc1ecdb.c939d4","type":"link in","z":"463827ad.2066a8","name":"Zone 3","links":["2917bd24.cfa3d2","4f3323ec.057d4c"],"x":69,"y":1409,"wires":[["1337f0cb.77b2cf","8f07e045.d0309"]]},{"id":"2917bd24.cfa3d2","type":"link out","z":"463827ad.2066a8","name":"","links":["4dc1ecdb.c939d4"],"x":706.1428718566895,"y":754.428581237793,"wires":[]},{"id":"25525321.26cb2c","type":"link in","z":"463827ad.2066a8","name":"Runtime","links":["436b0310.ca777c","d7fac06a.38e5d","614a37da.555c08"],"x":72,"y":1487,"wires":[["13c8b9a0.953d76"]]},{"id":"436b0310.ca777c","type":"link out","z":"463827ad.2066a8","name":"","links":["25525321.26cb2c"],"x":727.1428718566895,"y":935.428581237793,"wires":[]},{"id":"d7fac06a.38e5d","type":"link out","z":"463827ad.2066a8","name":"","links":["25525321.26cb2c"],"x":786.1428718566895,"y":600.428581237793,"wires":[]},{"id":"614a37da.555c08","type":"link out","z":"463827ad.2066a8","name":"","links":["25525321.26cb2c"],"x":725.1428833007812,"y":395.4285888671875,"wires":[]},{"id":"e3dda6d2.6026b8","type":"ui_switch","z":"463827ad.2066a8","name":"Enabler","label":"Enable Irrigation","group":"905671d0.3a2cf","order":1,"width":0,"height":0,"passthru":true,"topic":"irrenable","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":97,"y":223,"wires":[["19f23051.67d94"]]},{"id":"19f23051.67d94","type":"function","z":"463827ad.2066a8","name":"Store","func":"global.set(msg.topic,msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":248,"y":223,"wires":[["72c7fa06.88a914"]]},{"id":"509e2e66.ec54b","type":"function","z":"463827ad.2066a8","name":"Store","func":"global.set(msg.topic,msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":288,"y":272,"wires":[["72c7fa06.88a914"]]},{"id":"b890d264.edf","type":"comment","z":"463827ad.2066a8","name":"Manual mode","info":"","x":86,"y":1559,"wires":[]},{"id":"5375d3dc.c140bc","type":"link out","z":"463827ad.2066a8","name":"","links":["f9767f4e.69436"],"x":268,"y":1611,"wires":[]},{"id":"1ef5b693.cde609","type":"ui_switch","z":"463827ad.2066a8","name":"Zone 1","label":"Zone 1","group":"8da7c4d6.d33088","order":2,"width":0,"height":0,"passthru":true,"topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":121,"y":1653,"wires":[["9ec74b9f.ce8d78"]]},{"id":"9ec74b9f.ce8d78","type":"link out","z":"463827ad.2066a8","name":"","links":["6c0f560c.6003d8"],"x":269,"y":1653,"wires":[]},{"id":"92112412.83cb38","type":"ui_switch","z":"463827ad.2066a8","name":"Zone 2","label":"Zone 2","group":"8da7c4d6.d33088","order":3,"width":0,"height":0,"passthru":true,"topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":121,"y":1697,"wires":[["3d447063.7e7dc"]]},{"id":"3d447063.7e7dc","type":"link out","z":"463827ad.2066a8","name":"","links":["7c23918c.22376"],"x":269,"y":1697,"wires":[]},{"id":"967d1a28.870a68","type":"ui_switch","z":"463827ad.2066a8","name":"Zone 3","label":"Zone 3","group":"8da7c4d6.d33088","order":4,"width":0,"height":0,"passthru":true,"topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":120,"y":1742,"wires":[["4f3323ec.057d4c"]]},{"id":"4f3323ec.057d4c","type":"link out","z":"463827ad.2066a8","name":"","links":["4dc1ecdb.c939d4"],"x":268,"y":1742,"wires":[]},{"id":"c1d2b3ec.f9174","type":"ui_switch","z":"463827ad.2066a8","name":"Pump","label":"Pump","group":"8da7c4d6.d33088","order":1,"width":0,"height":0,"passthru":true,"topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":111,"y":1612,"wires":[["5375d3dc.c140bc"]]},{"id":"9030421.aeda1c","type":"link out","z":"463827ad.2066a8","name":"","links":["d81c170f.f0ebb8"],"x":999,"y":482,"wires":[]},{"id":"cf24c2db.6742","type":"link out","z":"463827ad.2066a8","name":"","links":["d81c170f.f0ebb8"],"x":725,"y":889,"wires":[]},{"id":"de531489.e20498","type":"switch","z":"463827ad.2066a8","name":"Pump on check","property":"pump_state","propertyType":"global","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":1,"x":413,"y":396,"wires":[["62e258d8.dd5f78"]]},{"id":"905671d0.3a2cf","type":"ui_group","z":"","name":"Start Time","tab":"4cbe852c.87c07c","order":1,"disp":true,"width":"6"},{"id":"ec9718e3.d842b8","type":"ui_group","z":"","name":"Preset Start Times","tab":"4cbe852c.87c07c","order":2,"disp":true,"width":"6"},{"id":"8a51f262.40562","type":"ui_group","z":"","name":"Zone Status","tab":"4cbe852c.87c07c","order":3,"disp":true,"width":"6"},{"id":"8da7c4d6.d33088","type":"ui_group","z":"","name":"Manual","tab":"4cbe852c.87c07c","order":4,"disp":true,"width":"6"},{"id":"4cbe852c.87c07c","type":"ui_tab","z":"","name":"Irrigation","icon":"call_split","order":2}]
nygma2004

Flow Info

created 5 months, 1 week ago

Node Types

Core
  • change (x5)
  • comment (x10)
  • debug (x3)
  • function (x15)
  • inject (x2)
  • rpi-gpio out (x4)
  • switch (x5)
  • trigger (x3)
Other
  • link in (x5)
  • link out (x14)
  • tab (x1)
  • ui_button (x2)
  • ui_dropdown (x3)
  • ui_group (x4)
  • ui_switch (x5)
  • ui_tab (x1)
  • ui_template (x5)
  • ui_text (x2)

Tags

  • sprinkler
  • dashboard
  • irrigation
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option