I agree with @dceejay's suggestion about trigger
nodes.
Here is a flow which may help you with ideas.
The two inject
nodes are one output from bigtimer
node.
the two debug
nodes could be the same also.
I just used separate ones to help you see what is happening.
[{"id":"b95543c8.1478f8","type":"tab","label":"Flow 13","disabled":false,"info":""},{"id":"571318e0.ac25e8","type":"gate","z":"b95543c8.1478f8","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":310,"y":680,"wires":[["cc8f353b.57f9c","d5b7a0f0.dfd4a8"]]},{"id":"9a50daa5.3df158","type":"inject","z":"b95543c8.1478f8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":680,"wires":[["571318e0.ac25e8"]]},{"id":"d5b7a0f0.dfd4a8","type":"debug","z":"b95543c8.1478f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":450,"y":680,"wires":[]},{"id":"cc8f353b.57f9c","type":"change","z":"b95543c8.1478f8","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":760,"wires":[["571318e0.ac25e8"]]},{"id":"7d7923c1.884144","type":"inject","z":"b95543c8.1478f8","name":"","topic":"control","payload":"open","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":720,"wires":[["571318e0.ac25e8"]]},{"id":"abb4eee7.21ed1","type":"inject","z":"b95543c8.1478f8","name":"One","topic":"GATE","payload":"open","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":930,"wires":[["21cb4fa1.ccdaf"]]},{"id":"21cb4fa1.ccdaf","type":"function","z":"b95543c8.1478f8","name":"One only V2","func":"var full = context.get(\"FULL\") || 0;\nif (msg.topic == \"GATE\")\n{\n //\n if (msg.payload == \"FULL\")\n {\n // Allow all messages\n context.set(\"FULL\", 1);\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"FULL\"});\n return;\n } else\n if (msg.payload == \"CLOSE\")\n {\n // Stop messages\n context.set(\"FULL\", 0);\n context.set(\"ALLOW\",0);\n node.status({});\n return;\n } else\n //\n {\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"ONE\"});\n return;\n }\n}\nif (context.get(\"ALLOW\") == 1)\n{\n //\n if (full == 0)\n {\n context.set(\"ALLOW\",0);\n node.status({});\n return msg;\n } else\n return msg;\n}\n\n","outputs":1,"noerr":0,"x":320,"y":890,"wires":[["d075c6f8.b05ce"]]},{"id":"4227af45.46904","type":"inject","z":"b95543c8.1478f8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":890,"wires":[["21cb4fa1.ccdaf"]]},{"id":"d075c6f8.b05ce","type":"debug","z":"b95543c8.1478f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":490,"y":890,"wires":[]},{"id":"f0301d00.1606c8","type":"inject","z":"b95543c8.1478f8","name":"Full","topic":"GATE","payload":"FULL","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":970,"wires":[["21cb4fa1.ccdaf"]]},{"id":"3bb58a03.9e67be","type":"inject","z":"b95543c8.1478f8","name":"Close","topic":"GATE","payload":"CLOSE","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":1010,"wires":[["21cb4fa1.ccdaf"]]},{"id":"479fd43e.358454","type":"function","z":"b95543c8.1478f8","name":"Cycle next value","func":"switch (msg.next) {\n \n case 1:\n msg.delay = msg.runtime1;\n msg.payload = 1; \n msg.next = 2;\n break;\n case 2:\n msg.delay = msg.runtime2;\n msg.payload = 2;\n msg.next = 3;\n break; \n case 3:\n msg.delay = msg.runtime3;\n msg.payload = 3;\n msg.next = 4;\n break; \n \n case 4:\n msg.delay = msg.runtime4;\n msg.payload = 4;\n// msg.payload = \"OFF\";\n msg.next = 5;\n break; \n case 5:\n msg.delay = msg.runtime5;\n msg.payload = \"OFF\";\n msg.next = 6;\n break; \n case 6:\n msg.reset = true;\n break;\n}\nmsg.who = \"auto off\";\nnode.status(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":270,"wires":[["ca5e2f2a.1f74f"]]},{"id":"ca5e2f2a.1f74f","type":"delay","z":"b95543c8.1478f8","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":460,"y":330,"wires":[["479fd43e.358454","102643e2.790e94"]]},{"id":"4666bd6c.b6c854","type":"function","z":"b95543c8.1478f8","name":"Initialize","func":"var delay = flow.get('delay') || 15; //15 if not set\n\nvar interval = delay * 1000; // convert value to seconds.\n//var interval = 30*60000; // (30 minutes)\n// interval = 3000; // Test\n// Define runtime1\nmsg.runtime1 = interval;\n\n// Define runtime2\nmsg.runtime2 = interval;\n\n// Define runtime3\nmsg.runtime3 = interval;\n\n// Define runtime4\nmsg.runtime4 = interval;\n\n// Define runtime5\nmsg.runtime5 = interval;\n\n// Define runtime6\nmsg.runtime6 = interval;\n\n// Next to be activated is number 1\nmsg.next = 1;\n\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":270,"wires":[["479fd43e.358454"]]},{"id":"ce83e5eb.580578","type":"inject","z":"b95543c8.1478f8","name":"","topic":"","payload":"foo","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":270,"wires":[["4666bd6c.b6c854"]]},{"id":"c5d2d8f5.c3614","type":"inject","z":"b95543c8.1478f8","name":"Set","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":200,"wires":[["d17dcd3d.6fb34"]]},{"id":"d17dcd3d.6fb34","type":"change","z":"b95543c8.1478f8","name":"","rules":[{"t":"set","p":"delay","pt":"flow","to":"4","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":200,"wires":[[]]},{"id":"102643e2.790e94","type":"debug","z":"b95543c8.1478f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":330,"wires":[]},{"id":"8dfd6227.642908","type":"function","z":"b95543c8.1478f8","name":"","func":"var act = context.get(\"activate\");\nif (msg.payload == 'on'){\n act = 1;\n context.set(\"activate\", act)\n}\nelse {\n act = 0;\n context.set(\"activate\", act)\n}\nif(msg.topic == 'turnon' && act == 1){\n msg.payload = 1;\n}\nelse{\n msg.payload = 0;\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":490,"wires":[["c182ddfe.f2e2f"]]},{"id":"dfa4949b.3af7e8","type":"inject","z":"b95543c8.1478f8","name":"","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":420,"wires":[["8dfd6227.642908"]]},{"id":"c182ddfe.f2e2f","type":"debug","z":"b95543c8.1478f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":530,"y":490,"wires":[]},{"id":"2dee088a.238868","type":"inject","z":"b95543c8.1478f8","name":"","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":460,"wires":[["8dfd6227.642908"]]},{"id":"e6e62134.e97498","type":"inject","z":"b95543c8.1478f8","name":"Active","topic":"active","payload":"active","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":500,"wires":[["8dfd6227.642908"]]},{"id":"d20f5a68.c104c","type":"mqtt in","z":"b95543c8.1478f8","name":"IR_Command_RX","topic":"IR_REMOTE_CONTROL/#","qos":"2","datatype":"auto","broker":"8a2e80be.f7c928","x":170,"y":1200,"wires":[["2df2942d.674894","8be3cb06.ea8248"]]},{"id":"92a365c6.af355","type":"mqtt out","z":"b95543c8.1478f8","name":"IR_TX","topic":"","qos":"","retain":"","broker":"8a2e80be.f7c928","x":1070,"y":1310,"wires":[]},{"id":"2df2942d.674894","type":"debug","z":"b95543c8.1478f8","name":"RX","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":370,"y":1160,"wires":[]},{"id":"a0855ef3.c05038","type":"debug","z":"b95543c8.1478f8","name":"TX","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1070,"y":1360,"wires":[]},{"id":"25b3f758.654538","type":"function","z":"b95543c8.1478f8","name":"TV Volume DOWN","func":"msg.payload = {\"Protocol\":\"SAMSUNG\",\"Bits\":32,\"Data\":\"0xE0E0D02F\",\"Repeat\":1};\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":1420,"wires":[["934095df.d92c58"]]},{"id":"2fa6f939.231a8e","type":"inject","z":"b95543c8.1478f8","name":"","topic":"","payload":"SEND","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":1420.0001220703125,"wires":[["25b3f758.654538"]]},{"id":"f7cda1f4.a7a3c","type":"json","z":"b95543c8.1478f8","name":"","property":"payload","action":"","pretty":false,"x":700,"y":1310,"wires":[["7702a364.a2a29c"]]},{"id":"321433cf.9ee7cc","type":"function","z":"b95543c8.1478f8","name":"TV Volume UP","func":"msg.payload = {\"Protocol\":\"SAMSUNG\",\"Bits\":32,\"Data\":\"0xE0E0E01F\", \"Repeat\":1};\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":1480,"wires":[["934095df.d92c58"]]},{"id":"9a4daee5.b5a278","type":"inject","z":"b95543c8.1478f8","name":"","topic":"","payload":"SEND","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":1480.0001220703125,"wires":[["321433cf.9ee7cc"]]},{"id":"9ffc62ed.cb77d","type":"json","z":"b95543c8.1478f8","name":"","property":"payload","action":"","pretty":false,"x":520,"y":1200,"wires":[["5286737b.d7e184","e5787bd0.59ac"]]},{"id":"5286737b.d7e184","type":"debug","z":"b95543c8.1478f8","name":"1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":690,"y":1160,"wires":[]},{"id":"e2110fb4.905c28","type":"debug","z":"b95543c8.1478f8","name":"2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":870,"y":1160,"wires":[]},{"id":"e5787bd0.59ac","type":"split","z":"b95543c8.1478f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":700,"y":1200,"wires":[["720ad775.e7c638","e2110fb4.905c28"]]},{"id":"5da16990.0481b","type":"debug","z":"b95543c8.1478f8","name":"This is the packet","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1110,"y":1200,"wires":[]},{"id":"28925c4f.5ca8bc","type":"inject","z":"b95543c8.1478f8","name":"Capture","topic":"GATE","payload":"open","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":1290,"wires":[["8be3cb06.ea8248"]]},{"id":"8be3cb06.ea8248","type":"function","z":"b95543c8.1478f8","name":"One only.","func":"if (msg.topic == \"GATE\")\n{\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"ONE\"});\n return;\n}\nif (context.get(\"ALLOW\") == 1)\n{\n //\n context.set(\"ALLOW\",0);\n node.status({fill: \"red\",text:\"BLOCK\"});\n return msg;\n}","outputs":1,"noerr":0,"x":380,"y":1200,"wires":[["9ffc62ed.cb77d"]]},{"id":"720ad775.e7c638","type":"change","z":"b95543c8.1478f8","name":"","rules":[{"t":"delete","p":"payload.DataLSB","pt":"msg"},{"t":"set","p":"payload.Repeat","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1200,"wires":[["5da16990.0481b","d3fc936e.09cfd"]]},{"id":"d3fc936e.09cfd","type":"function","z":"b95543c8.1478f8","name":"","func":"if (msg.payload != \"SEND\")\n{\n context.set(\"Keep\",msg.payload);\n node.status({fill: \"green\",text:\"Holding\"});\n return;\n}\nmsg.payload = context.get(\"Keep\");\nreturn msg;\n","outputs":1,"noerr":0,"x":1070,"y":1240,"wires":[["f7cda1f4.a7a3c"]]},{"id":"dd909bd.daef368","type":"inject","z":"b95543c8.1478f8","name":"Test","topic":"","payload":"SEND","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":520,"y":1240,"wires":[["d3fc936e.09cfd"]]},{"id":"be05e17b.591238","type":"comment","z":"b95543c8.1478f8","name":"IR capture flow","info":"","x":660,"y":1100,"wires":[]},{"id":"934095df.d92c58","type":"fan","z":"b95543c8.1478f8","x":510,"y":1420,"wires":[["dee385b9.d925c8"]]},{"id":"dee385b9.d925c8","type":"change","z":"b95543c8.1478f8","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"IR_REMOTE_CONTROL/cmnd/IRSend","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":1380,"wires":[["f7cda1f4.a7a3c"]]},{"id":"7702a364.a2a29c","type":"change","z":"b95543c8.1478f8","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"IR_REMOTE_CONTROL/cmnd/IRSend","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":1310,"wires":[["92a365c6.af355","a0855ef3.c05038"]]},{"id":"2f3ac5b1.e1c602","type":"inject","z":"b95543c8.1478f8","name":"","topic":"","payload":"SEND","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":1530,"wires":[["b7a051d2.d8139"]]},{"id":"b7a051d2.d8139","type":"function","z":"b95543c8.1478f8","name":"TV Volume MUTE","func":"msg.payload = {\"Protocol\":\"SAMSUNG\",\"Bits\":32,\"Data\":\"0xE0E0F00F\",\"Repeat\":1};\nreturn msg;\n","outputs":1,"noerr":0,"x":330,"y":1529.9998779296875,"wires":[["934095df.d92c58"]]},{"id":"a4c63d.a0a731c","type":"comment","z":"b95543c8.1478f8","name":"Test area","info":"","x":300,"y":1380,"wires":[]},{"id":"c47b2d3f.a530c8","type":"inject","z":"b95543c8.1478f8","name":"Sunrise","topic":"","payload":"sunrise","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":2090,"wires":[["6f49ff46.40275","5bbf8fa9.155c38"]]},{"id":"f542a998.2d0928","type":"inject","z":"b95543c8.1478f8","name":"Sunset","topic":"","payload":"sunset","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":2170,"wires":[["6f49ff46.40275","5bbf8fa9.155c38"]]},{"id":"6f49ff46.40275","type":"trigger","z":"b95543c8.1478f8","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"sunset","bytopic":"all","name":"ON time","x":400,"y":2090,"wires":[["dcb31570.db6cc8","be5e67f3.da732"]]},{"id":"be5e67f3.da732","type":"switch","z":"b95543c8.1478f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":2140,"wires":[["449a4598.8d063c"]]},{"id":"dcb31570.db6cc8","type":"debug","z":"b95543c8.1478f8","name":"Day mode","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":660,"y":2050,"wires":[]},{"id":"449a4598.8d063c","type":"delay","z":"b95543c8.1478f8","name":"OFF time","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":2140,"wires":[["6f49ff46.40275"]]},{"id":"5bbf8fa9.155c38","type":"trigger","z":"b95543c8.1478f8","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"sunrise","bytopic":"all","name":"ON time","x":400,"y":2250,"wires":[["b7a46866.00479","4365f87.891ea88"]]},{"id":"b7a46866.00479","type":"switch","z":"b95543c8.1478f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":2300,"wires":[["5cebc78.4686c38"]]},{"id":"5cebc78.4686c38","type":"delay","z":"b95543c8.1478f8","name":"OFF time","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":2300,"wires":[["5bbf8fa9.155c38"]]},{"id":"4bb8edd7.37af6c","type":"comment","z":"b95543c8.1478f8","name":"BIG TIMER ouptut","info":"","x":160,"y":2050,"wires":[]},{"id":"4365f87.891ea88","type":"debug","z":"b95543c8.1478f8","name":"Night mode","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":660,"y":2210,"wires":[]},{"id":"8a2e80be.f7c928","type":"mqtt-broker","z":"","name":"MQTT host","broker":"192.168.0.99","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"2","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]