Hallo Everyone,
Hope you could assist me with a challenge I face regards to a GPIO Status, to only receive an trigger 1 / 0 subject to its status .
My Flow starts with a GPIO 07 ( 0 = off / normal state ) and if triggered sends (1) to next "trigger" node that send out a number 1 to other OUT-GPIO's and need to trigger another specific OUT-GPIO ( GPIO05-29) only if the status of GPIO05-29 == 0 == do nothing ,but this is where my confusion / stupidity comes in play .... The Trigger Node sends a 1 and after 8 seconds a 0 , so how do i go about a if statement or switch node to check the status of GPIO05-29 is on (0) and if (0) , its needs to bet temp be switch off (1) for the period of the trigger node (8sec) and then be turned back to previous / original state (0) ...BUT if GPIO05-29 == 1 (off) then it should not receive ant payload from the trigger node that will send a 0 and 8 sec later 1 .
I hope i have explained it well enough and i will appreciate your help and support on this challenge.
Please see my flow below edited with only the critical portion for your connivance
[{"id":"dab3a29.e9af46","type":"rpi-gpio out","z":"8d9d129f.61bd1","name":"CH1 Relay / kunsmis pump ","pin":"29","set":false,"level":"1","freq":"","out":"out","x":1880,"y":100,"wires":[]},{"id":"2b8c3ce.82b5cc4","type":"inject","z":"8d9d129f.61bd1","name":"Status of GPIO / Realy state = 1","topic":"Status of GPIO 05-29 / Realy state","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1090,"y":100,"wires":[["dab3a29.e9af46","fb98d28d.44e4e"]]},{"id":"a89ea71f.c90318","type":"inject","z":"8d9d129f.61bd1","name":"Status of GPIO / Realy state = 0","topic":"Status of GPIO 05-29 / Realy state","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1090,"y":160,"wires":[["dab3a29.e9af46","fb98d28d.44e4e"]]},{"id":"6abc3aea.21d0f4","type":"function","z":"8d9d129f.61bd1","name":"Test IF ","func":"if (msg.payload.gpio1 == 1) {\nmsg.payload = 1;\nreturn msg;\n}\nelse{\n msg.payload = 0;\nreturn msg;\n}\n\n ","outputs":1,"noerr":0,"x":1650,"y":220,"wires":[["dab3a29.e9af46","fb98d28d.44e4e"]]},{"id":"fb98d28d.44e4e","type":"debug","z":"8d9d129f.61bd1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1830,"y":160,"wires":[]},{"id":"8c45fd1.e0b15","type":"trigger","z":"8d9d129f.61bd1","op1":"0","op2":"1","op1type":"num","op2type":"num","duration":"8","extend":false,"units":"s","reset":"0","bytopic":"all","name":"KunsmisPompTrigger","x":1440,"y":220,"wires":[["6abc3aea.21d0f4"]]},{"id":"9c2de007.8fe97","type":"inject","z":"8d9d129f.61bd1","name":"IN - GRIO 07-26 Trigger evengt = ON ","topic":"IN -GRIO 07-26 Trigger on = 1","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1110,"y":220,"wires":[["8c45fd1.e0b15"]]}]