[ { "id": "229bab05.fcf184", "type": "mqtt out", "z": "28d9a852.edd1e", "name": "", "topic": "/jordiB/esp8266/ordres/leds", "qos": "", "retain": "", "broker": "c4feadd4.96b9f8", "x": 500, "y": 500, "wires": [] }, { "id": "f4ea19a4.8c49c8", "type": "ui_switch", "z": "28d9a852.edd1e", "name": "", "label": "Led R", "group": "bd4f6450.72fca", "order": 1, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "style": "", "onvalue": "15H", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "15L", "offvalueType": "str", "officon": "", "offcolor": "", "x": 90, "y": 440, "wires": [ [ "229bab05.fcf184" ] ] }, { "id": "4ad9e740.fa073", "type": "ui_switch", "z": "28d9a852.edd1e", "name": "", "label": "Led B", "group": "bd4f6450.72fca", "order": 3, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "style": "", "onvalue": "12H", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "12L", "offvalueType": "str", "officon": "", "offcolor": "", "x": 90, "y": 520, "wires": [ [ "229bab05.fcf184" ] ] }, { "id": "77d9ea58.934b84", "type": "ui_switch", "z": "28d9a852.edd1e", "name": "", "label": "Led G", "group": "bd4f6450.72fca", "order": 2, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "style": "", "onvalue": "13H", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "13L", "offvalueType": "str", "officon": "", "offcolor": "", "x": 90, "y": 480, "wires": [ [ "229bab05.fcf184" ] ] }, { "id": "d1065082.4d0f5", "type": "ui_switch", "z": "28d9a852.edd1e", "name": "", "label": "Led b", "group": "bd4f6450.72fca", "order": 4, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "", "style": "", "onvalue": "2L", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "2H", "offvalueType": "str", "officon": "", "offcolor": "", "x": 90, "y": 560, "wires": [ [ "229bab05.fcf184" ] ] }, { "id": "16fe58ae.1d9b67", "type": "mqtt out", "z": "28d9a852.edd1e", "name": "", "topic": "/jordiB/esp8266/ordres", "qos": "", "retain": "", "broker": "c4feadd4.96b9f8", "x": 510, "y": 560, "wires": [] }, { "id": "e364e945.239b6", "type": "debug", "z": "28d9a852.edd1e", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 590, "y": 720, "wires": [] }, { "id": "3d0acb82.4c812c", "type": "function", "z": "28d9a852.edd1e", "name": "Retard dinàmic", "func": "// msg.delay is in milliseconds\nvar msg1 = { payload:\"first out of output 1\", delay:10000 };\n// if msg.delay is undefined, the delay node uses default\nvar msg2 = { payload:\"second out of output 1\" };\nvar msg3 = { payload:\"third out of output 1\", delay:0};\nvar msg4 = { payload:\"only message from output 2\"};\nreturn [ [ msg1, msg2, msg3 ], msg4 ];", "outputs": 2, "noerr": 0, "x": 280, "y": 760, "wires": [ [ "431b6f19.998db" ], [ "eb3c5a6f.9e196" ] ] }, { "id": "bd1f8910.605e48", "type": "inject", "z": "28d9a852.edd1e", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 120, "y": 760, "wires": [ [ "3d0acb82.4c812c" ] ] }, { "id": "431b6f19.998db", "type": "delay", "z": "28d9a852.edd1e", "name": "", "pauseType": "delayv", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 460, "y": 720, "wires": [ [ "e364e945.239b6" ] ] }, { "id": "3ff31895.206e1", "type": "ui_switch", "z": "28d9a852.edd1e", "name": "", "label": "Automàtic", "group": "bd4f6450.72fca", "order": 8, "width": 0, "height": 0, "passthru": false, "decouple": "false", "topic": "", "style": "", "onvalue": "1", "onvalueType": "num", "onicon": "", "oncolor": "", "offvalue": "0", "offvalueType": "num", "officon": "", "offcolor": "", "x": 100, "y": 680, "wires": [ [ "c4c62469.b7625" ] ] }, { "id": "d1870c3.e7ae3f", "type": "function", "z": "28d9a852.edd1e", "name": "Automàtic", "func": "if(flow.get(\"enMarxa\") == \"ON\"){\n var msg1 = { payload:\"A\", delay: parseInt(flow.get(\"varText\"))};\n return msg1;\n}\n\n", "outputs": 1, "noerr": 0, "x": 290, "y": 620, "wires": [ [ "e773e3cc.a8221" ] ] }, { "id": "e773e3cc.a8221", "type": "delay", "z": "28d9a852.edd1e", "name": "", "pauseType": "delayv", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 300, "y": 560, "wires": [ [ "16fe58ae.1d9b67", "d1870c3.e7ae3f" ] ] }, { "id": "c4c62469.b7625", "type": "function", "z": "28d9a852.edd1e", "name": "enMarxa", "func": "if(msg.payload == 1)\n flow.set(\"enMarxa\",\"ON\");\n \nif(msg.payload == 0)\n flow.set(\"enMarxa\",\"OFF\");\n \nreturn msg;", "outputs": 1, "noerr": 0, "x": 100, "y": 620, "wires": [ [ "d1870c3.e7ae3f" ] ] }, { "id": "eb3c5a6f.9e196", "type": "debug", "z": "28d9a852.edd1e", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 450, "y": 800, "wires": [] }, { "id": "c4feadd4.96b9f8", "type": "mqtt-broker", "z": "", "name": "", "broker": "broker.hivemq.com", "port": "1883", "clientid": "", "usetls": false, "compatmode": true, "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "closeTopic": "", "closePayload": "", "willTopic": "", "willQos": "0", "willPayload": "" }, { "id": "bd4f6450.72fca", "type": "ui_group", "z": "", "name": "Grup DAM", "tab": "4a4ecb37.77f27c", "disp": true, "width": "6", "collapse": false }, { "id": "4a4ecb37.77f27c", "type": "ui_tab", "z": "", "name": "Aula 506", "icon": "dashboard", "order": 1 } ]