IP to LED - Beagle Bone Black

This Flow makes the LED on the Beagle Bone Back blink at startup the IP address of the board

[{"id":"fb8658f2.c43588","type":"inject","z":"d6470035.fe231","name":"","topic":"ip","payload":"192.168.1.3","payloadType":"str","repeat":"","crontab":"","once":false,"x":1128.1663818359375,"y":2312.66650390625,"wires":[["bc05f9f.4196c08"]]},{"id":"bc05f9f.4196c08","type":"function","z":"d6470035.fe231","name":"4 CH Splitter \".\"","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n    msg4 = {};\n\nvar array = msg.payload.split('.'),\n    a = array[0], b = array[1], c = array[2], d = array[3];\n    \n    \n    msg1.payload = a;\n    \n    \n    msg2.payload = b;\n    \n   \n    msg3.payload = c;\n    \n    \n    msg4.payload = d;\n    \n    \n    return [msg1,msg2,msg3,msg4];\n","outputs":"4","noerr":0,"x":1312.1662292480469,"y":2235.6668395996094,"wires":[["9614e3fa.262b58","5c2a3af2.71f904"],["84703110.0e1bd8","54ec822b.ad21c4"],["c3f86a01.07b83","8082599.ad93b28"],["155e378.3ae0cc9","c4f5fce5.e9a27"]]},{"id":"9614e3fa.262b58","type":"debug","z":"d6470035.fe231","name":"","active":true,"console":"false","complete":"payload","x":1795.999755859375,"y":541.6668090820312,"wires":[]},{"id":"5c2a3af2.71f904","type":"function","z":"d6470035.fe231","name":"3 CH Splitter \"\"","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\n\nvar array = msg.payload.split(''),\n    a = array[0], b = array[1], c = array[2];\n    \n    \n    msg1.payload = a;\n    \n    \n    msg2.payload = b;\n    \n   \n    msg3.payload = c;\n\n    \n    return [msg1,msg2,msg3];\n","outputs":"3","noerr":0,"x":1806.499755859375,"y":586.6668090820312,"wires":[["c1a1a624.ffbf8","498fa66b.40a058","c9f458c.d1122a8"],["ec0e3ffb.cb2158","721001ec.89165"],["4097cfe0.2a831","5f91446d.4cc9a4"]]},{"id":"c1a1a624.ffbf8","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2101.7221069335938,"y":371.00018310546875,"wires":[]},{"id":"ec0e3ffb.cb2158","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2135.3330078125,"y":552.8335571289062,"wires":[]},{"id":"4097cfe0.2a831","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2127.499755859375,"y":828.33349609375,"wires":[]},{"id":"54ec822b.ad21c4","type":"debug","z":"d6470035.fe231","name":"","active":true,"console":"false","complete":"payload","x":1722.166259765625,"y":1618.6666259765625,"wires":[]},{"id":"84703110.0e1bd8","type":"function","z":"d6470035.fe231","name":"3 CH Splitter \"\"","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\n\nvar array = msg.payload.split(''),\n    a = array[0], b = array[1], c = array[2];\n    \n    \n    msg1.payload = a;\n    \n    \n    msg2.payload = b;\n    \n   \n    msg3.payload = c;\n\n    \n    return [msg1,msg2,msg3];\n","outputs":"3","noerr":0,"x":1732.666259765625,"y":1663.6666259765625,"wires":[["de606f4f.d4491","ac5bf0f5.8b008"],["6be4fae7.c3ec24","13306671.bcf6f2"],["355642fa.7b0b3e","deb313c7.e1de4"]]},{"id":"8082599.ad93b28","type":"debug","z":"d6470035.fe231","name":"","active":true,"console":"false","complete":"payload","x":1663.166015625,"y":2844.666748046875,"wires":[]},{"id":"c3f86a01.07b83","type":"function","z":"d6470035.fe231","name":"3 CH Splitter \"\"","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\n\nvar array = msg.payload.split(''),\n    a = array[0], b = array[1], c = array[2];\n    \n    \n    msg1.payload = a;\n    \n    \n    msg2.payload = b;\n    \n   \n    msg3.payload = c;\n\n    \n    return [msg1,msg2,msg3];\n","outputs":"3","noerr":0,"x":1673.666015625,"y":2889.666748046875,"wires":[["c4bc0a81.18ae48","c9b49a95.12dcb8"],["bc2a97bc.6f2ed","e73f6bee.68a718"],["2515949a.90a84c","644c4b06.b2308c"]]},{"id":"452bf998.2d8fb","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2330.8334350585938,"y":318.61109924316406,"wires":[["498fa66b.40a058"]]},{"id":"8b69bd17.f9b39","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n \n\n","outputs":"3","noerr":0,"x":3273.3331298828125,"y":320,"wires":[["5ccecf0c.8907e8","bc61933e.6e54e8"],["191d153b.2c0ee3","a979dff1.a44298"],["7d4bbf0b.4304c8","38ba2818.3ae2c"]]},{"id":"5ccecf0c.8907e8","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3281.8331298828125,"y":242,"wires":[["8b69bd17.f9b39"]]},{"id":"7d4bbf0b.4304c8","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3513.3331298828125,"y":392,"wires":[]},{"id":"998b37d2.ee9368","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4100.3331298828125,"y":318,"wires":[[]]},{"id":"9819ef34.77e6b","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3879.8331298828125,"y":319,"wires":[["998b37d2.ee9368","6b93940.ef2f8ec"]]},{"id":"6b93940.ef2f8ec","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3881.3331298828125,"y":267,"wires":[["9819ef34.77e6b"]]},{"id":"d26c1d93.a9041","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3485.3331298828125,"y":292,"wires":[["a979dff1.a44298"]]},{"id":"a979dff1.a44298","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3689.3331298828125,"y":318,"wires":[["9819ef34.77e6b"]]},{"id":"bc61933e.6e54e8","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3498.3331298828125,"y":246,"wires":[]},{"id":"191d153b.2c0ee3","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3495.3331298828125,"y":348,"wires":[]},{"id":"fa17ca86.8ba398","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3056.6663818359375,"y":320.00006103515625,"wires":[["3e1fffae.45cc58","8b69bd17.f9b39"]]},{"id":"3e1fffae.45cc58","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3290.833251953125,"y":404.9999694824219,"wires":[]},{"id":"68947a6b.bc9aec","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n\n\n","outputs":"3","noerr":0,"x":3279.9998168945312,"y":579.6666107177734,"wires":[["8703833c.55541","618dfb7a.cdc91c"],["7327ab04.8a74ec","e66a5f93.fc689"],["b45b6f6.ce79a9","31f299e9.5f293e"]]},{"id":"8703833c.55541","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3288.4998168945312,"y":501.66661071777344,"wires":[["68947a6b.bc9aec"]]},{"id":"b45b6f6.ce79a9","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3519.9998168945312,"y":651.6666107177734,"wires":[]},{"id":"11865314.87d3c5","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4106.999816894531,"y":577.6666107177734,"wires":[[]]},{"id":"aa0d29dc.5e4de","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3886.4998168945312,"y":578.6666107177734,"wires":[["11865314.87d3c5","1c77d6f4.a6b6d1"]]},{"id":"1c77d6f4.a6b6d1","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3887.9998168945312,"y":526.6666107177734,"wires":[["aa0d29dc.5e4de"]]},{"id":"84b703fe.985558","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3491.9998168945312,"y":551.6666107177734,"wires":[["e66a5f93.fc689"]]},{"id":"e66a5f93.fc689","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3695.9998168945312,"y":577.6666107177734,"wires":[["aa0d29dc.5e4de"]]},{"id":"618dfb7a.cdc91c","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3504.9998168945312,"y":505.66661071777344,"wires":[]},{"id":"7327ab04.8a74ec","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3501.9998168945312,"y":607.6666107177734,"wires":[]},{"id":"d03daad5.ff762","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3071.66650390625,"y":579.6666870117188,"wires":[["d86a10a5.55c7a8","68947a6b.bc9aec"]]},{"id":"d86a10a5.55c7a8","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3297.4999389648438,"y":664.6665802001953,"wires":[]},{"id":"99d7c288.dba9e8","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2890.8333740234375,"y":778.3333129882812,"wires":[["3d3a13e2.9f6d74"]]},{"id":"1878b166.3e923f","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n \n\n","outputs":"3","noerr":0,"x":3293.3331909179688,"y":835.0000305175781,"wires":[["a8101246.55cd1","4a7b763a.c84eb8"],["615b04ad.f6464c","3eb1a73c.b0d568"],["fe3eeea0.88ba9","bde9091.e9770f8"]]},{"id":"a8101246.55cd1","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3301.8331909179688,"y":757.0000305175781,"wires":[["1878b166.3e923f"]]},{"id":"fe3eeea0.88ba9","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3533.3331909179688,"y":907.0000305175781,"wires":[]},{"id":"345d1e4c.a4d53a","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4120.333190917969,"y":833.0000305175781,"wires":[[]]},{"id":"897ad748.6bc1a","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3899.8331909179688,"y":834.0000305175781,"wires":[["345d1e4c.a4d53a","3e58d0be.7ea9c8"]]},{"id":"3e58d0be.7ea9c8","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3901.3331909179688,"y":782.0000305175781,"wires":[["897ad748.6bc1a"]]},{"id":"1a02eac7.c9441d","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3505.3331909179688,"y":807.0000305175781,"wires":[["3eb1a73c.b0d568"]]},{"id":"3eb1a73c.b0d568","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3709.3331909179688,"y":833.0000305175781,"wires":[["897ad748.6bc1a"]]},{"id":"4a7b763a.c84eb8","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3518.3331909179688,"y":761.0000305175781,"wires":[]},{"id":"615b04ad.f6464c","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3515.3331909179688,"y":863.0000305175781,"wires":[]},{"id":"3d3a13e2.9f6d74","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3085.0001220703125,"y":833.3333740234375,"wires":[["3c5bc8d.23da938","1878b166.3e923f"]]},{"id":"3c5bc8d.23da938","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3310.8333129882812,"y":920,"wires":[]},{"id":"efad061b.ce6e8","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n\n","outputs":"3","noerr":0,"x":3303.3331909179688,"y":1091.6666564941406,"wires":[["5a4a2fa0.fd6398","aba9833e.327d08"],["b106e32e.676448","5365e8b2.e2cd1"],["57b9c65b.4f5698","851ebb85.80f33"]]},{"id":"5a4a2fa0.fd6398","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3311.8331909179688,"y":1013.6666564941406,"wires":[["efad061b.ce6e8"]]},{"id":"57b9c65b.4f5698","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3543.3331909179688,"y":1163.6666564941406,"wires":[]},{"id":"2aac4fa8.567bf8","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4130.333190917969,"y":1089.6666564941406,"wires":[[]]},{"id":"c43f0266.c79398","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3909.8331909179688,"y":1090.6666564941406,"wires":[["2aac4fa8.567bf8","2e4531d2.926d26"]]},{"id":"2e4531d2.926d26","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3911.3331909179688,"y":1038.6666564941406,"wires":[["c43f0266.c79398"]]},{"id":"98919be0.b9178","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3515.3331909179688,"y":1063.6666564941406,"wires":[["5365e8b2.e2cd1"]]},{"id":"5365e8b2.e2cd1","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3719.3331909179688,"y":1089.6666564941406,"wires":[["c43f0266.c79398"]]},{"id":"aba9833e.327d08","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3528.3331909179688,"y":1017.6666564941406,"wires":[]},{"id":"b106e32e.676448","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3525.3331909179688,"y":1119.6666564941406,"wires":[]},{"id":"a4e91214.6ed7c8","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3093.3333740234375,"y":1086.66650390625,"wires":[["8d2a6e32.24286","efad061b.ce6e8"]]},{"id":"8d2a6e32.24286","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3320.8333129882812,"y":1176.6666259765625,"wires":[]},{"id":"e2926287.0c9498","type":"comment","z":"d6470035.fe231","name":"A need to be +x2 B (time between 2 blink)","info":"","x":3313.3333740234375,"y":721.6668090820312,"wires":[]},{"id":"7d2dd5cc.2782dc","type":"comment","z":"d6470035.fe231","name":"B need to be -x2A (blink duration)","info":"","x":3889.16650390625,"y":746.666748046875,"wires":[]},{"id":"61135290.b5741c","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2863.0556640625,"y":320.55555725097656,"wires":[["fa17ca86.8ba398"]]},{"id":"18691137.c7abef","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and 1 as payload","func":"msg.topic=\"tpc_trigger\";\nmsg.payload= 1;\nreturn msg;","outputs":1,"noerr":0,"x":2553.1947021484375,"y":250.83331298828125,"wires":[["61135290.b5741c"]]},{"id":"c3f3f84b.6400a8","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2242.083251953125,"y":230.8332977294922,"wires":[["18691137.c7abef"]]},{"id":"498fa66b.40a058","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2563.611083984375,"y":319.7221984863281,"wires":[["61135290.b5741c"]]},{"id":"a2be54be.14081","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"9","payloadType":"num","repeat":"","crontab":"","once":false,"x":2362.5,"y":555.27783203125,"wires":[["721001ec.89165"]]},{"id":"64c6540f.265bbc","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2879.7222290039062,"y":579.7222595214844,"wires":[["d03daad5.ff762"]]},{"id":"23a9ef6d.272118","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2633.6112365722656,"y":500.00001525878906,"wires":[["64c6540f.265bbc"]]},{"id":"c907f75e.6276c","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2276.2499389648438,"y":501.25,"wires":[["23a9ef6d.272118"]]},{"id":"721001ec.89165","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2580.2776489257812,"y":578.8889007568359,"wires":[["64c6540f.265bbc"]]},{"id":"1c997bd8.fbbb7c","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"x":2362.5,"y":862.5,"wires":[["5f91446d.4cc9a4"]]},{"id":"806297de.4f697","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2887.2222290039062,"y":834.4444274902344,"wires":[["3d3a13e2.9f6d74"]]},{"id":"73eaebf.7bdb214","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2364.9998779296875,"y":724.7222290039062,"wires":[[]]},{"id":"5f91446d.4cc9a4","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2587.7776489257812,"y":833.6110687255859,"wires":[["806297de.4f697"]]},{"id":"398568ef.15359","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2899.999969482422,"y":1032.4999237060547,"wires":[["a4e91214.6ed7c8"]]},{"id":"5e5c6a1d.bb82a4","type":"function","z":"d6470035.fe231","name":"send aft trigger 2 dot","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = 2;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2901.3887939453125,"y":1088.611083984375,"wires":[["a4e91214.6ed7c8"]]},{"id":"f886b4d1.9a5eb8","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2347.91650390625,"y":1012.6388549804688,"wires":[["6ec02a08.3de8b4"]]},{"id":"38ba2818.3ae2c","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2369.375,"y":452.5,"wires":[["23a9ef6d.272118"]]},{"id":"31f299e9.5f293e","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2377.5,"y":675,"wires":[["ba02cdeb.f92438"]]},{"id":"bde9091.e9770f8","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2397.5,"y":948.75,"wires":[["6ec02a08.3de8b4"]]},{"id":"c9f458c.d1122a8","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2065,"y":310,"wires":[["18691137.c7abef"]]},{"id":"ba02cdeb.f92438","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2608.75,"y":761.25,"wires":[["806297de.4f697"]]},{"id":"6ec02a08.3de8b4","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2600,"y":1013.75,"wires":[["5e5c6a1d.bb82a4"]]},{"id":"de606f4f.d4491","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2109.9999389648438,"y":1474.9999389648438,"wires":[]},{"id":"6be4fae7.c3ec24","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2143.61083984375,"y":1656.8333129882812,"wires":[]},{"id":"355642fa.7b0b3e","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2135.777587890625,"y":1932.333251953125,"wires":[]},{"id":"bcec73d1.95d508","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2339.1112670898438,"y":1422.610855102539,"wires":[["ac5bf0f5.8b008"]]},{"id":"5b3328b.90d8958","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n\n","outputs":"3","noerr":0,"x":3281.6109619140625,"y":1423.999755859375,"wires":[["60edc27b.994edc","457642e0.0cb004"],["8234251e.1acda","26fc6eca.f5056a"],["5345cd00.126814","d22e1f99.3730b"]]},{"id":"60edc27b.994edc","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3290.1109619140625,"y":1345.999755859375,"wires":[["5b3328b.90d8958"]]},{"id":"5345cd00.126814","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3521.6109619140625,"y":1495.999755859375,"wires":[]},{"id":"33c9f4e4.910f2c","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4108.6109619140625,"y":1421.999755859375,"wires":[[]]},{"id":"61702f7e.5e2fb","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3888.1109619140625,"y":1422.999755859375,"wires":[["33c9f4e4.910f2c","bd9087d1.884ed"]]},{"id":"bd9087d1.884ed","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3889.6109619140625,"y":1370.999755859375,"wires":[["61702f7e.5e2fb"]]},{"id":"196ecc6d.303644","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3493.6109619140625,"y":1395.999755859375,"wires":[["26fc6eca.f5056a"]]},{"id":"26fc6eca.f5056a","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3697.6109619140625,"y":1421.999755859375,"wires":[["61702f7e.5e2fb"]]},{"id":"457642e0.0cb004","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3506.6109619140625,"y":1349.999755859375,"wires":[]},{"id":"8234251e.1acda","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3503.6109619140625,"y":1451.999755859375,"wires":[]},{"id":"aab33036.e4bce","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3064.9442138671875,"y":1423.9998168945312,"wires":[["f46f4f8a.9879e8","5b3328b.90d8958"]]},{"id":"f46f4f8a.9879e8","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3299.111083984375,"y":1508.9997253417969,"wires":[]},{"id":"2414fddb.211f82","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n\n\n","outputs":"3","noerr":0,"x":3288.2776489257812,"y":1683.6663665771484,"wires":[["7913a38e.13ec54","1576543.1bd6bac"],["b117842d.fc2c38","5f0319de.cdab1"],["45fe2781.608f8","da11273c.f6ecb"]]},{"id":"7913a38e.13ec54","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3296.7776489257812,"y":1605.6663665771484,"wires":[["2414fddb.211f82"]]},{"id":"45fe2781.608f8","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3528.2776489257812,"y":1755.6663665771484,"wires":[]},{"id":"4c41865.eb282f8","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4115.277648925781,"y":1681.6663665771484,"wires":[[]]},{"id":"14c41df.365b662","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3894.7776489257812,"y":1682.6663665771484,"wires":[["4c41865.eb282f8","c79da822.ffc308"]]},{"id":"c79da822.ffc308","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3896.2776489257812,"y":1630.6663665771484,"wires":[["14c41df.365b662"]]},{"id":"36b26dc6.fccc22","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3500.2776489257812,"y":1655.6663665771484,"wires":[["5f0319de.cdab1"]]},{"id":"5f0319de.cdab1","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3704.2776489257812,"y":1681.6663665771484,"wires":[["14c41df.365b662"]]},{"id":"1576543.1bd6bac","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3513.2776489257812,"y":1609.6663665771484,"wires":[]},{"id":"b117842d.fc2c38","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3510.2776489257812,"y":1711.6663665771484,"wires":[]},{"id":"4ec86f7c.335928","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3079.9443359375,"y":1683.6664428710938,"wires":[["a31ebdf0.cf094","2414fddb.211f82"]]},{"id":"a31ebdf0.cf094","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3305.7777709960938,"y":1768.6663360595703,"wires":[]},{"id":"921baf18.696018","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2899.1112060546875,"y":1882.3330688476562,"wires":[["4ae7e917.8438e"]]},{"id":"e91f4a20.40252","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n\n\n","outputs":"3","noerr":0,"x":3301.6110229492188,"y":1938.9997863769531,"wires":[["d8946972.96ef18","57f9c441.3e8bdc"],["413ef4df.12d4fc","78eb4cb3.2311a4"],["dcf02b0e.15a798","d4ae340f.80d4e"]]},{"id":"d8946972.96ef18","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3310.1110229492188,"y":1860.9997863769531,"wires":[["e91f4a20.40252"]]},{"id":"dcf02b0e.15a798","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3541.6110229492188,"y":2010.9997863769531,"wires":[]},{"id":"f878b76.635d5c8","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4128.611022949219,"y":1936.9997863769531,"wires":[[]]},{"id":"aaf07db1.3c391","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3908.1110229492188,"y":1937.9997863769531,"wires":[["f878b76.635d5c8","5ee3f915.498588"]]},{"id":"5ee3f915.498588","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3909.6110229492188,"y":1885.9997863769531,"wires":[["aaf07db1.3c391"]]},{"id":"8d76b508.7257e8","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3513.6110229492188,"y":1910.9997863769531,"wires":[["78eb4cb3.2311a4"]]},{"id":"78eb4cb3.2311a4","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3717.6110229492188,"y":1936.9997863769531,"wires":[["aaf07db1.3c391"]]},{"id":"57f9c441.3e8bdc","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3526.6110229492188,"y":1864.9997863769531,"wires":[]},{"id":"413ef4df.12d4fc","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3523.6110229492188,"y":1966.9997863769531,"wires":[]},{"id":"4ae7e917.8438e","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3093.2779541015625,"y":1937.3331298828125,"wires":[["9476c6d8.352338","e91f4a20.40252"]]},{"id":"9476c6d8.352338","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3319.1111450195312,"y":2023.999755859375,"wires":[]},{"id":"9f8ffb99.ea155","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n\n\n","outputs":"3","noerr":0,"x":3311.6110229492188,"y":2195.6664123535156,"wires":[["9e98d7a1.47cb28","e3c89352.9bc4d8"],["6448bc3c.e7d64c","7a7eb9f8.eed7a"],["f07d7761.a7f098","8825e197.e63fd8"]]},{"id":"9e98d7a1.47cb28","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3320.1110229492188,"y":2117.6664123535156,"wires":[["9f8ffb99.ea155"]]},{"id":"f07d7761.a7f098","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3551.6110229492188,"y":2267.6664123535156,"wires":[]},{"id":"235f241f.3ef3a4","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4138.611022949219,"y":2193.6664123535156,"wires":[[]]},{"id":"a8b6ed.ae69d11","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3918.1110229492188,"y":2194.6664123535156,"wires":[["235f241f.3ef3a4","cf47d7f5.af216"]]},{"id":"cf47d7f5.af216","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3919.6110229492188,"y":2142.6664123535156,"wires":[["a8b6ed.ae69d11"]]},{"id":"37da0ac1.3cc696","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3523.6110229492188,"y":2167.6664123535156,"wires":[["7a7eb9f8.eed7a"]]},{"id":"7a7eb9f8.eed7a","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3727.6110229492188,"y":2193.6664123535156,"wires":[["a8b6ed.ae69d11"]]},{"id":"e3c89352.9bc4d8","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3536.6110229492188,"y":2121.6664123535156,"wires":[]},{"id":"6448bc3c.e7d64c","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3533.6110229492188,"y":2223.6664123535156,"wires":[]},{"id":"a896a200.772428","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3101.6112060546875,"y":2190.666259765625,"wires":[["3aa2c7bf.010b4","9f8ffb99.ea155"]]},{"id":"3aa2c7bf.010b4","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3329.1111450195312,"y":2280.6663818359375,"wires":[]},{"id":"903a2871.d2b438","type":"comment","z":"d6470035.fe231","name":"A need to be +x2 B (time between 2 blink)","info":"","x":3321.6112060546875,"y":1825.6665649414062,"wires":[]},{"id":"3536c295.28fbb6","type":"comment","z":"d6470035.fe231","name":"B need to be -x2A (blink duration)","info":"","x":3897.4443359375,"y":1850.66650390625,"wires":[]},{"id":"ff2fc37c.13975","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2871.33349609375,"y":1424.5553131103516,"wires":[["aab33036.e4bce"]]},{"id":"bc02bfda.b055","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2250.361083984375,"y":1334.8330535888672,"wires":[["38cdb2a8.72b42e"]]},{"id":"ac5bf0f5.8b008","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2571.888916015625,"y":1423.7219543457031,"wires":[["ff2fc37c.13975"]]},{"id":"dbb97dde.6e3cf","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"9","payloadType":"num","repeat":"","crontab":"","once":false,"x":2370.77783203125,"y":1659.277587890625,"wires":[["13306671.bcf6f2"]]},{"id":"a5bdc720.753158","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2888.0000610351562,"y":1683.7220153808594,"wires":[["4ec86f7c.335928"]]},{"id":"d8e7741f.4b50d","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2641.8890686035156,"y":1603.999771118164,"wires":[["a5bdc720.753158"]]},{"id":"61f82992.54d87","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2284.5277709960938,"y":1605.249755859375,"wires":[["d8e7741f.4b50d"]]},{"id":"13306671.bcf6f2","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2588.5554809570312,"y":1682.888656616211,"wires":[["a5bdc720.753158"]]},{"id":"976b4804.05644","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"x":2370.77783203125,"y":1966.499755859375,"wires":[["deb313c7.e1de4"]]},{"id":"bc9a0f12.15dc38","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2895.5000610351562,"y":1938.4441833496094,"wires":[["4ae7e917.8438e"]]},{"id":"23e407b6.db4738","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2373.2777099609375,"y":1828.7219848632812,"wires":[[]]},{"id":"deb313c7.e1de4","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2596.0554809570312,"y":1937.610824584961,"wires":[["bc9a0f12.15dc38"]]},{"id":"9f92ed84.b75aa8","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2908.277801513672,"y":2136.4996795654297,"wires":[["a896a200.772428"]]},{"id":"dc2bc369.f7a2b8","type":"function","z":"d6470035.fe231","name":"send aft trigger 2 dot","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = 2;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2909.6666259765625,"y":2192.61083984375,"wires":[["a896a200.772428"]]},{"id":"fb406c06.4fdcf","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2356.1943359375,"y":2116.6386108398438,"wires":[["ede55dda.94594"]]},{"id":"d22e1f99.3730b","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2377.65283203125,"y":1556.499755859375,"wires":[["d8e7741f.4b50d"]]},{"id":"da11273c.f6ecb","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2385.77783203125,"y":1778.999755859375,"wires":[["a65bcef7.a6c3a8"]]},{"id":"d4ae340f.80d4e","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2405.77783203125,"y":2052.749755859375,"wires":[["ede55dda.94594"]]},{"id":"851ebb85.80f33","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2221.611114501953,"y":1282.3331298828125,"wires":[["38cdb2a8.72b42e"]]},{"id":"a65bcef7.a6c3a8","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2617.02783203125,"y":1865.249755859375,"wires":[["bc9a0f12.15dc38"]]},{"id":"ede55dda.94594","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2608.27783203125,"y":2117.749755859375,"wires":[["dc2bc369.f7a2b8"]]},{"id":"c9b49a95.12dcb8","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2155,"y":2587.5,"wires":[]},{"id":"e73f6bee.68a718","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2188.6109008789062,"y":2769.3333740234375,"wires":[]},{"id":"644c4b06.b2308c","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2180.7776489257812,"y":3044.8333129882812,"wires":[]},{"id":"52e110ca.cef6b","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2384.111328125,"y":2535.1109161376953,"wires":[["c4bc0a81.18ae48"]]},{"id":"72dd126d.8398c4","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n\n\n","outputs":"3","noerr":0,"x":3326.6110229492188,"y":2536.4998168945312,"wires":[["c32306e4.79352","2a3d6632.139922"],["32808de7.bec5a2","e904440a.9a92a"],["a7bb7a91.d950b","e3432d8.2b3925"]]},{"id":"c32306e4.79352","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3335.1110229492188,"y":2458.4998168945312,"wires":[["72dd126d.8398c4"]]},{"id":"a7bb7a91.d950b","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3566.6110229492188,"y":2608.4998168945312,"wires":[]},{"id":"31860a4a.a8959e","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4153.611022949219,"y":2534.4998168945312,"wires":[[]]},{"id":"e19baccb.18ed28","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3933.1110229492188,"y":2535.4998168945312,"wires":[["31860a4a.a8959e","cd25c06f.269158"]]},{"id":"cd25c06f.269158","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3934.6110229492188,"y":2483.4998168945312,"wires":[["e19baccb.18ed28"]]},{"id":"ef86cf5f.8ce3f","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3538.6110229492188,"y":2508.4998168945312,"wires":[["e904440a.9a92a"]]},{"id":"e904440a.9a92a","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3742.6110229492188,"y":2534.4998168945312,"wires":[["e19baccb.18ed28"]]},{"id":"2a3d6632.139922","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3551.6110229492188,"y":2462.4998168945312,"wires":[]},{"id":"32808de7.bec5a2","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3548.6110229492188,"y":2564.4998168945312,"wires":[]},{"id":"fc85eb61.3911d8","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3109.9442749023438,"y":2536.4998779296875,"wires":[["d56a464c.8e0f28","72dd126d.8398c4"]]},{"id":"d56a464c.8e0f28","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3344.1111450195312,"y":2621.499786376953,"wires":[]},{"id":"8199760a.db6f68","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n\n\n","outputs":"3","noerr":0,"x":3333.2777099609375,"y":2796.1664276123047,"wires":[["91c90566.fa1cf","d94de9ba.e6943"],["c14d8a00.6481d","2b21d415.0629b4"],["1201d10a.615b0f","a0af3da.190414"]]},{"id":"91c90566.fa1cf","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3341.7777099609375,"y":2718.1664276123047,"wires":[["8199760a.db6f68"]]},{"id":"1201d10a.615b0f","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3573.2777099609375,"y":2868.1664276123047,"wires":[]},{"id":"f1a400cd.0b0a1","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4160.2777099609375,"y":2794.1664276123047,"wires":[[]]},{"id":"68149ef0.c7acd","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3939.7777099609375,"y":2795.1664276123047,"wires":[["f1a400cd.0b0a1","db512c78.09cf28"]]},{"id":"db512c78.09cf28","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3941.2777099609375,"y":2743.1664276123047,"wires":[["68149ef0.c7acd"]]},{"id":"e889756d.5b2ba","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3545.2777099609375,"y":2768.1664276123047,"wires":[["2b21d415.0629b4"]]},{"id":"2b21d415.0629b4","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3749.2777099609375,"y":2794.1664276123047,"wires":[["68149ef0.c7acd"]]},{"id":"d94de9ba.e6943","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3558.2777099609375,"y":2722.1664276123047,"wires":[]},{"id":"c14d8a00.6481d","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3555.2777099609375,"y":2824.1664276123047,"wires":[]},{"id":"76f5280.f4876d8","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3124.9443969726562,"y":2796.16650390625,"wires":[["4641c02b.fae87","8199760a.db6f68"]]},{"id":"4641c02b.fae87","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3350.77783203125,"y":2881.1663970947266,"wires":[]},{"id":"80884cfb.68b158","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2944.1112670898438,"y":2994.8331298828125,"wires":[["e2a5aa4e.4d362"]]},{"id":"214ad3b5.f2e964","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n \n\n","outputs":"3","noerr":0,"x":3346.611083984375,"y":3051.4998474121094,"wires":[["2426ea77.9f265e","50225fff.3d202"],["349cf03d.92eb9","8e56462.9d76638"],["6cda1923.d18f78","7e3e2003.e895"]]},{"id":"2426ea77.9f265e","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3355.111083984375,"y":2973.4998474121094,"wires":[["214ad3b5.f2e964"]]},{"id":"6cda1923.d18f78","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3586.611083984375,"y":3123.4998474121094,"wires":[]},{"id":"86d83dbb.0c6e1","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4173.611083984375,"y":3049.4998474121094,"wires":[[]]},{"id":"8d4df2a4.6ebf68","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3953.111083984375,"y":3050.4998474121094,"wires":[["86d83dbb.0c6e1","e97b55eb.7843b8"]]},{"id":"e97b55eb.7843b8","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3954.611083984375,"y":2998.4998474121094,"wires":[["8d4df2a4.6ebf68"]]},{"id":"fb273978.d056b","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3558.611083984375,"y":3023.4998474121094,"wires":[["8e56462.9d76638"]]},{"id":"8e56462.9d76638","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3762.611083984375,"y":3049.4998474121094,"wires":[["8d4df2a4.6ebf68"]]},{"id":"50225fff.3d202","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3571.611083984375,"y":2977.4998474121094,"wires":[]},{"id":"349cf03d.92eb9","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3568.611083984375,"y":3079.4998474121094,"wires":[]},{"id":"e2a5aa4e.4d362","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3138.2780151367188,"y":3049.8331909179688,"wires":[["5ab6f5cd.bb2de4","214ad3b5.f2e964"]]},{"id":"5ab6f5cd.bb2de4","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3364.1112060546875,"y":3136.4998168945312,"wires":[]},{"id":"1c55fc13.eb9f5c","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n} \n  \n\n","outputs":"3","noerr":0,"x":3356.611083984375,"y":3308.166473388672,"wires":[["a3eb71f9.06f848","4fc5a15f.c7c228"],["2cdb8949.54bbe6","4d27acb6.18715c"],["8001a186.18f3f8","ad752473.b2faf"]]},{"id":"a3eb71f9.06f848","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3365.111083984375,"y":3230.166473388672,"wires":[["1c55fc13.eb9f5c"]]},{"id":"8001a186.18f3f8","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3596.611083984375,"y":3380.166473388672,"wires":[]},{"id":"e21392f6.70f3f8","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4183.611083984375,"y":3306.166473388672,"wires":[[]]},{"id":"1d4039f8.267686","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3963.111083984375,"y":3307.166473388672,"wires":[["e21392f6.70f3f8","b94d54b3.9712e"]]},{"id":"b94d54b3.9712e","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3964.611083984375,"y":3255.166473388672,"wires":[["1d4039f8.267686"]]},{"id":"a34fcb87.1c2d98","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3568.611083984375,"y":3280.166473388672,"wires":[["4d27acb6.18715c"]]},{"id":"4d27acb6.18715c","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3772.611083984375,"y":3306.166473388672,"wires":[["1d4039f8.267686"]]},{"id":"4fc5a15f.c7c228","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3581.611083984375,"y":3234.166473388672,"wires":[]},{"id":"2cdb8949.54bbe6","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3578.611083984375,"y":3336.166473388672,"wires":[]},{"id":"99818db6.d8b198","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3146.6112670898438,"y":3303.1663208007812,"wires":[["c7be4a43.974aa8","1c55fc13.eb9f5c"]]},{"id":"c7be4a43.974aa8","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3374.1112060546875,"y":3393.1664428710938,"wires":[]},{"id":"e3723f32.d64e9","type":"comment","z":"d6470035.fe231","name":"A need to be +x2 B (time between 2 blink)","info":"","x":3366.6112670898438,"y":2938.1666259765625,"wires":[]},{"id":"3e515bdb.d7b6c4","type":"comment","z":"d6470035.fe231","name":"B need to be -x2A (blink duration)","info":"","x":3942.4443969726562,"y":2963.1665649414062,"wires":[]},{"id":"c10fe9db.be3488","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2916.3335571289062,"y":2537.055374145508,"wires":[["fc85eb61.3911d8"]]},{"id":"bdb4767c.abfa08","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2295.3611450195312,"y":2447.3331146240234,"wires":[[]]},{"id":"c4bc0a81.18ae48","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2616.8889770507812,"y":2536.2220153808594,"wires":[["c10fe9db.be3488"]]},{"id":"c47d27c2.3b279","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"9","payloadType":"num","repeat":"","crontab":"","once":false,"x":2415.7778930664062,"y":2771.7776489257812,"wires":[["bc2a97bc.6f2ed"]]},{"id":"c23abfc1.9edd08","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2933.0001220703125,"y":2796.2220764160156,"wires":[["76f5280.f4876d8"]]},{"id":"9ab649be.d817b8","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2686.889129638672,"y":2716.4998321533203,"wires":[["c23abfc1.9edd08"]]},{"id":"f5f4d206.818db8","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2329.52783203125,"y":2717.7498168945312,"wires":[["9ab649be.d817b8"]]},{"id":"bc2a97bc.6f2ed","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2633.5555419921875,"y":2795.388717651367,"wires":[["c23abfc1.9edd08"]]},{"id":"bc12ecdd.b86a6","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"x":2415.7778930664062,"y":3078.9998168945312,"wires":[["2515949a.90a84c"]]},{"id":"9e531307.799178","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2940.5001220703125,"y":3050.9442443847656,"wires":[["e2a5aa4e.4d362"]]},{"id":"3091cd0a.f409ea","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2418.2777709960938,"y":2941.2220458984375,"wires":[[]]},{"id":"2515949a.90a84c","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2641.0555419921875,"y":3050.110885620117,"wires":[["9e531307.799178"]]},{"id":"5fcbde37.d62f2","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2953.277862548828,"y":3248.999740600586,"wires":[["99818db6.d8b198"]]},{"id":"6ea51c9d.644fcc","type":"function","z":"d6470035.fe231","name":"send aft trigger 2 dot","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = 2;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2954.6666870117188,"y":3305.1109008789062,"wires":[["99818db6.d8b198"]]},{"id":"e9dbf5c9.5c7c1","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2401.1943969726562,"y":3229.138671875,"wires":[["d9900df4.70a8a8"]]},{"id":"e3432d8.2b3925","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2422.6528930664062,"y":2668.9998168945312,"wires":[["9ab649be.d817b8"]]},{"id":"a0af3da.190414","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2430.7778930664062,"y":2891.4998168945312,"wires":[["15eac205.e06076"]]},{"id":"7e3e2003.e895","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2450.7778930664062,"y":3165.2498168945312,"wires":[["d9900df4.70a8a8"]]},{"id":"8825e197.e63fd8","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2283.2778930664062,"y":2401.4998168945312,"wires":[["13f5bead.9083e1"]]},{"id":"15eac205.e06076","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2662.0278930664062,"y":2977.7498168945312,"wires":[["9e531307.799178"]]},{"id":"d9900df4.70a8a8","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2653.2778930664062,"y":3230.2498168945312,"wires":[["6ea51c9d.644fcc"]]},{"id":"c4f5fce5.e9a27","type":"debug","z":"d6470035.fe231","name":"","active":true,"console":"false","complete":"payload","x":1670,"y":3985,"wires":[]},{"id":"155e378.3ae0cc9","type":"function","z":"d6470035.fe231","name":"3 CH Splitter \"\"","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\n\nvar array = msg.payload.split(''),\n    a = array[0], b = array[1], c = array[2];\n    \n    \n    msg1.payload = a;\n    \n    \n    msg2.payload = b;\n    \n   \n    msg3.payload = c;\n\n    \n    return [msg1,msg2,msg3];\n","outputs":"3","noerr":0,"x":1680.5,"y":4030,"wires":[["d1b6810a.ac2a2","f3690a83.0c9178"],["8d54c06e.27232","3c639a82.1d5176"],["4d09db84.e7a0d4","865cacc4.0a2f98"]]},{"id":"d1b6810a.ac2a2","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2161.833984375,"y":3727.833251953125,"wires":[]},{"id":"8d54c06e.27232","type":"debug","z":"d6470035.fe231","name":"","active":false,"console":"false","complete":"payload","x":2195.4448852539062,"y":3909.6666259765625,"wires":[]},{"id":"4d09db84.e7a0d4","type":"debug","z":"d6470035.fe231","name":"","active":true,"console":"false","complete":"payload","x":2187.6116333007812,"y":4185.166564941406,"wires":[]},{"id":"8044765.0726f88","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2390.9453125,"y":3675.4441680908203,"wires":[["f3690a83.0c9178"]]},{"id":"f86b8db5.a89d88","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n \n\n","outputs":"3","noerr":0,"x":3333.4450073242188,"y":3676.8330688476562,"wires":[["1a85e725.9ddfb9","1f6b599e.37a2f6"],["7f658c8f.d8d2dc","e9d14363.bfe71"],["e4a90e9.231c0f","f36a1ee8.168ec"]]},{"id":"1a85e725.9ddfb9","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3341.9450073242188,"y":3598.8330688476562,"wires":[["f86b8db5.a89d88"]]},{"id":"e4a90e9.231c0f","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3573.4450073242188,"y":3748.8330688476562,"wires":[]},{"id":"7efc4191.942658","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4160.445007324219,"y":3674.8330688476562,"wires":[[]]},{"id":"f77a644e.09b6d","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3939.9450073242188,"y":3675.8330688476562,"wires":[["7efc4191.942658","ab6d80f8.1b13c"]]},{"id":"ab6d80f8.1b13c","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3941.4450073242188,"y":3623.8330688476562,"wires":[["f77a644e.09b6d"]]},{"id":"1962869d.8d45f1","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3545.4450073242188,"y":3648.8330688476562,"wires":[["e9d14363.bfe71"]]},{"id":"e9d14363.bfe71","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3749.4450073242188,"y":3674.8330688476562,"wires":[["f77a644e.09b6d"]]},{"id":"1f6b599e.37a2f6","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3558.4450073242188,"y":3602.8330688476562,"wires":[]},{"id":"7f658c8f.d8d2dc","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3555.4450073242188,"y":3704.8330688476562,"wires":[]},{"id":"9083806e.46e6e8","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3116.7782592773438,"y":3676.8331298828125,"wires":[["a78c3e2c.dbcfe","f86b8db5.a89d88"]]},{"id":"a78c3e2c.dbcfe","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3350.9451293945312,"y":3761.833038330078,"wires":[]},{"id":"cfae2d99.651848","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n \n\n","outputs":"3","noerr":0,"x":3340.1116943359375,"y":3936.4996795654297,"wires":[["51030d12.6abd04","f58f9f66.1d07e"],["32136f06.dd8ea","fdfe81b5.37c5b"],["53230c24.35a504","65eb774d.506ea"]]},{"id":"51030d12.6abd04","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3348.6116943359375,"y":3858.4996795654297,"wires":[["cfae2d99.651848"]]},{"id":"53230c24.35a504","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":false,"console":"false","complete":"payload","x":3580.1116943359375,"y":4008.4996795654297,"wires":[]},{"id":"7a62f8dc.baea1","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4167.1116943359375,"y":3934.4996795654297,"wires":[[]]},{"id":"1a786842.9cc17","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3946.6116943359375,"y":3935.4996795654297,"wires":[["7a62f8dc.baea1","f030e671.86cc6"]]},{"id":"f030e671.86cc6","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3948.1116943359375,"y":3883.4996795654297,"wires":[["1a786842.9cc17"]]},{"id":"b663a499.4f8db","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3552.1116943359375,"y":3908.4996795654297,"wires":[["fdfe81b5.37c5b"]]},{"id":"fdfe81b5.37c5b","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3756.1116943359375,"y":3934.4996795654297,"wires":[["1a786842.9cc17"]]},{"id":"f58f9f66.1d07e","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3565.1116943359375,"y":3862.4996795654297,"wires":[]},{"id":"32136f06.dd8ea","type":"debug","z":"d6470035.fe231","name":"blink","active":false,"console":"false","complete":"payload","x":3562.1116943359375,"y":3964.4996795654297,"wires":[]},{"id":"2cf3699b.6d9f2e","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3131.7783813476562,"y":3936.499755859375,"wires":[["7b91c1f3.794c3","cfae2d99.651848"]]},{"id":"7b91c1f3.794c3","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":false,"console":"false","complete":"payload","x":3357.61181640625,"y":4021.4996490478516,"wires":[]},{"id":"1af38de6.b3c45a","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":2950.9452514648438,"y":4135.1663818359375,"wires":[["66739d67.d0c93c"]]},{"id":"d5733126.180898","type":"function","z":"d6470035.fe231","name":"digit to blink","func":"\n    msg1 = {};\n    msg2 = {};\n    msg3 = {};\n\nmsg1.payload= 0;\nmsg2.payload= 0;\nmsg3.payload= 0;\n\ntemp = msg.payload;\ntemp--;\nmsg1.payload = temp;\n\nif(temp>=0){\n    msg2.payload = 1;\n    return [msg1,msg2,null];\n}\nelse\n{\n    msg1 = null;\n    msg2.payload = 0;\n    msg3.payload = 1;\n    return [null,null,msg3];  \n}\n    \n  \n\n","outputs":"3","noerr":0,"x":3353.445068359375,"y":4191.833099365234,"wires":[["eb34329c.df4c6","3ad0199e.7ebd6e"],["ee8051d3.d203f","54eb960e.cc4f28"],["a4429db1.3d9af8"]]},{"id":"eb34329c.df4c6","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3361.945068359375,"y":4113.833099365234,"wires":[["d5733126.180898"]]},{"id":"a4429db1.3d9af8","type":"debug","z":"d6470035.fe231","name":"trigger_out","active":true,"console":"false","complete":"payload","x":3593.445068359375,"y":4263.833099365234,"wires":[]},{"id":"83cba217.1d326","type":"bbb-discrete-out","z":"d6470035.fe231","pin":"USR3","inverting":false,"toggle":false,"defaultState":"0","name":"","x":4180.445068359375,"y":4189.833099365234,"wires":[[]]},{"id":"f66904c5.ca5c88","type":"function","z":"d6470035.fe231","name":"blink loop","func":"switch (msg.topic) {\n        case \"off\":\n            msg.payload = 1;\n            msg.topic = \"on\";\n            break;\n        case \"on\":\n            msg.payload = 0;\n            msg.topic = \"done\";\n            break;\n        default:\n            msg = null;\n            break;\n}\nreturn [msg];\n","outputs":1,"noerr":0,"x":3959.945068359375,"y":4190.833099365234,"wires":[["83cba217.1d326","557a9022.3dc3"]]},{"id":"557a9022.3dc3","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":3961.445068359375,"y":4138.833099365234,"wires":[["f66904c5.ca5c88"]]},{"id":"bb7a8b41.61a4c","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":3565.445068359375,"y":4163.833099365234,"wires":[["54eb960e.cc4f28"]]},{"id":"54eb960e.cc4f28","type":"function","z":"d6470035.fe231","name":"set \"off\" as topic","func":"msg.topic=\"off\";\nreturn msg;","outputs":1,"noerr":0,"x":3769.445068359375,"y":4189.833099365234,"wires":[["f66904c5.ca5c88"]]},{"id":"3ad0199e.7ebd6e","type":"debug","z":"d6470035.fe231","name":"temp","active":true,"console":"false","complete":"payload","x":3578.445068359375,"y":4117.833099365234,"wires":[]},{"id":"ee8051d3.d203f","type":"debug","z":"d6470035.fe231","name":"blink","active":true,"console":"false","complete":"payload","x":3575.445068359375,"y":4219.833099365234,"wires":[]},{"id":"66739d67.d0c93c","type":"function","z":"d6470035.fe231","name":"0 to 10","func":"input = msg.payload;\n\nif(input === 0)\n{\n    msg.payload = 10\n}\nreturn msg;","outputs":1,"noerr":0,"x":3145.1119995117188,"y":4190.166442871094,"wires":[["578ac5da.83950c","d5733126.180898"]]},{"id":"578ac5da.83950c","type":"debug","z":"d6470035.fe231","name":"0 to 10","active":true,"console":"false","complete":"payload","x":3370.9451904296875,"y":4276.833068847656,"wires":[]},{"id":"809a9b03.5167e","type":"comment","z":"d6470035.fe231","name":"A need to be +x2 B (time between 2 blink)","info":"","x":3373.4452514648438,"y":4078.4998779296875,"wires":[]},{"id":"2a248301.cd8f2c","type":"comment","z":"d6470035.fe231","name":"B need to be -x2A (blink duration)","info":"","x":3949.2783813476562,"y":4103.499816894531,"wires":[]},{"id":"372a29a4.a18cf6","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2923.1675415039062,"y":3677.388626098633,"wires":[["9083806e.46e6e8"]]},{"id":"85ae55fe.3716e8","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2302.1951293945312,"y":3587.6663665771484,"wires":[["2e992e45.6f46aa"]]},{"id":"f3690a83.0c9178","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2623.7229614257812,"y":3676.5552673339844,"wires":[["372a29a4.a18cf6"]]},{"id":"6b766acd.d5f284","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"9","payloadType":"num","repeat":"","crontab":"","once":false,"x":2422.6118774414062,"y":3912.1109008789062,"wires":[["3c639a82.1d5176"]]},{"id":"488190f0.a61b58","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2939.8341064453125,"y":3936.5553283691406,"wires":[["2cf3699b.6d9f2e"]]},{"id":"151c77e3.b7e8d","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2693.723114013672,"y":3856.8330841064453,"wires":[["488190f0.a61b58"]]},{"id":"447cf20d.05b5a4","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2336.36181640625,"y":3858.0830688476562,"wires":[["151c77e3.b7e8d"]]},{"id":"3c639a82.1d5176","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2640.3895263671875,"y":3935.721969604492,"wires":[["488190f0.a61b58"]]},{"id":"fc0d541f.da3a5","type":"inject","z":"d6470035.fe231","name":"","topic":"new","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"x":2422.6118774414062,"y":4219.333068847656,"wires":[["865cacc4.0a2f98"]]},{"id":"7ff6ad1d.5909dc","type":"function","z":"d6470035.fe231","name":"send aft trigger","func":"context.data = context.data || {};\nswitch (msg.topic) {\n        case \"tpc_payload\":\n            \n            context.data.payload = msg.payload;\n            break;\n            \n            \n        case \"tpc_trigger\":\n            \n            msg.payload = context.data.payload;\n            context.data = null;\n            return [msg];\n            \n            \n        default:\n            msg = null;\n            break;\n}\n\n\n","outputs":"1","noerr":0,"x":2947.3341064453125,"y":4191.277496337891,"wires":[["66739d67.d0c93c"]]},{"id":"74a0b706.c3a298","type":"inject","z":"d6470035.fe231","name":"","topic":"","payload":"trigger","payloadType":"str","repeat":"","crontab":"","once":false,"x":2425.1117553710938,"y":4081.5552978515625,"wires":[[]]},{"id":"865cacc4.0a2f98","type":"function","z":"d6470035.fe231","name":"set \"tpc_payload\" as topic","func":"msg.topic=\"tpc_payload\";\nreturn msg;","outputs":1,"noerr":0,"x":2647.8895263671875,"y":4190.444137573242,"wires":[["7ff6ad1d.5909dc"]]},{"id":"f36a1ee8.168ec","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2429.4868774414062,"y":3809.3330688476562,"wires":[["151c77e3.b7e8d"]]},{"id":"65eb774d.506ea","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2437.6118774414062,"y":4031.8330688476562,"wires":[["ccb1d1a0.24fe68"]]},{"id":"ad752473.b2faf","type":"delay","z":"d6470035.fe231","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2295.11181640625,"y":3536.8330688476562,"wires":[["2e992e45.6f46aa"]]},{"id":"ccb1d1a0.24fe68","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2668.8618774414062,"y":4118.083068847656,"wires":[["7ff6ad1d.5909dc"]]},{"id":"38cdb2a8.72b42e","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2546.4285888671875,"y":1345.7144165039062,"wires":[["ff2fc37c.13975"]]},{"id":"13f5bead.9083e1","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2609.2857666015625,"y":2460,"wires":[["c10fe9db.be3488"]]},{"id":"2e992e45.6f46aa","type":"function","z":"d6470035.fe231","name":"set \"tpc_trigger\" as topic and check trigger","func":"msg.topic=\"tpc_trigger\";\nif(msg.payload === 1)\n{\nreturn msg;\n}","outputs":1,"noerr":0,"x":2609.2857666015625,"y":3607.14306640625,"wires":[["372a29a4.a18cf6"]]},{"id":"91de8249.f478","type":"exec","z":"d6470035.fe231","command":"ifconfig","addpay":false,"append":"","useSpawn":false,"timer":"","name":"ifconfig","x":485,"y":2232.5,"wires":[["69d295c9.6cf354","24bcf653.a6a0fa"],[],[]]},{"id":"81c088c3.f4993","type":"inject","z":"d6470035.fe231","name":"get ip - eth0","topic":"ip","payload":"eth0","payloadType":"str","repeat":"","crontab":"","once":true,"x":333,"y":2232,"wires":[["91de8249.f478"]]},{"id":"cc66420e.ffd9f","type":"debug","z":"d6470035.fe231","name":"test out","active":true,"console":"false","complete":"payload","x":1071.3334045410156,"y":2138.3332748413086,"wires":[]},{"id":"69d295c9.6cf354","type":"function","z":"d6470035.fe231","name":"Extract network config","func":"// Initialize variables\nvar input, tokens, inet, bcast, mask;\nvar outString = \"\";\n\n// Parse the entire string by spaces, and put each item into an array called tokens\n\ninput = msg.payload;\ntokens = input.split(\":\", 10);\n\n// Get the 7th token (example: \"addr:192.168.0.120\")\n// and get the substring from character 6 to the end\ninet = tokens[7].split(\" \", 1);\noutString += \"\" + inet[0];\n\n\n\n\n// return the final output\nreturn {payload: outString};\n\n","outputs":1,"noerr":0,"x":695.6666564941406,"y":2228.499931335449,"wires":[["a5a3c105.980f4"]]},{"id":"a5a3c105.980f4","type":"delay","z":"d6470035.fe231","name":"Delay","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":897.9999694824219,"y":2233.166679382324,"wires":[["cc66420e.ffd9f","bc05f9f.4196c08"]]},{"id":"24bcf653.a6a0fa","type":"debug","z":"d6470035.fe231","name":"test out 2","active":false,"console":"false","complete":"payload","x":745,"y":2116.5,"wires":[]}]
arthur1990

Flow Info

created 4 months, 2 weeks ago

Node Types

Core
  • comment (x8)
  • debug (x78)
  • delay (x46)
  • exec (x1)
  • function (x108)
  • inject (x51)
Other

Tags

  • IP
  • Address
  • LED
  • blink
  • network
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option