Good evening, I'm safrizal. I am having problems in making a program on node-red. I am asking for help from friends and masters here if you can help my problems. So I made the program to command in a sequence more precisely for the arrangement of 7 valves which will be opened and closed alternately or simultaneously. simply I want to do command A after that to command B and so on. I want when command B is done then command A stops to neutral and does not affect command B. I ask for help if anyone understands this? Thank you for your help, may God Bless you, amen
This is my code :
[{"id":"500b7da7.1772d4","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c6baab38.f37698","type":"ui_switch","z":"500b7da7.1772d4","name":"","label":"Alirkan","group":"9a986029.f4a13","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"buka","onvalueType":"str","onicon":"","oncolor":"","offvalue":"tutup","offvalueType":"str","officon":"","offcolor":"","x":796.6666259765625,"y":430,"wires":[["8a7668a3.45e4b","a54a9e88.2c5418","3774b0b5.e4e908","8805d3f1.dbdc1"]]},{"id":"f4821b4.fc58a68","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve Pengaduk 40","pin":"40","set":"","level":"0","freq":"","out":"out","x":1233.6666259765625,"y":390,"wires":},{"id":"ca5cf503.2451b8","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve Keatas 38","pin":"38","set":"","level":"0","freq":"","out":"out","x":1203.9998779296875,"y":266.6666488647461,"wires":},{"id":"8805d3f1.dbdc1","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve buka/',payload:'true'}; \n } \nreturn null;\n\n","outputs":1,"noerr":0,"x":1002.6666259765625,"y":317,"wires":[["ca5cf503.2451b8"]]},{"id":"3774b0b5.e4e908","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve tutup/',payload:'false'}; \n } \nreturn null;\n","outputs":1,"noerr":0,"x":1020.6666259765625,"y":357,"wires":[["f4821b4.fc58a68","a669cce2.5d89a8","89c5e5e7.87cff","eacbd777.12e028","93c65eb4.855748"]]},{"id":"a54a9e88.2c5418","type":"delay","z":"500b7da7.1772d4","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1022.6666259765625,"y":454,"wires":[["3521a5fe.f05bca","2b302558.b9526a","f923495d.c3bb5"]]},{"id":"87c0d93c.5a1098","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 2 . 32","pin":"32","set":"","level":"0","freq":"","out":"out","x":1380.3333740234375,"y":471.66668701171875,"wires":},{"id":"1eae8e24.1542f2","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 1. 36","pin":"36","set":"","level":"0","freq":"","out":"out","x":1340.3333740234375,"y":434.3333435058594,"wires":},{"id":"3521a5fe.f05bca","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve buka/',payload:'true'}; \n } \nreturn null;\n\n","outputs":1,"noerr":0,"x":1189.6666259765625,"y":468.0000305175781,"wires":[["1eae8e24.1542f2"]]},{"id":"2b302558.b9526a","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve tutup/',payload:'false'}; \n } \nreturn null;\n","outputs":1,"noerr":0,"x":1165.6666259765625,"y":526,"wires":[["87c0d93c.5a1098","74f1ed36.0bb0b4","731eee1d.7b08e8"]]},{"id":"f923495d.c3bb5","type":"delay","z":"500b7da7.1772d4","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1080.6666259765625,"y":639,"wires":[["b6762b76.9e146","5f33e06f.abd868","824e836f.f894a8"]]},{"id":"328abc7b.ef8694","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 2 . 32","pin":"32","set":"","level":"0","freq":"","out":"out","x":1499.9998779296875,"y":582,"wires":},{"id":"a6e2e09c.18f35","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 3. 22","pin":"22","set":"","level":"0","freq":"","out":"out","x":1535.9998779296875,"y":640.9999694824219,"wires":},{"id":"b6762b76.9e146","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve buka/',payload:'true'}; \n } \nreturn null;","outputs":1,"noerr":0,"x":1266.6666259765625,"y":649,"wires":[["328abc7b.ef8694"]]},{"id":"5f33e06f.abd868","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve tutup/',payload:'false'}; \n } \nreturn null;","outputs":1,"noerr":0,"x":1273.6666259765625,"y":696,"wires":[["a6e2e09c.18f35","ea9e35f6.7dadc8","8154a7fd.641708"]]},{"id":"ea9e35f6.7dadc8","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 1. 36","pin":"36","set":"","level":"0","freq":"","out":"out","x":1546.9998779296875,"y":689.5,"wires":},{"id":"824e836f.f894a8","type":"delay","z":"500b7da7.1772d4","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1091.6666259765625,"y":781,"wires":[["84efa09d.9749a","29656942.aa8196","bb9f208d.56c868"]]},{"id":"a28c78f7.dd7d6","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 2 . 32","pin":"32","set":"","level":"0","freq":"","out":"out","x":1539.6666259765625,"y":852,"wires":},{"id":"a6b21886.2c0ae8","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 3. 22","pin":"22","set":"","level":"0","freq":"","out":"out","x":1558.6666259765625,"y":787,"wires":},{"id":"84efa09d.9749a","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve buka/',payload:'true'}; \n } \nreturn null;","outputs":1,"noerr":0,"x":1290.6666259765625,"y":769,"wires":[["a6b21886.2c0ae8"]]},{"id":"29656942.aa8196","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve tutup/',payload:'false'}; \n } \nreturn null;","outputs":1,"noerr":0,"x":1294.6666259765625,"y":860,"wires":[["32233256.bd93fe","a28c78f7.dd7d6","e55f57b6.4e0588"]]},{"id":"32233256.bd93fe","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 1. 36","pin":"36","set":"","level":"0","freq":"","out":"out","x":1547.6666259765625,"y":891,"wires":},{"id":"e55f57b6.4e0588","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 4. 18","pin":"18","set":"","level":"0","freq":"","out":"out","x":1544.6666259765625,"y":933,"wires":},{"id":"bb9f208d.56c868","type":"delay","z":"500b7da7.1772d4","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1078.6666259765625,"y":1026,"wires":[["e073ebea.ce9b68","2bd0d9af.ed5506","2afd518d.5deec6"]]},{"id":"fcebbfcf.7f1ee","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 2 . 32","pin":"32","set":"","level":"0","freq":"","out":"out","x":1526.6666259765625,"y":1097,"wires":},{"id":"f46d0a82.44bea8","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 3. 22","pin":"22","set":"","level":"0","freq":"","out":"out","x":1528.6666259765625,"y":1183,"wires":},{"id":"e073ebea.ce9b68","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve buka/',payload:'true'}; \n } \nreturn null;\n","outputs":1,"noerr":0,"x":1277.6666259765625,"y":1014,"wires":[["79d8c910.9fa02"]]},{"id":"2bd0d9af.ed5506","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve tutup/',payload:'false'}; \n } \nreturn null;","outputs":1,"noerr":0,"x":1320.6666259765625,"y":1084,"wires":[["7f4f7edd.c8daa","fcebbfcf.7f1ee","f46d0a82.44bea8"]]},{"id":"7f4f7edd.c8daa","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 1. 36","pin":"36","set":"","level":"0","freq":"","out":"out","x":1519.6666259765625,"y":1138,"wires":},{"id":"79d8c910.9fa02","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 4. 18","pin":"18","set":"","level":"0","freq":"","out":"out","x":1513,"y":1021.9999389648438,"wires":},{"id":"89c5e5e7.87cff","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 7 .35","pin":"35","set":"","level":"0","freq":"","out":"out","x":1449.6666259765625,"y":332.58331298828125,"wires":},{"id":"a669cce2.5d89a8","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 8. 37","pin":"37","set":"","level":"0","freq":"","out":"out","x":1450.3333129882812,"y":270.99999237060547,"wires":},{"id":"eacbd777.12e028","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 6. 33","pin":"33","set":"","level":"0","freq":"","out":"out","x":1448.9998168945312,"y":372.8333282470703,"wires":},{"id":"93c65eb4.855748","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 5 . 29","pin":"29","set":"","level":"0","freq":"","out":"out","x":1464.4165649414062,"y":400.0833435058594,"wires":},{"id":"74fdbe23.55cb68","type":"ui_audio","z":"500b7da7.1772d4","name":"","group":"7dfeba72.29a71c","voice":"en-US","always":true,"x":961.9999084472656,"y":677.3333435058594,"wires":},{"id":"8a7668a3.45e4b","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve tutup/',payload:'Mengalirkan larutan'}; \n } \nreturn null;\n","outputs":1,"noerr":0,"x":954.6665954589844,"y":545.6666870117188,"wires":[["74fdbe23.55cb68"]]},{"id":"4bcbf5a.9a1300c","type":"ui_audio","z":"500b7da7.1772d4","name":"","group":"7dfeba72.29a71c","voice":"en-US","always":true,"x":1835.6666259765625,"y":1546,"wires":},{"id":"2afd518d.5deec6","type":"delay","z":"500b7da7.1772d4","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1373.6666259765625,"y":1287,"wires":[["3277f613.902dd2","5a25796b.15bf8"]]},{"id":"95561dcf.7ff128","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Pompa Utama. 7","pin":"7","set":"","level":"0","freq":"","out":"out","x":1823.333251953125,"y":1305.3333129882812,"wires":},{"id":"3277f613.902dd2","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve tutup/',payload:'false'}; \n } \nreturn null;","outputs":1,"noerr":0,"x":1561.6666259765625,"y":1308,"wires":[["95561dcf.7ff128","3abdfc70.1b3004","3cce0e24.db46aa","ec2e63e2.6c68b8","7470a923.dba0a"]]},{"id":"7470a923.dba0a","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 4. 18","pin":"18","set":"","level":"0","freq":"","out":"out","x":1829.6666259765625,"y":1481,"wires":},{"id":"3cce0e24.db46aa","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 2 . 32","pin":"32","set":"","level":"0","freq":"","out":"out","x":1826.6666259765625,"y":1397,"wires":},{"id":"3abdfc70.1b3004","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 1. 36","pin":"36","set":"","level":"0","freq":"","out":"out","x":1823.6666259765625,"y":1360,"wires":},{"id":"ec2e63e2.6c68b8","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 3. 22","pin":"22","set":"","level":"0","freq":"","out":"out","x":1829.6666259765625,"y":1438,"wires":},{"id":"5a25796b.15bf8","type":"function","z":"500b7da7.1772d4","name":"Function","func":"if (msg.payload == 'buka') \n {\n return {topic:'valve tutup/',payload:'Tanki Terisi Penuh'}; \n } \nreturn null;","outputs":1,"noerr":0,"x":1567.6666259765625,"y":1422,"wires":[["4bcbf5a.9a1300c"]]},{"id":"74f1ed36.0bb0b4","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 3. 22","pin":"22","set":"","level":"0","freq":"","out":"out","x":1392.9999389648438,"y":530.3332824707031,"wires":},{"id":"731eee1d.7b08e8","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 4. 18","pin":"18","set":"","level":"0","freq":"","out":"out","x":1385.6666259765625,"y":504.3333435058594,"wires":},{"id":"8154a7fd.641708","type":"rpi-gpio out","z":"500b7da7.1772d4","name":"Valve 4. 18","pin":"18","set":"","level":"0","freq":"","out":"out","x":1554,"y":733.4999389648438,"wires":},{"id":"9a986029.f4a13","type":"ui_group","z":"","name":"Fase II","tab":"14b42a7f.a25596","disp":true,"width":"6","collapse":false},{"id":"7dfeba72.29a71c","type":"ui_group","z":"","name":"Fase I","tab":"14b42a7f.a25596","disp":true,"width":"10","collapse":false},{"id":"14b42a7f.a25596","type":"ui_tab","z":"","name":"Kontrol","icon":"dashboard"}]