I have a simple flow using a RPi to control lights. It uses the rpi-gpio in and rpi-gpio out nodes with a time out trigger and toggle node in between.
The flow works just fine. With each input, the relay will toggle on and off as long as its not the time out trigger that turned the relay off.
However if the time out trigger does turn off the relay, then it takes two inputs cycles to turn the relay back on since the flow is out of sequence.
Since this light will be used by several people, I would like to eliminate the confusion of the light not turning back on after it has timed out without a second push of the button.
[{"id":"6c4e53bf.97148c","type":"subflow","name":"Toggle 1/0","info":"","category":"","in":[{"x":60,"y":180,"wires":[{"id":"5047f5ea.66c1ec"}]}],"out":[{"x":780,"y":160,"wires":[{"id":"82ff5a1a.efefc8","port":0},{"id":"26637948.29d256","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"7347b78.8b23848","type":"switch","z":"6c4e53bf.97148c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":180,"wires":[["82ff5a1a.efefc8"],["26637948.29d256"]]},{"id":"82ff5a1a.efefc8","type":"change","z":"6c4e53bf.97148c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"},{"t":"set","p":"next","pt":"flow","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":140,"wires":[[]]},{"id":"26637948.29d256","type":"change","z":"6c4e53bf.97148c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"},{"t":"set","p":"next","pt":"flow","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":200,"wires":[[]]},{"id":"5047f5ea.66c1ec","type":"function","z":"6c4e53bf.97148c","name":"get next value","func":"msg.payload = flow.get(\"next\")||0;\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":180,"wires":[["7347b78.8b23848"]]},{"id":"2000d610.24a2ca","type":"rpi-gpio in","z":"29688e2c.d40952","name":"Input 5","pin":"31","intype":"tri","debounce":"25","read":false,"x":190,"y":1300,"wires":[["b19b39b8.67a318"]]},{"id":"68f01d6b.784514","type":"rpi-gpio out","z":"29688e2c.d40952","name":"Output 6","pin":"36","set":"","level":"0","freq":"","out":"out","x":1100,"y":1300,"wires":[]},{"id":"175a97eb.fbf888","type":"timeouttrigger","z":"29688e2c.d40952","ontimeouttype":"str","ontimeoutval":"1","duration":"5","units":"s","name":"","x":870,"y":1300,"wires":[["68f01d6b.784514"]]},{"id":"b5f6c566.5af8d8","type":"subflow:6c4e53bf.97148c","z":"29688e2c.d40952","name":"","env":[],"x":670,"y":1300,"wires":[["175a97eb.fbf888"]]},{"id":"b19b39b8.67a318","type":"switch","z":"29688e2c.d40952","name":"pass only 1s block 0s","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":1300,"wires":[["b5f6c566.5af8d8"]]}]