Hi
For what I understood about your problem (maybe not so much ) My suggestion is the following
[{"id":"30d28a92.a59416","type":"function","z":"34a2e63d.af4712","name":"Payload 0","func":"var sr = context.get('sr')||0;\nif (msg.payload == \"set\")\n {context.set('sr',1);\n sr = 1;\n return;\n }\nif (msg.payload == \"reset\")\n {context.set('sr',0);\n sr = 0;\n return;\n }\nif (sr === 1)\n {\n return;\n }\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":240,"wires":[["85c167df.a57368","3f0ccc3f.890604","562667.a8ca9998","51338a5e.337f04"]]},{"id":"ff65ae82.059468","type":"switch","z":"34a2e63d.af4712","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"10.00","vt":"num"}],"checkall":"true","outputs":1,"x":390,"y":240,"wires":[["30d28a92.a59416"]]},{"id":"85c167df.a57368","type":"trigger","z":"34a2e63d.af4712","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","name":"wait to turn off","x":860,"y":240,"wires":[["36d23810.3e936","a5230720.4a76d"]]},{"id":"438b0d75.53d414","type":"inject","z":"34a2e63d.af4712","name":"debug input","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":110,"y":80,"wires":[["6832288c.61929"]]},{"id":"ce98cad2.70036","type":"function","z":"34a2e63d.af4712","name":"","func":"msg.payload = msg.payload * 1;\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":240,"wires":[["ff65ae82.059468"]]},{"id":"e00f11aa.b991e","type":"debug","z":"34a2e63d.af4712","name":"turn on","active":true,"console":"false","complete":"payload","x":800,"y":380,"wires":[]},{"id":"c7fcc461.e6e318","type":"debug","z":"34a2e63d.af4712","name":"turn off","active":true,"console":"false","complete":"payload","x":1080,"y":400,"wires":[]},{"id":"36d23810.3e936","type":"trigger","z":"34a2e63d.af4712","op1":"","op2":"reset","op1type":"nul","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","name":"wait to reset (time close)","x":936.6666259765625,"y":48.33332061767578,"wires":[["30d28a92.a59416","c15961c5.a2fce8"]]},{"id":"3f0ccc3f.890604","type":"function","z":"34a2e63d.af4712","name":"set","func":"if (msg.payload != \"reset\") {\nmsg.payload = \"set\";\nreturn msg;}\nelse\n{return;}","outputs":1,"noerr":0,"x":676.6666259765625,"y":96.6666488647461,"wires":[["30d28a92.a59416"]]},{"id":"562667.a8ca9998","type":"function","z":"34a2e63d.af4712","name":"","func":"msg.payload = \"open valve\";\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":300,"wires":[["e00f11aa.b991e"]]},{"id":"a5230720.4a76d","type":"function","z":"34a2e63d.af4712","name":"","func":"msg.payload = \"close valve\";\nreturn msg;","outputs":1,"noerr":0,"x":963.3333740234375,"y":321.66668701171875,"wires":[["c7fcc461.e6e318"]]},{"id":"6832288c.61929","type":"random","z":"34a2e63d.af4712","name":"debug generator","low":"1","high":"20","inte":"false","x":210,"y":160,"wires":[["715b0fa3.c96608","ce98cad2.70036"]]},{"id":"715b0fa3.c96608","type":"debug","z":"34a2e63d.af4712","name":"","active":true,"console":"false","complete":"false","x":448.125,"y":85,"wires":[]},{"id":"51338a5e.337f04","type":"debug","z":"34a2e63d.af4712","name":"","active":true,"console":"false","complete":"false","x":818.1249389648438,"y":191.24996948242188,"wires":[]},{"id":"b242edff.6e298","type":"debug","z":"34a2e63d.af4712","name":"","active":true,"console":"false","complete":"payload","x":1162.291748046875,"y":261.2499694824219,"wires":[]},{"id":"c15961c5.a2fce8","type":"function","z":"34a2e63d.af4712","name":"","func":"msg.payload = \"reset\";\nreturn msg;","outputs":1,"noerr":0,"x":1100,"y":153.3333282470703,"wires":[["b242edff.6e298"]]}]
hoping it can helps
All best
M