Argh!
How about this:
[{"id":"19c34f22.1b1c29","type":"inject","z":"fc6fbf47.86d3e8","name":"Reset","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":100,"y":70,"wires":[["37176db4.a7f91a"]]},{"id":"37176db4.a7f91a","type":"trigger","z":"fc6fbf47.86d3e8","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"-4","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":320,"y":120,"wires":[["a432b8a8.5d82f8","3d921823.47e428"]]},{"id":"b4da3c74.87be","type":"inject","z":"fc6fbf47.86d3e8","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":120,"wires":[["37176db4.a7f91a"]]},{"id":"ee8f2dd5.12e408","type":"debug","z":"fc6fbf47.86d3e8","name":"Toggle","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":620,"y":60,"wires":[]},{"id":"a432b8a8.5d82f8","type":"function","z":"fc6fbf47.86d3e8","name":"","func":"var x = context.get(\"toggle\") || 0;\n\nx = x + 1;\ncontext.set(\"toggle\",x);\n\nx = x%2;\n\nmsg.payload = x;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":120,"wires":[["ee8f2dd5.12e408","ee454ba6.42219"]]},{"id":"ee454ba6.42219","type":"change","z":"fc6fbf47.86d3e8","name":"From sensor","rules":[{"t":"set","p":"state","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":120,"wires":[[]]},{"id":"35f098ff.4fb488","type":"inject","z":"fc6fbf47.86d3e8","name":"ON","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"ON","payloadType":"str","x":160,"y":430,"wires":[["b28cf4b.2c00488","fed734ce.1e307"]]},{"id":"f5718044.5024b8","type":"inject","z":"fc6fbf47.86d3e8","name":"STANDBY","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SB","payloadType":"str","x":170,"y":480,"wires":[["b28cf4b.2c00488"]]},{"id":"6c2170b7.e9e3b8","type":"comment","z":"fc6fbf47.86d3e8","name":"Standby output simulation","info":"","x":390,"y":80,"wires":[]},{"id":"3d921823.47e428","type":"link out","z":"fc6fbf47.86d3e8","name":"CLOCK","links":["b9d287f.affa178","985ea4bd.4fa2c"],"x":315,"y":170,"wires":[]},{"id":"b9d287f.affa178","type":"link in","z":"fc6fbf47.86d3e8","name":"CLOCK","links":["3d921823.47e428"],"x":75,"y":300,"wires":[["e13828e9.c4d01"]]},{"id":"e13828e9.c4d01","type":"change","z":"fc6fbf47.86d3e8","name":"get flow.mode","rules":[{"t":"set","p":"payload","pt":"msg","to":"mode","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":300,"wires":[["3c8ab0e3.681ca","cc0ca5de.84be78"]]},{"id":"b28cf4b.2c00488","type":"change","z":"fc6fbf47.86d3e8","name":"set flow.mode","rules":[{"t":"set","p":"mode","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":460,"wires":[[]]},{"id":"3c8ab0e3.681ca","type":"switch","z":"fc6fbf47.86d3e8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"SB","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":300,"wires":[["bd7a1ca4.678a8"],["8cd6ae25.5b20c"]]},{"id":"985ea4bd.4fa2c","type":"link in","z":"fc6fbf47.86d3e8","name":"CLOCK","links":["3d921823.47e428"],"x":605,"y":180,"wires":[[]]},{"id":"fed734ce.1e307","type":"change","z":"fc6fbf47.86d3e8","name":"SET ON","rules":[{"t":"set","p":"state","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":420,"wires":[[]]},{"id":"cc0ca5de.84be78","type":"debug","z":"fc6fbf47.86d3e8","name":"MODE","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":190,"y":350,"wires":[]},{"id":"bd7a1ca4.678a8","type":"delay","z":"fc6fbf47.86d3e8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":480,"y":270,"wires":[["7064a5d7.dd19b4"]]},{"id":"f745622e.2022d","type":"change","z":"fc6fbf47.86d3e8","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":340,"wires":[["bd7a1ca4.678a8"]]},{"id":"8cd6ae25.5b20c","type":"switch","z":"fc6fbf47.86d3e8","name":"SB?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"SB","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":340,"wires":[["f745622e.2022d","2cbf2225.cba0b6"]]},{"id":"a110a4c1.746968","type":"debug","z":"fc6fbf47.86d3e8","name":"Output","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":900,"y":290,"wires":[]},{"id":"2cbf2225.cba0b6","type":"change","z":"fc6fbf47.86d3e8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"SB","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":380,"wires":[["7064a5d7.dd19b4"]]},{"id":"7064a5d7.dd19b4","type":"rbe","z":"fc6fbf47.86d3e8","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":750,"y":290,"wires":[["a110a4c1.746968"]]}]
Oh, "how to use)
Press start
to get things going.
Then use the standy
or ON
button to select what the mode is.
Oh, and the times in the trigger
and delay
need to be adjusted.