Join the json code from multiple flows into one file

You produce a lot of text but you don't answer to anyone other than yourself. How are we supposed to help ?

and btw you can drop the python stuff to write some json, node-red can do that perfectly.

That's the whole point of a subflow. It's like a single function that 100% esures your operations are the same for all that call it.

In effect what you have done (code wise) is copy and paste. This is not a good approach for so many reasons I'm sure I don't need to explain.

Subflows are the smart choice and better choice. If ever you need to improve or update your code, you only have to make one change in the subflow and all of your channels instantly use the new code. No export/python/import required.

You should give it a try - if only for learning. I'm certain if you succeed you will understand why its the smarter approach.

Regards.

Here's something to poke at. It's probably for a different end-use than you are going for, but it's worth dissecting to try and get an understanding of subflows and topic routing. In your case, you'd likely want instances of the same subflow template on the right side of the switch (to act as your independent variable stores) rather than a single subflow on the left (which is acting as a pre-packaged function for reuse in other flows in my case.)

[{"id":"ab7d2028.57c2e","type":"subflow","name":"Stove Motion","info":"","category":"","in":[{"x":270,"y":1310,"wires":[{"id":"d932eec1.66e69"}]}],"out":[{"x":1230,"y":1300,"wires":[{"id":"c761c1c9.011de","port":0}]}]},{"id":"2384a6d2.7067aa","type":"mytimeout","z":"ab7d2028.57c2e","name":"My Timeout","outtopic":"","outsafe":"on","outwarning":"Warning","outunsafe":"off","warning":"5","timer":"10","debug":"0","repeat":false,"again":false,"x":660,"y":1330,"wires":[["362c1a99.5d6efe"],[]]},{"id":"c761c1c9.011de","type":"rbe","z":"ab7d2028.57c2e","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1100,"y":1300,"wires":[[]]},{"id":"362c1a99.5d6efe","type":"switch","z":"ab7d2028.57c2e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":800,"y":1270,"wires":[["9ac51574.9d0018"],[]]},{"id":"9ac51574.9d0018","type":"change","z":"ab7d2028.57c2e","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1270,"wires":[["c761c1c9.011de"]]},{"id":"afcc12b7.68fc9","type":"change","z":"ab7d2028.57c2e","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":1270,"wires":[["2384a6d2.7067aa"]]},{"id":"d932eec1.66e69","type":"switch","z":"ab7d2028.57c2e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":400,"y":1310,"wires":[["afcc12b7.68fc9","c761c1c9.011de"],["2384a6d2.7067aa"]]},{"id":"1c8770e0.ce23f7","type":"subflow","name":"Hue Dimmer","info":"","category":"","in":[{"x":60,"y":150,"wires":[{"id":"d52d0ab6.b8dbf"}]}],"out":[{"x":836,"y":163,"wires":[{"id":"9a92defc.894ec","port":0},{"id":"9abb383a.a7d428","port":0},{"id":"4e01980f.bc1e3","port":0},{"id":"3a6d2016.6c2af8","port":0},{"id":"2694f17d.d2c8ae","port":0}]}]},{"id":"d52d0ab6.b8dbf","type":"switch","z":"1c8770e0.ce23f7","name":"","property":"payload.state.buttonevent","propertyType":"msg","rules":[{"t":"eq","v":"1000","vt":"str"},{"t":"eq","v":"1001","vt":"str"},{"t":"eq","v":"1002","vt":"str"},{"t":"eq","v":"1003","vt":"str"},{"t":"eq","v":"2000","vt":"str"},{"t":"eq","v":"2001","vt":"str"},{"t":"eq","v":"2002","vt":"str"},{"t":"eq","v":"2003","vt":"str"},{"t":"eq","v":"3000","vt":"str"},{"t":"eq","v":"3001","vt":"str"},{"t":"eq","v":"3002","vt":"str"},{"t":"eq","v":"3003","vt":"str"},{"t":"eq","v":"4000","vt":"str"},{"t":"eq","v":"4001","vt":"str"},{"t":"eq","v":"4002","vt":"str"},{"t":"eq","v":"4003","vt":"str"}],"checkall":"true","repair":false,"outputs":16,"x":190,"y":150,"wires":[[],[],["9a92defc.894ec"],["9a92defc.894ec"],[],["2694f17d.d2c8ae"],["3a6d2016.6c2af8"],[],[],[],["4e01980f.bc1e3"],[],[],[],["9abb383a.a7d428"],["9abb383a.a7d428"]],"outputLabels":["ON (buttonDown)","ON (hold)","ON (buttonUp)","ON (releaseHold)","Brighter (buttonDown)","Brighter (hold)","Brighter (buttonUp)","Brighter (releaseHold)","Dimmer (buttonDown)","Dimmer (hold)","Dimmer (buttonUp)","Dimmer (releaseHold)","OFF (buttonDown)","OFF (hold)","OFF (buttonUp)","OFF (releaseHold)"]},{"id":"9a92defc.894ec","type":"change","z":"1c8770e0.ce23f7","name":"Turn On","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":653,"y":86,"wires":[[]]},{"id":"9abb383a.a7d428","type":"change","z":"1c8770e0.ce23f7","name":"Turn Off","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":654,"y":237,"wires":[[]]},{"id":"3a6d2016.6c2af8","type":"change","z":"1c8770e0.ce23f7","name":"","rules":[{"t":"set","p":"payload.incrementBrightness","pt":"msg","to":"10","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":569,"y":156,"wires":[[]]},{"id":"4e01980f.bc1e3","type":"change","z":"1c8770e0.ce23f7","name":"","rules":[{"t":"set","p":"payload.incrementBrightness","pt":"msg","to":"-10","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":569,"y":191,"wires":[[]]},{"id":"2694f17d.d2c8ae","type":"change","z":"1c8770e0.ce23f7","name":"","rules":[{"t":"set","p":"payload.incrementBrightness","pt":"msg","to":"100","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":569,"y":122,"wires":[[]]},{"id":"ca16c61b.51911","type":"subflow","name":"Alexa to Hue","info":"","category":"","in":[{"x":52,"y":183,"wires":[{"id":"3defb081.7d40d8"}]}],"out":[{"x":1050,"y":160,"wires":[{"id":"db8c71fe.f375e","port":0}]}]},{"id":"db8c71fe.f375e","type":"change","z":"ca16c61b.51911","name":"","rules":[{"t":"set","p":"payload.transitionTime","pt":"msg","to":"3","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":160,"wires":[[]]},{"id":"3defb081.7d40d8","type":"switch","z":"ca16c61b.51911","name":"","property":"command","propertyType":"msg","rules":[{"t":"eq","v":"TurnOnRequest","vt":"str"},{"t":"eq","v":"TurnOffRequest","vt":"str"},{"t":"eq","v":"SetPercentageRequest","vt":"str"},{"t":"eq","v":"SetColorTemperatureRequest","vt":"str"},{"t":"eq","v":"SetColorRequest","vt":"str"},{"t":"eq","v":"IncrementPercentageRequest","vt":"str"},{"t":"eq","v":"DecrementPercentageRequest","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":8,"x":182,"y":183,"wires":[["62df4d98.fdc544"],["e79185e6.11c19"],["b37d7dd5.0c323"],["7906717d.9b922"],["17c64673.1c9f6a"],["f692bf73.af2988"],["f692bf73.af2988"],[]]},{"id":"62df4d98.fdc544","type":"change","z":"ca16c61b.51911","name":"Turn On","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":335.5,"y":58,"wires":[["db8c71fe.f375e"]]},{"id":"e79185e6.11c19","type":"change","z":"ca16c61b.51911","name":"Turn Off","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":335.5,"y":92,"wires":[["db8c71fe.f375e"]]},{"id":"b37d7dd5.0c323","type":"change","z":"ca16c61b.51911","name":"msg.payload.brightness","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.brightness","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":399.5,"y":127,"wires":[["db8c71fe.f375e"]]},{"id":"7906717d.9b922","type":"range","z":"ca16c61b.51911","minin":"7000","maxin":"2200","minout":"153","maxout":"500","action":"scale","round":true,"property":"payload","name":"Correct Temp","x":371.5,"y":164,"wires":[["dd19b364.e071c"]]},{"id":"dd19b364.e071c","type":"change","z":"ca16c61b.51911","name":"Color Temp","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.colorTemp","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":542,"y":164.25,"wires":[["db8c71fe.f375e"]]},{"id":"a57571bd.358e6","type":"color-convert","z":"ca16c61b.51911","input":"hsv","output":"rgb","outputType":"array","x":761.5,"y":201,"wires":[["999a1982.f923e8"]]},{"id":"999a1982.f923e8","type":"change","z":"ca16c61b.51911","name":"rgb","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.rgb","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":923,"y":200.25,"wires":[["db8c71fe.f375e"]]},{"id":"17c64673.1c9f6a","type":"range","z":"ca16c61b.51911","minin":"0","maxin":"1","minout":"0","maxout":"100","action":"scale","round":true,"property":"payload.saturation","name":"Correct Saturation","x":384,"y":200.25,"wires":[["cad3fe07.61b698"]]},{"id":"cad3fe07.61b698","type":"range","z":"ca16c61b.51911","minin":"0","maxin":"1","minout":"0","maxout":"100","action":"scale","round":true,"property":"payload.brightness","name":"Correct Brightness","x":584,"y":200.25,"wires":[["a57571bd.358e6"]]},{"id":"f692bf73.af2988","type":"change","z":"ca16c61b.51911","name":"msg.payload.brightness","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.incrementBrightness","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":399.5,"y":242,"wires":[["db8c71fe.f375e"]]},{"id":"805ede45.c796f8","type":"hue-group","z":"87c1a6fe.7b233","name":"Master Bathroom","bridge":"ff78aa88.557ea8","groupid":"7","colornamer":true,"x":695,"y":100,"wires":[[]],"l":false},{"id":"c65c43fa.4cc9c","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28701","acknoledge":true,"name":"MBR","topic":"MBR","x":155,"y":120,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"b8811b3a.62e52","type":"subflow:ca16c61b.51911","z":"87c1a6fe.7b233","name":"","env":[],"x":315,"y":380,"wires":[["220fadbe.7d3e7a"]],"icon":"node-red-contrib-alexa-home/alexa-home.png","l":false},{"id":"776b319a.96d1a","type":"hue-group","z":"87c1a6fe.7b233","name":"Kitchen","bridge":"ff78aa88.557ea8","groupid":"3","colornamer":true,"x":695,"y":220,"wires":[[]],"l":false},{"id":"ee1e6d8d.311bb8","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28699","acknoledge":true,"name":"KT","topic":"KT","x":155,"y":180,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"7e48d314.c765cc","type":"subflow:1c8770e0.ce23f7","z":"87c1a6fe.7b233","name":"","env":[],"x":315,"y":340,"wires":[["220fadbe.7d3e7a"]],"icon":"node-red-contrib-huemagic/hue-switch.png","l":false},{"id":"1cdd6337.d4e32d","type":"link in","z":"87c1a6fe.7b233","name":"Hue Dimmers","links":["b2c211f6.051208"],"x":155,"y":80,"wires":[["7e48d314.c765cc"]]},{"id":"f211f766.f09d6","type":"hue-light","z":"87c1a6fe.7b233","name":"Stove","bridge":"ff78aa88.557ea8","lightid":"10","colornamer":true,"x":695,"y":740,"wires":[[]],"l":false},{"id":"96bd768b.3bdd2","type":"link in","z":"87c1a6fe.7b233","name":"","links":["51f2b95a.f8f17"],"x":575,"y":740,"wires":[["f94f4c01.ec2a7"]]},{"id":"f94f4c01.ec2a7","type":"subflow:ab7d2028.57c2e","z":"87c1a6fe.7b233","name":"","env":[],"x":635,"y":740,"wires":[["f211f766.f09d6"]],"icon":"node-red-contrib-huemagic/hue-bridge.png","l":false},{"id":"27be5fa8.5a189","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28702","acknoledge":true,"name":"GBR","topic":"GBR","x":155,"y":240,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"4c7fe089.cdcd7","type":"hue-group","z":"87c1a6fe.7b233","name":"Guest Bathroom","bridge":"ff78aa88.557ea8","groupid":"5","colornamer":true,"x":695,"y":160,"wires":[[]],"l":false},{"id":"151e164a.f513ea","type":"hue-group","z":"87c1a6fe.7b233","name":"Master Bedroom","bridge":"ff78aa88.557ea8","groupid":"6","colornamer":true,"x":695,"y":640,"wires":[[]],"l":false},{"id":"19d23258.67d476","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28707","acknoledge":true,"name":"MB","topic":"MB","x":155,"y":300,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"7fdeb5d0.493ccc","type":"hue-group","z":"87c1a6fe.7b233","name":"theater","bridge":"ff78aa88.557ea8","groupid":"1","colornamer":true,"x":695,"y":280,"wires":[[]],"l":false},{"id":"c5f91e53.d300b","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28703","acknoledge":true,"name":"TT","topic":"TT","x":155,"y":360,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"557ccf03.a8b35","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28700","acknoledge":true,"name":"LR","topic":"LR","x":155,"y":420,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"be2dbddc.719958","type":"hue-group","z":"87c1a6fe.7b233","name":"Living room","bridge":"ff78aa88.557ea8","groupid":"4","colornamer":true,"x":695,"y":340,"wires":[[]],"l":false},{"id":"f2ea42df.95368","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28705","acknoledge":true,"name":"SR","topic":"SR","x":155,"y":480,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"6d46dde0.6ac94c","type":"hue-group","z":"87c1a6fe.7b233","name":"Sewing Room","bridge":"ff78aa88.557ea8","groupid":"2","colornamer":true,"x":695,"y":400,"wires":[[]],"l":false},{"id":"70f9c21a.9870b4","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28708","acknoledge":true,"name":"PT","topic":"PT","x":155,"y":540,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"bf1316c5.773da8","type":"hue-light","z":"87c1a6fe.7b233","name":"Porch","bridge":"ff78aa88.557ea8","lightid":"37","colornamer":true,"x":695,"y":460,"wires":[[]],"l":false},{"id":"ca8f758a.3217c","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28709","acknoledge":true,"name":"HT","topic":"HT","x":155,"y":600,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"7819e91.8b70918","type":"hue-light","z":"87c1a6fe.7b233","name":"Hallway","bridge":"ff78aa88.557ea8","lightid":"43","colornamer":true,"x":695,"y":520,"wires":[[]],"l":false},{"id":"29cf16bb.d4cb42","type":"alexa-home","z":"87c1a6fe.7b233","conf":"58a8d3f.d2ade2c","device":"28710","acknoledge":true,"name":"SW","topic":"SW","x":155,"y":660,"wires":[["b8811b3a.62e52"]],"l":false},{"id":"60ad7e88.62bf6","type":"hue-light","z":"87c1a6fe.7b233","name":"Stairs","bridge":"ff78aa88.557ea8","lightid":"41","colornamer":true,"x":695,"y":580,"wires":[[]],"l":false},{"id":"ae887fbf.48415","type":"alexa-local","z":"87c1a6fe.7b233","devicename":"Master Bedroom","inputtrigger":false,"x":155,"y":720,"wires":[["e836e7fa.a798f8"]],"l":false},{"id":"f2bea2b5.68a94","type":"change","z":"87c1a6fe.7b233","name":"msg.payload.brightness","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"},{"t":"move","p":"bri","pt":"msg","to":"payload.brightness","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"MB","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":275,"y":700,"wires":[["220fadbe.7d3e7a"]],"l":false},{"id":"e836e7fa.a798f8","type":"switch","z":"87c1a6fe.7b233","name":"","property":"on","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":215,"y":720,"wires":[["f2bea2b5.68a94"],["a941a544.dbf048"]],"l":false},{"id":"a941a544.dbf048","type":"change","z":"87c1a6fe.7b233","name":"msg.payload.brightness","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"MB","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":275,"y":740,"wires":[["220fadbe.7d3e7a"]],"l":false},{"id":"5170ec3e.e79404","type":"inject","z":"87c1a6fe.7b233","name":"","topic":"MB","payload":"true","payloadType":"bool","repeat":"","crontab":"00 07 * * 1,2,3,4,5","once":false,"onceDelay":0.1,"x":275,"y":780,"wires":[["220fadbe.7d3e7a"]],"icon":"font-awesome/fa-thumbs-up","l":false},{"id":"64ff2705.1d6ee8","type":"inject","z":"87c1a6fe.7b233","name":"","topic":"MB","payload":"false","payloadType":"bool","repeat":"","crontab":"00 09 * * 1,2,3,4,5","once":false,"onceDelay":0.1,"x":275,"y":820,"wires":[["220fadbe.7d3e7a"]],"icon":"font-awesome/fa-thumbs-o-down","l":false},{"id":"220fadbe.7d3e7a","type":"switch","z":"87c1a6fe.7b233","name":"Route by Topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"MBR","vt":"str"},{"t":"eq","v":"KT","vt":"str"},{"t":"eq","v":"GBR","vt":"str"},{"t":"eq","v":"TT","vt":"str"},{"t":"eq","v":"LR","vt":"str"},{"t":"eq","v":"SR","vt":"str"},{"t":"eq","v":"PT","vt":"str"},{"t":"eq","v":"HT","vt":"str"},{"t":"eq","v":"SW","vt":"str"},{"t":"eq","v":"MB","vt":"str"}],"checkall":"true","repair":false,"outputs":10,"x":480,"y":360,"wires":[["805ede45.c796f8"],["776b319a.96d1a"],["4c7fe089.cdcd7"],["7fdeb5d0.493ccc"],["be2dbddc.719958"],["6d46dde0.6ac94c"],["bf1316c5.773da8"],["7819e91.8b70918"],["60ad7e88.62bf6"],["151e164a.f513ea"]]},{"id":"ff78aa88.557ea8","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.1.154","key":"pJMJFcGvJmCpAcyOad8kYn4tHMNnWapoikUKhZAt","interval":"3000"},{"id":"58a8d3f.d2ade2c","type":"alexa-home-conf","z":"","username":"926birchwood"}]

Thankyou @JayDickson. That's a pretty sweet setup and compact code! I'm going to try to write a test piece of code as an analogy to my actual project and see where it leads me.

Just remember, if you use the subflows after the sort by topic, you can edit the subflow template and each instance will be updated accordingly, but you also get to keep the benefit of each subflow having its own flow variables (that are self contained and isolated from the tab flow variables.)

I think you guys are getting through to me now, and I'm starting to see how this could work. Most importantly, like @JayDickson said, the subflows can keep their own independent set of flow variables. That's a big deal and I did not realize that was the case. I had also never used the change node before and that is very helpful here to set the json object properties. Below is a small flow I made that is just a 3 channel timer of sorts. It's not amazing, and the "off" is more like a "pause" and I could use a "reset" button, but it gets the point across I think.

Let me know if you see anything of truly bad form. Also, what is your advice for dealing with changes to the UI that I make to one channel and then need to propagate through to the other channels? For example, maybe I want to add another button and add another feature to the change node? For now I just copied the nodes and find/replace Ch1 with ChX and paste back in but then the layout order gets all screwed up.

[{"id":"279a4d1d.9c4062","type":"subflow","name":"Channel Manager","info":"","category":"","in":[{"x":342.0000915527344,"y":135.00004386901855,"wires":[{"id":"ef86ebcd.6b44d8"},{"id":"2b6c8bca.686384"}]}],"out":[{"x":947.0000286102295,"y":146.0000057220459,"wires":[{"id":"2a95ac27.4540e4","port":0},{"id":"ef86ebcd.6b44d8","port":0},{"id":"2b6c8bca.686384","port":0}]}],"env":[]},{"id":"a343ec88.3b4f","type":"trigger","z":"279a4d1d.9c4062","op1":"1","op2":"0","op1type":"num","op2type":"str","duration":"-1","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":750.0000915527344,"y":310.0000877380371,"wires":[["2a95ac27.4540e4"]]},{"id":"2a95ac27.4540e4","type":"function","z":"279a4d1d.9c4062","name":"func timer","func":"runTime = flow.get(\"runTime\")\nsysStatus = flow.get(\"sysStatus\")\n//count = flow.get(\"count\")\n\nvar count=context.get('count') || 0; //function context variables are cleared in subflows so this does not work, have to use flow????\n\nif (typeof count === 'undefined')\n{\n    count = 0\n}\n\n\n\ninterval = msg.payload\ncount = count + interval\n//flow.set(\"count\", count)\n\ncontext.set(\"count\", count)\n\nif (sysStatus == \"on\" && (count < runTime))\n{\n    var msg1 = {payload: count}\n    return [msg1, null]\n}\n\nif (sysStatus == \"off\")\n{\n    var msg1 = {payload: \"off\"}\n    return[msg1, null]\n}\n\nif (sysStatus == \"on\" && (count > runTime))\n{\n    var msg1 = {payload: \"done\"}\n    var msg2 = {reset: \"reset\"}\n    context.set(\"count\", 0)\n    //flow.set(\"count\", 0)\n    flow.set(\"sysStatus\", \"off\")\n    return [msg1, msg2]\n}\n\nif (typeof sysStatus === \"undefined\" || typeof runTime === \"undefined\")\n{\n    var msg1 = {payload: \"please specify\"}\n    return [msg1, null]\n}\n","outputs":2,"noerr":0,"x":760.0000190734863,"y":229.0000057220459,"wires":[[],["a343ec88.3b4f"]]},{"id":"ef86ebcd.6b44d8","type":"function","z":"279a4d1d.9c4062","name":"set flow vars","func":"if (msg.sysStatus)\n{\n    flow.set(\"sysStatus\", msg.sysStatus)\n}\n\nif (msg.runTime)\n{\n    flow.set(\"runTime\", msg.runTime)\n}\n\nmsg.payload = msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":539.0000114440918,"y":157.00002670288086,"wires":[["a343ec88.3b4f","efa1d5f.68c1428"]]},{"id":"efa1d5f.68c1428","type":"debug","z":"279a4d1d.9c4062","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":675.1666793823242,"y":388.3333435058594,"wires":[]},{"id":"2b6c8bca.686384","type":"function","z":"279a4d1d.9c4062","name":"off text","func":"if (msg.sysStatus == \"off\")\n{\n    msg.payload = \"off\"\n}\nreturn msg\n","outputs":1,"noerr":0,"x":520.0000534057617,"y":115.00000381469727,"wires":[[]]},{"id":"ac4d5daf.f2432","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"f2d88fca.890a7","type":"ui_text","z":"ac4d5daf.f2432","group":"d211a925.a79948","order":8,"width":0,"height":0,"name":"Ch2 Time","label":"Ch2 Time (s)","format":"{{msg.payload}}","layout":"row-spread","x":1391.1668663024902,"y":383.3333568572998,"wires":[]},{"id":"ff7ff3fc.e2142","type":"switch","z":"ac4d5daf.f2432","name":"Route by topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Ch1","vt":"str"},{"t":"eq","v":"Ch2","vt":"str"},{"t":"eq","v":"Ch3","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":858.166690826416,"y":383.6666774749756,"wires":[["97fc15c5.60a958","84f58162.e835e"],["e37c313e.97d3"],["db28b672.391b68"]]},{"id":"58783827.5b9ee8","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":1,"width":0,"height":0,"passthru":false,"label":"OnCh1","tooltip":"","color":"","bgcolor":"","icon":"","payload":"on","payloadType":"str","topic":"Ch1","x":230.0001106262207,"y":128.00001907348633,"wires":[["bb5daff9.c7462"]]},{"id":"6034d4ac.56cc7c","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":2,"width":0,"height":0,"passthru":false,"label":"OffCh1","tooltip":"","color":"","bgcolor":"","icon":"","payload":"off","payloadType":"str","topic":"Ch1","x":231.00010681152344,"y":170.00010108947754,"wires":[["e6609075.20536"]]},{"id":"d92a8dc2.f3d05","type":"ui_text_input","z":"ac4d5daf.f2432","name":"","label":"how long (s) Ch1","tooltip":"","group":"d211a925.a79948","order":3,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"Ch1","x":187.00011444091797,"y":224.00002193450928,"wires":[["67be081f.719778"]]},{"id":"d38f3964.ba61a8","type":"switch","z":"ac4d5daf.f2432","name":"merge wires","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Ch1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":605.0000381469727,"y":172.00002098083496,"wires":[["ff7ff3fc.e2142"]]},{"id":"bb5daff9.c7462","type":"change","z":"ac4d5daf.f2432","name":"on","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":415.1668643951416,"y":133.66668701171875,"wires":[["d38f3964.ba61a8"]]},{"id":"67be081f.719778","type":"change","z":"ac4d5daf.f2432","name":"","rules":[{"t":"set","p":"runTime","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":406.1667022705078,"y":224.66668891906738,"wires":[["d38f3964.ba61a8"]]},{"id":"e6609075.20536","type":"change","z":"ac4d5daf.f2432","name":"off","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"reset","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":414.0000228881836,"y":172.00000953674316,"wires":[["d38f3964.ba61a8"]]},{"id":"e26bd6c7.87b118","type":"ui_text","z":"ac4d5daf.f2432","group":"d211a925.a79948","order":4,"width":0,"height":0,"name":"Ch1 Time","label":"Ch1 Time (s)","format":"{{msg.payload}}","layout":"row-spread","x":1387.166742324829,"y":341.3333110809326,"wires":[]},{"id":"ad25818e.17e1","type":"ui_text","z":"ac4d5daf.f2432","group":"d211a925.a79948","order":12,"width":0,"height":0,"name":"Ch3 Time","label":"Ch3 Time (s)","format":"{{msg.payload}}","layout":"row-spread","x":1396.1901817321777,"y":428.3723735809326,"wires":[]},{"id":"97fc15c5.60a958","type":"subflow:279a4d1d.9c4062","z":"ac4d5daf.f2432","name":"","env":[],"x":1134.166805267334,"y":345.0000743865967,"wires":[["e26bd6c7.87b118"]]},{"id":"e37c313e.97d3","type":"subflow:279a4d1d.9c4062","z":"ac4d5daf.f2432","name":"","env":[],"x":1134.0234375,"y":383.0390625,"wires":[["f2d88fca.890a7"]]},{"id":"db28b672.391b68","type":"subflow:279a4d1d.9c4062","z":"ac4d5daf.f2432","name":"","env":[],"x":1134.0234375,"y":423.0390625,"wires":[["ad25818e.17e1"]]},{"id":"84f58162.e835e","type":"debug","z":"ac4d5daf.f2432","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1078.166748046875,"y":245.33334350585938,"wires":[]},{"id":"2d6f81c0.1863ce","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":5,"width":0,"height":0,"passthru":false,"label":"OnCh2","tooltip":"","color":"","bgcolor":"","icon":"","payload":"on","payloadType":"str","topic":"Ch2","x":198.0000114440918,"y":328.0000228881836,"wires":[["ff3b1f14.69b7e"]]},{"id":"8ce8a17f.590f6","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":6,"width":0,"height":0,"passthru":false,"label":"OffCh2","tooltip":"","color":"","bgcolor":"","icon":"","payload":"off","payloadType":"str","topic":"Ch2","x":199.00000762939453,"y":370.0001049041748,"wires":[["f63fe37d.29c1a"]]},{"id":"57b779ed.085c18","type":"ui_text_input","z":"ac4d5daf.f2432","name":"","label":"how long (s) Ch2","tooltip":"","group":"d211a925.a79948","order":7,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"Ch2","x":155.00001525878906,"y":424.00002574920654,"wires":[["b794d8d4.7784b8"]]},{"id":"22b825f4.ac698a","type":"switch","z":"ac4d5daf.f2432","name":"merge wires","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Ch2","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":572.9999389648438,"y":372.0000247955322,"wires":[["ff7ff3fc.e2142"]]},{"id":"ff3b1f14.69b7e","type":"change","z":"ac4d5daf.f2432","name":"on","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":383.1667652130127,"y":333.666690826416,"wires":[["22b825f4.ac698a"]]},{"id":"b794d8d4.7784b8","type":"change","z":"ac4d5daf.f2432","name":"","rules":[{"t":"set","p":"runTime","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":374.1666030883789,"y":424.66669273376465,"wires":[["22b825f4.ac698a"]]},{"id":"f63fe37d.29c1a","type":"change","z":"ac4d5daf.f2432","name":"off","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"reset","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":381.9999237060547,"y":372.00001335144043,"wires":[["22b825f4.ac698a"]]},{"id":"f908838e.d0413","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":9,"width":0,"height":0,"passthru":false,"label":"OnCh3","tooltip":"","color":"","bgcolor":"","icon":"","payload":"on","payloadType":"str","topic":"Ch3","x":213.0000114440918,"y":524.0000228881836,"wires":[["f14acdb9.1577b"]]},{"id":"32b2fb2a.f3c804","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":10,"width":0,"height":0,"passthru":false,"label":"OffCh3","tooltip":"","color":"","bgcolor":"","icon":"","payload":"off","payloadType":"str","topic":"Ch3","x":214.00000762939453,"y":566.0001049041748,"wires":[["aec2b22.b466c5"]]},{"id":"c418461f.809e88","type":"ui_text_input","z":"ac4d5daf.f2432","name":"","label":"how long (s) Ch3","tooltip":"","group":"d211a925.a79948","order":11,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"Ch3","x":170.00001525878906,"y":620.0000257492065,"wires":[["6b7902e8.59051c"]]},{"id":"e9d1fc3f.0ca2d","type":"switch","z":"ac4d5daf.f2432","name":"merge wires","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Ch3","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":587.9999389648438,"y":568.0000247955322,"wires":[["ff7ff3fc.e2142"]]},{"id":"f14acdb9.1577b","type":"change","z":"ac4d5daf.f2432","name":"on","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":398.1667652130127,"y":529.666690826416,"wires":[["e9d1fc3f.0ca2d"]]},{"id":"6b7902e8.59051c","type":"change","z":"ac4d5daf.f2432","name":"","rules":[{"t":"set","p":"runTime","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":389.1666030883789,"y":620.6666927337646,"wires":[["e9d1fc3f.0ca2d"]]},{"id":"aec2b22.b466c5","type":"change","z":"ac4d5daf.f2432","name":"off","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"reset","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":396.9999237060547,"y":568.0000133514404,"wires":[["e9d1fc3f.0ca2d"]]},{"id":"d211a925.a79948","type":"ui_group","z":"","name":"all channels","tab":"edb965df.f9c828","order":1,"disp":true,"width":"6","collapse":false},{"id":"edb965df.f9c828","type":"ui_tab","z":"","name":"home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Thanks!

Please put ``` before and after your code to format it right when you post in the forum.

ok, sorry about that. I just used the "preformatted text" button in the previous reply. I wasn't sure if people preferred to keep space to a minimum or show the code all at once. Here is the same code, I just removed a comment though about context variables in subflow functions that was inaccurate:

[{"id":"279a4d1d.9c4062","type":"subflow","name":"Channel Manager","info":"","category":"","in":[{"x":342.0000915527344,"y":135.00004386901855,"wires":[{"id":"ef86ebcd.6b44d8"},{"id":"2b6c8bca.686384"}]}],"out":[{"x":947.0000286102295,"y":146.0000057220459,"wires":[{"id":"2a95ac27.4540e4","port":0},{"id":"ef86ebcd.6b44d8","port":0},{"id":"2b6c8bca.686384","port":0}]}],"env":[]},{"id":"a343ec88.3b4f","type":"trigger","z":"279a4d1d.9c4062","op1":"1","op2":"0","op1type":"num","op2type":"str","duration":"-1","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":750.0000915527344,"y":310.0000877380371,"wires":[["2a95ac27.4540e4"]]},{"id":"2a95ac27.4540e4","type":"function","z":"279a4d1d.9c4062","name":"func timer","func":"runTime = flow.get(\"runTime\")\nsysStatus = flow.get(\"sysStatus\")\n//count = flow.get(\"count\")\n\nvar count=context.get('count') || 0; \n\nif (typeof count === 'undefined')\n{\n count = 0\n}\n\n\n\ninterval = msg.payload\ncount = count + interval\n//flow.set(\"count\", count)\n\ncontext.set(\"count\", count)\n\nif (sysStatus == \"on\" && (count < runTime))\n{\n var msg1 = {payload: count}\n return [msg1, null]\n}\n\nif (sysStatus == \"off\")\n{\n var msg1 = {payload: \"off\"}\n return[msg1, null]\n}\n\nif (sysStatus == \"on\" && (count > runTime))\n{\n var msg1 = {payload: \"done\"}\n var msg2 = {reset: \"reset\"}\n context.set(\"count\", 0)\n //flow.set(\"count\", 0)\n flow.set(\"sysStatus\", \"off\")\n return [msg1, msg2]\n}\n\nif (typeof sysStatus === \"undefined\" || typeof runTime === \"undefined\")\n{\n var msg1 = {payload: \"please specify\"}\n return [msg1, null]\n}\n","outputs":2,"noerr":0,"x":760.0000190734863,"y":229.0000057220459,"wires":[[],["a343ec88.3b4f"]]},{"id":"ef86ebcd.6b44d8","type":"function","z":"279a4d1d.9c4062","name":"set flow vars","func":"if (msg.sysStatus)\n{\n flow.set(\"sysStatus\", msg.sysStatus)\n}\n\nif (msg.runTime)\n{\n flow.set(\"runTime\", msg.runTime)\n}\n\nmsg.payload = msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":539.0000114440918,"y":157.00002670288086,"wires":[["a343ec88.3b4f","efa1d5f.68c1428"]]},{"id":"efa1d5f.68c1428","type":"debug","z":"279a4d1d.9c4062","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":675.1666793823242,"y":388.3333435058594,"wires":[]},{"id":"2b6c8bca.686384","type":"function","z":"279a4d1d.9c4062","name":"off text","func":"if (msg.sysStatus == \"off\")\n{\n msg.payload = \"off\"\n}\nreturn msg\n","outputs":1,"noerr":0,"x":520.0000534057617,"y":115.00000381469727,"wires":[[]]},{"id":"ac4d5daf.f2432","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"f2d88fca.890a7","type":"ui_text","z":"ac4d5daf.f2432","group":"d211a925.a79948","order":8,"width":0,"height":0,"name":"Ch2 Time","label":"Ch2 Time (s)","format":"{{msg.payload}}","layout":"row-spread","x":1391.1668663024902,"y":383.3333568572998,"wires":[]},{"id":"ff7ff3fc.e2142","type":"switch","z":"ac4d5daf.f2432","name":"Route by topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Ch1","vt":"str"},{"t":"eq","v":"Ch2","vt":"str"},{"t":"eq","v":"Ch3","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":858.166690826416,"y":383.6666774749756,"wires":[["97fc15c5.60a958","84f58162.e835e"],["e37c313e.97d3"],["db28b672.391b68"]]},{"id":"58783827.5b9ee8","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":1,"width":0,"height":0,"passthru":false,"label":"OnCh1","tooltip":"","color":"","bgcolor":"","icon":"","payload":"on","payloadType":"str","topic":"Ch1","x":230.0001106262207,"y":128.00001907348633,"wires":[["bb5daff9.c7462"]]},{"id":"6034d4ac.56cc7c","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":2,"width":0,"height":0,"passthru":false,"label":"OffCh1","tooltip":"","color":"","bgcolor":"","icon":"","payload":"off","payloadType":"str","topic":"Ch1","x":231.00010681152344,"y":170.00010108947754,"wires":[["e6609075.20536"]]},{"id":"d92a8dc2.f3d05","type":"ui_text_input","z":"ac4d5daf.f2432","name":"","label":"how long (s) Ch1","tooltip":"","group":"d211a925.a79948","order":3,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"Ch1","x":187.00011444091797,"y":224.00002193450928,"wires":[["67be081f.719778"]]},{"id":"d38f3964.ba61a8","type":"switch","z":"ac4d5daf.f2432","name":"merge wires","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Ch1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":605.0000381469727,"y":172.00002098083496,"wires":[["ff7ff3fc.e2142"]]},{"id":"bb5daff9.c7462","type":"change","z":"ac4d5daf.f2432","name":"on","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":415.1668643951416,"y":133.66668701171875,"wires":[["d38f3964.ba61a8"]]},{"id":"67be081f.719778","type":"change","z":"ac4d5daf.f2432","name":"","rules":[{"t":"set","p":"runTime","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":406.1667022705078,"y":224.66668891906738,"wires":[["d38f3964.ba61a8"]]},{"id":"e6609075.20536","type":"change","z":"ac4d5daf.f2432","name":"off","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"reset","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":414.0000228881836,"y":172.00000953674316,"wires":[["d38f3964.ba61a8"]]},{"id":"e26bd6c7.87b118","type":"ui_text","z":"ac4d5daf.f2432","group":"d211a925.a79948","order":4,"width":0,"height":0,"name":"Ch1 Time","label":"Ch1 Time (s)","format":"{{msg.payload}}","layout":"row-spread","x":1387.166742324829,"y":341.3333110809326,"wires":[]},{"id":"ad25818e.17e1","type":"ui_text","z":"ac4d5daf.f2432","group":"d211a925.a79948","order":12,"width":0,"height":0,"name":"Ch3 Time","label":"Ch3 Time (s)","format":"{{msg.payload}}","layout":"row-spread","x":1396.1901817321777,"y":428.3723735809326,"wires":[]},{"id":"97fc15c5.60a958","type":"subflow:279a4d1d.9c4062","z":"ac4d5daf.f2432","name":"","env":[],"x":1134.166805267334,"y":345.0000743865967,"wires":[["e26bd6c7.87b118"]]},{"id":"e37c313e.97d3","type":"subflow:279a4d1d.9c4062","z":"ac4d5daf.f2432","name":"","env":[],"x":1134.0234375,"y":383.0390625,"wires":[["f2d88fca.890a7"]]},{"id":"db28b672.391b68","type":"subflow:279a4d1d.9c4062","z":"ac4d5daf.f2432","name":"","env":[],"x":1134.0234375,"y":423.0390625,"wires":[["ad25818e.17e1"]]},{"id":"84f58162.e835e","type":"debug","z":"ac4d5daf.f2432","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1078.166748046875,"y":245.33334350585938,"wires":[]},{"id":"2d6f81c0.1863ce","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":5,"width":0,"height":0,"passthru":false,"label":"OnCh2","tooltip":"","color":"","bgcolor":"","icon":"","payload":"on","payloadType":"str","topic":"Ch2","x":198.0000114440918,"y":328.0000228881836,"wires":[["ff3b1f14.69b7e"]]},{"id":"8ce8a17f.590f6","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":6,"width":0,"height":0,"passthru":false,"label":"OffCh2","tooltip":"","color":"","bgcolor":"","icon":"","payload":"off","payloadType":"str","topic":"Ch2","x":199.00000762939453,"y":370.0001049041748,"wires":[["f63fe37d.29c1a"]]},{"id":"57b779ed.085c18","type":"ui_text_input","z":"ac4d5daf.f2432","name":"","label":"how long (s) Ch2","tooltip":"","group":"d211a925.a79948","order":7,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"Ch2","x":155.00001525878906,"y":424.00002574920654,"wires":[["b794d8d4.7784b8"]]},{"id":"22b825f4.ac698a","type":"switch","z":"ac4d5daf.f2432","name":"merge wires","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Ch2","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":572.9999389648438,"y":372.0000247955322,"wires":[["ff7ff3fc.e2142"]]},{"id":"ff3b1f14.69b7e","type":"change","z":"ac4d5daf.f2432","name":"on","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":383.1667652130127,"y":333.666690826416,"wires":[["22b825f4.ac698a"]]},{"id":"b794d8d4.7784b8","type":"change","z":"ac4d5daf.f2432","name":"","rules":[{"t":"set","p":"runTime","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":374.1666030883789,"y":424.66669273376465,"wires":[["22b825f4.ac698a"]]},{"id":"f63fe37d.29c1a","type":"change","z":"ac4d5daf.f2432","name":"off","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"reset","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":381.9999237060547,"y":372.00001335144043,"wires":[["22b825f4.ac698a"]]},{"id":"f908838e.d0413","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":9,"width":0,"height":0,"passthru":false,"label":"OnCh3","tooltip":"","color":"","bgcolor":"","icon":"","payload":"on","payloadType":"str","topic":"Ch3","x":213.0000114440918,"y":524.0000228881836,"wires":[["f14acdb9.1577b"]]},{"id":"32b2fb2a.f3c804","type":"ui_button","z":"ac4d5daf.f2432","name":"","group":"d211a925.a79948","order":10,"width":0,"height":0,"passthru":false,"label":"OffCh3","tooltip":"","color":"","bgcolor":"","icon":"","payload":"off","payloadType":"str","topic":"Ch3","x":214.00000762939453,"y":566.0001049041748,"wires":[["aec2b22.b466c5"]]},{"id":"c418461f.809e88","type":"ui_text_input","z":"ac4d5daf.f2432","name":"","label":"how long (s) Ch3","tooltip":"","group":"d211a925.a79948","order":11,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"Ch3","x":170.00001525878906,"y":620.0000257492065,"wires":[["6b7902e8.59051c"]]},{"id":"e9d1fc3f.0ca2d","type":"switch","z":"ac4d5daf.f2432","name":"merge wires","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Ch3","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":587.9999389648438,"y":568.0000247955322,"wires":[["ff7ff3fc.e2142"]]},{"id":"f14acdb9.1577b","type":"change","z":"ac4d5daf.f2432","name":"on","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":398.1667652130127,"y":529.666690826416,"wires":[["e9d1fc3f.0ca2d"]]},{"id":"6b7902e8.59051c","type":"change","z":"ac4d5daf.f2432","name":"","rules":[{"t":"set","p":"runTime","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":389.1666030883789,"y":620.6666927337646,"wires":[["e9d1fc3f.0ca2d"]]},{"id":"aec2b22.b466c5","type":"change","z":"ac4d5daf.f2432","name":"off","rules":[{"t":"set","p":"sysStatus","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"reset","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":396.9999237060547,"y":568.0000133514404,"wires":[["e9d1fc3f.0ca2d"]]},{"id":"d211a925.a79948","type":"ui_group","z":"","name":"all channels","tab":"edb965df.f9c828","order":1,"disp":true,"width":"6","collapse":false},{"id":"edb965df.f9c828","type":"ui_tab","z":"","name":"home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]