[ { "id": "LED.text", "type": "subflow", "name": "LED text", "in": [ { "x": 60, "y": 60, "wires": [ { "id": "cdda86b7.a64578" } ] } ], "out": [], "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json" }, { "id": "cdda86b7.a64578", "type": "function", "z": "LED.text", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "name": ".message ?", "func": "if (msg.hasOwnProperty(\"message\")){\n msg.payload = msg.message;\n delete msg.message;\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 170, "y": 60, "wires": [ [ "7fea2443.029adc" ] ] }, { "id": "7fea2443.029adc", "type": "function", "z": "LED.text", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "name": "number or object ?", "func": "if (typeof msg.payload === \"number\"){\n msg.payload = \"\" + msg.payload;\n} else if (typeof msg.payload === \"object\") {\n msg.payload = JSON.stringify(msg.payload);\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 350, "y": 60, "wires": [ [ "3d9378c5.c26c88" ] ] }, { "id": "3d9378c5.c26c88", "type": "function", "z": "LED.text", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "name": "Format text if provide from calendar", "func": "if (msg.hasOwnProperty(\"data\")){\n if(msg.data.hasOwnProperty(\"kind\")){\n if(~msg.data.kind.indexOf(\"calendar\")){\n msg.payload = JSON.parse(msg.payload);\n msg.payload = msg.payload.title + \" : \" + msg.payload.start;\n }\n }\n}\nreturn msg;", "outputs": 1, "x": 610, "y": 60, "wires": [ [ "bef05b74.410fa8" ] ] }, { "id": "bef05b74.410fa8", "type": "function", "z": "LED.text", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "name": "is time ?", "func": "var re = msg.payload.match(/(([01][0-9]|2[0-3]):[0-5][0-9])/);\nif ( re !== null && re.length !==0 && re[0] == msg.payload ){\n return [msg,null];\n}\nreturn [null,msg];", "outputs": "2", "x": 840, "y": 60, "wires": [ [ "aecdfe52.5132" ], [ "6287da21.9d7824" ] ] }, { "id": "aecdfe52.5132", "type": "function", "z": "LED.text", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "name": "", "func": "msg.y = 13;\nmsg.x = 1;\nmsg.font = \"Roboto-Regular\";\nmsg.textsize = 2;\nmsg.speed = 0;\n\nif (!msg.hasOwnProperty(\"intensity\")){\n msg.intensity = 60;\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 970, "y": 40, "wires": [ [ "2719a884.d8e658" ] ] }, { "id": "6287da21.9d7824", "type": "function", "z": "LED.text", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "name": "", "func": "if (!msg.hasOwnProperty(\"speed\")){\n msg.speed = 3;\n}\nif (!msg.hasOwnProperty(\"font\")){\n msg.font = \"Roboto-Regular\";\n}\nif (!msg.hasOwnProperty(\"size\")){\n msg.size = 3;\n}\nif (!msg.hasOwnProperty(\"intensity\")){\n msg.intensity = 60;\n}\nreturn msg;", "outputs": 1, "noerr": 0, "x": 970, "y": 80, "wires": [ [ "2719a884.d8e658" ] ] }, { "id": "2719a884.d8e658", "type": "queueuser", "z": "LED.text", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "msgaction": "add", "element": "", "msgtype": "", "over": "addStart", "ttl": "1", "callbackTopic": "", "broker": "MQTT.Localhost", "topic": "Topic.LedMatrix", "x": 1110, "y": 60, "wires": [ [ "cd2abccb.32d54" ] ] }, { "id": "cd2abccb.32d54", "type": "queueuser", "z": "LED.text", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "msgaction": "cons", "element": "", "msgtype": "", "over": "", "ttl": "", "callbackTopic": "LedMatrix/display", "broker": "MQTT.Localhost", "topic": "Topic.LedMatrix", "x": 1310, "y": 60, "wires": [ [] ] }, { "id": "MQTT.Localhost", "type": "mqtt-broker", "z": "", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "broker": "localhost", "port": "1883", "clientid": "", "usetls": false, "compatmode": true, "keepalive": "15", "cleansession": true, "willTopic": "", "willQos": "0", "willPayload": "", "birthTopic": "", "birthQos": "0", "birthPayload": "" }, { "id": "Topic.LedMatrix", "type": "queue-topic", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "topic": "LEDMatrix" }, { "id": "f292d9f4.3322c8", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "0", "name": "", "x": 560.2001800537109, "y": 266.19996643066406, "wires": [ [ "65d070ab.cb544", "5f968bc6.c1b404" ] ] }, { "id": "76de9b61.79fc84", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "1", "name": "", "x": 560.2000312805176, "y": 317.1999731063843, "wires": [ [ "a20b1e29.2892d", "760839a.4bdadc8" ] ] }, { "id": "55731506.04b82c", "type": "switch", "z": "14721ed9.1cdfd1", "name": "", "property": "temps", "propertyType": "msg", "rules": [ { "t": "gt", "v": "0", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "outputs": 2, "x": 423.89999771118164, "y": 274.1999683380127, "wires": [ [ "f292d9f4.3322c8" ], [ "76de9b61.79fc84" ] ] }, { "id": "65d070ab.cb544", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "37", "set": true, "level": "1", "out": "out", "x": 684.2000122070312, "y": 228.1999969482422, "wires": [] }, { "id": "a20b1e29.2892d", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "37", "set": true, "level": "1", "out": "out", "x": 690.2000122070312, "y": 320.1999816894531, "wires": [] }, { "id": "a3db9fd5.4981e", "type": "function", "z": "14721ed9.1cdfd1", "name": "Temps1", "func": "msg.temps = msg.temps1;\nreturn msg;\n\n\n", "outputs": "1", "noerr": 0, "x": 254.19996643066406, "y": 274.1999683380127, "wires": [ [ "55731506.04b82c" ] ] }, { "id": "248ca852.3a8de8", "type": "json", "z": "14721ed9.1cdfd1", "name": "", "x": 269.1999816894531, "y": 100.19999694824219, "wires": [ [ "84d3f41c.fe0748" ] ] }, { "id": "84d3f41c.fe0748", "type": "function", "z": "14721ed9.1cdfd1", "name": "Save inPayload", "func": "context.global.attente = false ;\nmsg.titre = msg.payload[0];\n//\nmsg.temps1 = msg.payload[1] ;\nmsg.temps2 = msg.payload[2] ;\nmsg.temps3 = msg.payload[3] ;\nmsg.temps4 = msg.payload[4] ;\nmsg.temps5 = msg.payload[5] ;\nmsg.temps6 = msg.payload[6] ;\n\nmsg.payload = msg.titre ;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 560, "y": 100, "wires": [ [ "a3db9fd5.4981e", "3ee29d34.a68832" ] ] }, { "id": "54816633.e25368", "type": "mqtt in", "z": "14721ed9.1cdfd1", "name": "", "topic": "cocktail", "qos": "2", "broker": "MQTT.Localhost", "x": 120.19998168945312, "y": 100.19999694824219, "wires": [ [ "248ca852.3a8de8", "d60b0418.316398" ] ] }, { "id": "c22f6923.c40838", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "0", "name": "", "x": 568.2000122070312, "y": 473.1999816894531, "wires": [ [ "c65c2c01.69dea", "2baaaf95.080d7" ] ] }, { "id": "cfa241ef.c9858", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "1", "name": "", "x": 568.1998634338379, "y": 524.1999883651733, "wires": [ [ "b3081be.98186e8", "b16c0626.84fcb8" ] ] }, { "id": "957e58ef.79c1c8", "type": "switch", "z": "14721ed9.1cdfd1", "name": "", "property": "temps", "propertyType": "msg", "rules": [ { "t": "gt", "v": "0", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "outputs": 2, "x": 431.89982986450195, "y": 481.19998359680176, "wires": [ [ "c22f6923.c40838" ], [ "cfa241ef.c9858" ] ] }, { "id": "c65c2c01.69dea", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "35", "set": true, "level": "1", "out": "out", "x": 692.1998443603516, "y": 435.20001220703125, "wires": [] }, { "id": "b3081be.98186e8", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "35", "set": true, "level": "1", "out": "out", "x": 698.1998443603516, "y": 527.1999969482422, "wires": [] }, { "id": "760839a.4bdadc8", "type": "function", "z": "14721ed9.1cdfd1", "name": "Temps2", "func": "msg.temps = msg.temps2;\nreturn msg;\n\n\n", "outputs": "1", "noerr": 0, "x": 262.1997985839844, "y": 486.2000141143799, "wires": [ [ "957e58ef.79c1c8" ] ] }, { "id": "d96e9c36.4e202", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "0", "name": "", "x": 579.0001983642578, "y": 667.7999877929688, "wires": [ [ "7eceef70.2c6da", "d84dd82f.91cde8" ] ] }, { "id": "d6b85bd1.f4e538", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "1", "name": "", "x": 579.0000495910645, "y": 718.799994468689, "wires": [ [ "15b802b7.9e15dd", "ffd112e7.ef01e" ] ] }, { "id": "af120e25.f4449", "type": "switch", "z": "14721ed9.1cdfd1", "name": "", "property": "temps", "propertyType": "msg", "rules": [ { "t": "gt", "v": "0", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "outputs": 2, "x": 442.7000160217285, "y": 675.7999897003174, "wires": [ [ "d96e9c36.4e202" ], [ "d6b85bd1.f4e538" ] ] }, { "id": "7eceef70.2c6da", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "33", "set": true, "level": "1", "out": "out", "x": 703.0000305175781, "y": 629.8000183105469, "wires": [] }, { "id": "15b802b7.9e15dd", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "33", "set": true, "level": "1", "out": "out", "x": 709.0000305175781, "y": 721.8000030517578, "wires": [] }, { "id": "b16c0626.84fcb8", "type": "function", "z": "14721ed9.1cdfd1", "name": "Temps3", "func": "msg.temps = msg.temps3;\nreturn msg;\n\n\n", "outputs": "1", "noerr": 0, "x": 272.99998474121094, "y": 675.7999897003174, "wires": [ [ "af120e25.f4449" ] ] }, { "id": "1858ecd1.c0cb13", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "0", "name": "", "x": 576.0001983642578, "y": 865.7999877929688, "wires": [ [ "37b6e91b.4d52c6", "ce235c49.f8ef2" ] ] }, { "id": "282e737b.99e65c", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "1", "name": "", "x": 576.0000495910645, "y": 916.799994468689, "wires": [ [ "51645717.abbf58", "6a04bcc2.55e9b4" ] ] }, { "id": "d82f8595.34a198", "type": "switch", "z": "14721ed9.1cdfd1", "name": "", "property": "temps", "propertyType": "msg", "rules": [ { "t": "gt", "v": "0", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "outputs": 2, "x": 439.7000160217285, "y": 873.7999897003174, "wires": [ [ "1858ecd1.c0cb13" ], [ "282e737b.99e65c" ] ] }, { "id": "37b6e91b.4d52c6", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "31", "set": true, "level": "1", "out": "out", "x": 700.0000305175781, "y": 827.8000183105469, "wires": [] }, { "id": "51645717.abbf58", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "31", "set": true, "level": "1", "out": "out", "x": 706.0000305175781, "y": 919.8000030517578, "wires": [] }, { "id": "ffd112e7.ef01e", "type": "function", "z": "14721ed9.1cdfd1", "name": "Temps4", "func": "msg.temps = msg.temps4;\nreturn msg;\n\n\n", "outputs": "1", "noerr": 0, "x": 269.99998474121094, "y": 873.7999897003174, "wires": [ [ "d82f8595.34a198" ] ] }, { "id": "c6b802e4.47c4e", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "0", "name": "", "x": 558.2000122070312, "y": 1052.5999755859375, "wires": [ [ "e85a33d7.f1906", "330c7e8b.d0b512" ] ] }, { "id": "b78f8ddf.8465c", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "1", "name": "", "x": 558.1998634338379, "y": 1103.5999822616577, "wires": [ [ "13e86aee.5b1da5", "c5e8dbbf.a7e7b8" ] ] }, { "id": "712ddef6.c6dfd", "type": "switch", "z": "14721ed9.1cdfd1", "name": "", "property": "temps", "propertyType": "msg", "rules": [ { "t": "gt", "v": "0", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "outputs": 2, "x": 421.89982986450195, "y": 1060.5999774932861, "wires": [ [ "c6b802e4.47c4e" ], [ "b78f8ddf.8465c" ] ] }, { "id": "e85a33d7.f1906", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "29", "set": true, "level": "1", "out": "out", "x": 682.1998443603516, "y": 1014.6000061035156, "wires": [] }, { "id": "13e86aee.5b1da5", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "29", "set": true, "level": "1", "out": "out", "x": 688.1998443603516, "y": 1106.5999908447266, "wires": [] }, { "id": "6a04bcc2.55e9b4", "type": "function", "z": "14721ed9.1cdfd1", "name": "Temps5", "func": "msg.temps = msg.temps5;\nreturn msg;\n\n\n", "outputs": "1", "noerr": 0, "x": 252.19979858398438, "y": 1060.5999774932861, "wires": [ [ "712ddef6.c6dfd" ] ] }, { "id": "806789c.cc88d78", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "0", "name": "", "x": 568.2000122070312, "y": 1260.199951171875, "wires": [ [ "834180a.fa8358", "f5734923.2fd3d8" ] ] }, { "id": "ce813f.37954ec", "type": "set", "z": "14721ed9.1cdfd1", "property": "payload", "value": "1", "name": "", "x": 568.1998634338379, "y": 1311.1999578475952, "wires": [ [ "55a17e9c.a711c", "3c6cbf42.a856a" ] ] }, { "id": "f01e5005.6589a", "type": "switch", "z": "14721ed9.1cdfd1", "name": "", "property": "temps", "propertyType": "msg", "rules": [ { "t": "gt", "v": "0", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "outputs": 2, "x": 431.89982986450195, "y": 1268.1999530792236, "wires": [ [ "806789c.cc88d78" ], [ "ce813f.37954ec" ] ] }, { "id": "834180a.fa8358", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "40", "set": true, "level": "1", "out": "out", "x": 692.1998443603516, "y": 1222.1999816894531, "wires": [] }, { "id": "55a17e9c.a711c", "type": "rpi-gpio out", "z": "14721ed9.1cdfd1", "name": "", "pin": "40", "set": true, "level": "1", "out": "out", "x": 698.1998443603516, "y": 1314.199966430664, "wires": [] }, { "id": "c5e8dbbf.a7e7b8", "type": "function", "z": "14721ed9.1cdfd1", "name": "Temps6", "func": "msg.temps = msg.temps6;\nreturn msg;\n\n\n", "outputs": "1", "noerr": 0, "x": 262.1997985839844, "y": 1268.1999530792236, "wires": [ [ "f01e5005.6589a" ] ] }, { "id": "5f968bc6.c1b404", "type": "function", "z": "14721ed9.1cdfd1", "name": "Wait temps universel", "func": "var start = new Date().getTime();\n for(var i=0;i<1e7;i++){\n if ((new Date().getTime() - start)> (context.global.temps_universel)){\n break;\n }\n }\n msg.temps = msg.temps -1;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 498.2000045776367, "y": 215.19998359680176, "wires": [ [ "55731506.04b82c" ] ] }, { "id": "2baaaf95.080d7", "type": "function", "z": "14721ed9.1cdfd1", "name": "Wait temps universel", "func": "var start = new Date().getTime();\n for(var i=0;i<1e7;i++){\n if ((new Date().getTime() - start)> (context.global.temps_universel)){\n break;\n }\n }\n msg.temps = msg.temps -1;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 502.2000503540039, "y": 425.1999969482422, "wires": [ [ "957e58ef.79c1c8" ] ] }, { "id": "d84dd82f.91cde8", "type": "function", "z": "14721ed9.1cdfd1", "name": "Wait temps universel", "func": "var start = new Date().getTime();\n for(var i=0;i<1e7;i++){\n if ((new Date().getTime() - start)> (context.global.temps_universel)){\n break;\n }\n }\n msg.temps = msg.temps -1;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 504.1999816894531, "y": 624.2000122070312, "wires": [ [ "af120e25.f4449" ] ] }, { "id": "ce235c49.f8ef2", "type": "function", "z": "14721ed9.1cdfd1", "name": "Wait temps universel", "func": "var start = new Date().getTime();\n for(var i=0;i<1e7;i++){\n if ((new Date().getTime() - start)> (context.global.temps_universel)){\n break;\n }\n }\n msg.temps = msg.temps -1;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 501.1999816894531, "y": 816.2000122070312, "wires": [ [ "d82f8595.34a198" ] ] }, { "id": "330c7e8b.d0b512", "type": "function", "z": "14721ed9.1cdfd1", "name": "Wait temps universel", "func": "var start = new Date().getTime();\n for(var i=0;i<1e7;i++){\n if ((new Date().getTime() - start)> (context.global.temps_universel)){\n break;\n }\n }\n msg.temps = msg.temps -1;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 488.1999816894531, "y": 1009.2000122070312, "wires": [ [ "712ddef6.c6dfd" ] ] }, { "id": "f5734923.2fd3d8", "type": "function", "z": "14721ed9.1cdfd1", "name": "Wait temps universel", "func": "var start = new Date().getTime();\n for(var i=0;i<1e7;i++){\n if ((new Date().getTime() - start)> (context.global.temps_universel)){\n break;\n }\n }\n msg.temps = msg.temps -1;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 508.1999816894531, "y": 1216.199951171875, "wires": [ [ "f01e5005.6589a" ] ] }, { "id": "3c26eb3f.02c3d4", "type": "mqtt out", "z": "14721ed9.1cdfd1", "name": "", "topic": "Affichage-attente", "qos": "", "retain": "", "broker": "MQTT.Localhost", "x": 1010, "y": 1380, "wires": [] }, { "id": "ea75dfeb.3662c", "type": "function", "z": "14721ed9.1cdfd1", "name": "", "func": "context.global.attente = true;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 830, "y": 1380, "wires": [ [ "3c26eb3f.02c3d4" ] ] }, { "id": "3c6cbf42.a856a", "type": "delay", "z": "14721ed9.1cdfd1", "name": "", "pauseType": "delay", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 700, "y": 1380, "wires": [ [ "ea75dfeb.3662c" ] ] }, { "id": "d60b0418.316398", "type": "ledblank", "z": "14721ed9.1cdfd1", "name": "", "x": 280, "y": 60, "wires": [ [ "75f2563e.c7e758" ] ] }, { "id": "75f2563e.c7e758", "type": "ledmatrix", "z": "14721ed9.1cdfd1", "speed": 50, "time": 500, "name": "", "x": 420, "y": 60, "wires": [] }, { "id": "3ee29d34.a68832", "type": "subflow:LED.text", "z": "14721ed9.1cdfd1", "x": 780, "y": 100, "wires": [] }, { "id": "f5bc80f.244018", "type": "delay", "z": "14721ed9.1cdfd1", "name": "", "pauseType": "delay", "timeout": "100", "timeoutUnits": "milliseconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 782, "y": 49, "wires": [ [] ] }, { "id": "MQTT.Localhost", "type": "mqtt-broker", "z": "", "origin": "/root/thethingbox/node_modules/node-red/flow/flows.json", "broker": "localhost", "port": "1883", "clientid": "", "usetls": false, "compatmode": true, "keepalive": "15", "cleansession": true, "willTopic": "", "willQos": "0", "willPayload": "", "birthTopic": "", "birthQos": "0", "birthPayload": "" } ]