[
{
"id": "e9c07e91.ff59f8",
"type": "ui_slider",
"z": "a1a3302e.b623e",
"name": "",
"label": "Llum a la LDR",
"group": "31e276ab.8133e2",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "",
"min": 0,
"max": "1024",
"step": 1,
"x": 400,
"y": 80,
"wires": [
[
"22586af9.3ea806"
]
]
},
{
"id": "4713add0.03d32c",
"type": "udp in",
"z": "a1a3302e.b623e",
"name": "",
"iface": "",
"port": "3344",
"ipv": "udp4",
"multicast": "false",
"group": "",
"datatype": "utf8",
"x": 100,
"y": 560,
"wires": [
[
"30e8a81e.2306f8",
"a1fe930f.75ad"
]
]
},
{
"id": "22586af9.3ea806",
"type": "function",
"z": "a1a3302e.b623e",
"name": "set LDR value",
"func": "flow.set(\"LDR\",msg.payload);\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 620,
"y": 80,
"wires": [
[]
]
},
{
"id": "711a184f.3448b",
"type": "inject",
"z": "a1a3302e.b623e",
"name": "",
"topic": "",
"payload": "654",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"x": 130,
"y": 80,
"wires": [
[
"e9c07e91.ff59f8"
]
]
},
{
"id": "30e8a81e.2306f8",
"type": "switch",
"z": "a1a3302e.b623e",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "a",
"vt": "str"
},
{
"t": "eq",
"v": "A",
"vt": "str"
},
{
"t": "eq",
"v": "i",
"vt": "str"
},
{
"t": "eq",
"v": "I",
"vt": "str"
},
{
"t": "eq",
"v": "15h",
"vt": "str"
},
{
"t": "eq",
"v": "15H",
"vt": "str"
},
{
"t": "eq",
"v": "15l",
"vt": "str"
},
{
"t": "eq",
"v": "15L",
"vt": "str"
},
{
"t": "eq",
"v": "12h",
"vt": "str"
},
{
"t": "eq",
"v": "12H",
"vt": "str"
},
{
"t": "eq",
"v": "12l",
"vt": "str"
},
{
"t": "eq",
"v": "12L",
"vt": "str"
},
{
"t": "eq",
"v": "13h",
"vt": "str"
},
{
"t": "eq",
"v": "13H",
"vt": "str"
},
{
"t": "eq",
"v": "13l",
"vt": "str"
},
{
"t": "eq",
"v": "13L",
"vt": "str"
},
{
"t": "eq",
"v": "2H",
"vt": "str"
},
{
"t": "eq",
"v": "2h",
"vt": "str"
},
{
"t": "eq",
"v": "2L",
"vt": "str"
},
{
"t": "eq",
"v": "2l",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 21,
"x": 250,
"y": 560,
"wires": [
[
"3170fdde.2eea32"
],
[
"3170fdde.2eea32"
],
[
"88718f75.97206"
],
[
"88718f75.97206"
],
[
"4373c80c.d464b"
],
[
"4373c80c.d464b"
],
[
"35a461d5.8cc3be"
],
[
"35a461d5.8cc3be"
],
[
"96d83db1.23d628"
],
[
"96d83db1.23d628"
],
[
"329efcb6.570c04"
],
[
"329efcb6.570c04"
],
[
"b9cc3b45.8156d"
],
[
"b9cc3b45.8156d"
],
[
"28aee8f9.21d258"
],
[
"28aee8f9.21d258"
],
[
"89c17623.8d224"
],
[
"89c17623.8d224"
],
[
"63148dc1.4a8994"
],
[
"63148dc1.4a8994"
],
[
"843a085f.4145d8"
]
]
},
{
"id": "3170fdde.2eea32",
"type": "function",
"z": "a1a3302e.b623e",
"name": "get LDR value",
"func": "msg.payload = flow.get(\"LDR\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 440,
"y": 360,
"wires": [
[
"b8eab0ed.7ebb18"
]
]
},
{
"id": "66a05c8.51c4624",
"type": "udp out",
"z": "a1a3302e.b623e",
"name": "",
"addr": "127.0.0.1",
"iface": "",
"port": "3345",
"ipv": "udp4",
"outport": "",
"base64": false,
"multicast": "false",
"x": 960,
"y": 580,
"wires": []
},
{
"id": "2fc611e9.4d1a96",
"type": "ui_switch",
"z": "a1a3302e.b623e",
"name": "",
"label": "GPIO4",
"group": "31e276ab.8133e2",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "L",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "H",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"x": 390,
"y": 140,
"wires": [
[
"97398b37.720f2"
]
]
},
{
"id": "97398b37.720f2",
"type": "function",
"z": "a1a3302e.b623e",
"name": "set GPIO4 value",
"func": "flow.set(\"GPIO4\",msg.payload);\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 630,
"y": 140,
"wires": [
[]
]
},
{
"id": "34105daf.1ce68a",
"type": "inject",
"z": "a1a3302e.b623e",
"name": "",
"topic": "",
"payload": "H",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"x": 130,
"y": 140,
"wires": [
[
"2fc611e9.4d1a96"
]
]
},
{
"id": "88718f75.97206",
"type": "function",
"z": "a1a3302e.b623e",
"name": "get GPIO4 value",
"func": "msg.payload = flow.get(\"GPIO4\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 450,
"y": 400,
"wires": [
[
"b8eab0ed.7ebb18"
]
]
},
{
"id": "5e17023e.a7190c",
"type": "ui_text",
"z": "a1a3302e.b623e",
"group": "31e276ab.8133e2",
"order": 0,
"width": 0,
"height": 0,
"name": "",
"label": "Led tricolor",
"format": "",
"layout": "row-spread",
"x": 750,
"y": 500,
"wires": []
},
{
"id": "c53a8d2f.ba28f",
"type": "function",
"z": "a1a3302e.b623e",
"name": "FF3399",
"func": "msg.color = \"#FF3399\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 440,
"y": 320,
"wires": [
[
"5e17023e.a7190c"
]
]
},
{
"id": "2e099591.26e342",
"type": "inject",
"z": "a1a3302e.b623e",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 180,
"y": 320,
"wires": [
[
"c53a8d2f.ba28f"
]
]
},
{
"id": "9aa4df3a.fa11c",
"type": "inject",
"z": "a1a3302e.b623e",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"x": 150,
"y": 180,
"wires": [
[
"ef2ffb67.8e26b8",
"3646f39e.b1fe44"
]
]
},
{
"id": "ef2ffb67.8e26b8",
"type": "function",
"z": "a1a3302e.b623e",
"name": "{R,G,B} -> {0,0,0}",
"func": "flow.set(\"R\",\"00\");\nflow.set(\"G\",\"00\");\nflow.set(\"B\",\"00\");\nflow.set(\"RGB\",\"#\"+flow.get(\"R\")+flow.get(\"G\")+flow.get(\"B\"));\nmsg.color = flow.get(\"RGB\");\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 630,
"y": 180,
"wires": [
[
"5e17023e.a7190c"
]
]
},
{
"id": "4373c80c.d464b",
"type": "function",
"z": "a1a3302e.b623e",
"name": "R -> FF",
"func": "flow.set(\"R\",\"FF\");\nflow.set(\"RGB\",\"#\"+flow.get(\"R\")+flow.get(\"G\")+flow.get(\"B\"));\nmsg.color = flow.get(\"RGB\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 440,
"wires": [
[
"5e17023e.a7190c",
"a681f913.5cdc6"
]
]
},
{
"id": "35a461d5.8cc3be",
"type": "function",
"z": "a1a3302e.b623e",
"name": "R -> 00",
"func": "flow.set(\"R\",\"00\");\nflow.set(\"RGB\",\"#\"+flow.get(\"R\")+flow.get(\"G\")+flow.get(\"B\"));\nmsg.color = flow.get(\"RGB\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 480,
"wires": [
[
"5e17023e.a7190c",
"a681f913.5cdc6"
]
]
},
{
"id": "96d83db1.23d628",
"type": "function",
"z": "a1a3302e.b623e",
"name": "G -> FF",
"func": "flow.set(\"G\",\"FF\");\nflow.set(\"RGB\",\"#\"+flow.get(\"R\")+flow.get(\"G\")+flow.get(\"B\"));\nmsg.color = flow.get(\"RGB\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 520,
"wires": [
[
"5e17023e.a7190c",
"a681f913.5cdc6"
]
]
},
{
"id": "329efcb6.570c04",
"type": "function",
"z": "a1a3302e.b623e",
"name": "G -> 00",
"func": "flow.set(\"G\",\"00\");\nflow.set(\"RGB\",\"#\"+flow.get(\"R\")+flow.get(\"G\")+flow.get(\"B\"));\nmsg.color = flow.get(\"RGB\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 560,
"wires": [
[
"5e17023e.a7190c",
"a681f913.5cdc6"
]
]
},
{
"id": "b9cc3b45.8156d",
"type": "function",
"z": "a1a3302e.b623e",
"name": "B -> FF",
"func": "flow.set(\"B\",\"FF\");\nflow.set(\"RGB\",\"#\"+flow.get(\"R\")+flow.get(\"G\")+flow.get(\"B\"));\nmsg.color = flow.get(\"RGB\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 600,
"wires": [
[
"5e17023e.a7190c",
"a681f913.5cdc6"
]
]
},
{
"id": "28aee8f9.21d258",
"type": "function",
"z": "a1a3302e.b623e",
"name": "B -> 00",
"func": "flow.set(\"B\",\"00\");\nflow.set(\"RGB\",\"#\"+flow.get(\"R\")+flow.get(\"G\")+flow.get(\"B\"));\nmsg.color = flow.get(\"RGB\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 640,
"wires": [
[
"5e17023e.a7190c",
"a681f913.5cdc6"
]
]
},
{
"id": "249051cb.faa94e",
"type": "ui_text",
"z": "a1a3302e.b623e",
"group": "31e276ab.8133e2",
"order": 0,
"width": 0,
"height": 0,
"name": "",
"label": "Led petit",
"format": "",
"layout": "row-spread",
"x": 740,
"y": 660,
"wires": []
},
{
"id": "63148dc1.4a8994",
"type": "function",
"z": "a1a3302e.b623e",
"name": "led petit encès",
"func": "flow.set(\"ledPetit\",\"#0000FF\");\nmsg.color = flow.get(\"ledPetit\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 440,
"y": 720,
"wires": [
[
"249051cb.faa94e",
"a681f913.5cdc6"
]
]
},
{
"id": "89c17623.8d224",
"type": "function",
"z": "a1a3302e.b623e",
"name": "led petit apagat",
"func": "flow.set(\"ledPetit\",\"#000000\");\nmsg.color = flow.get(\"ledPetit\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 440,
"y": 680,
"wires": [
[
"249051cb.faa94e",
"a681f913.5cdc6"
]
]
},
{
"id": "3646f39e.b1fe44",
"type": "function",
"z": "a1a3302e.b623e",
"name": "led petit encès",
"func": "flow.set(\"ledPetit\",\"#0000FF\");\nmsg.color = flow.get(\"ledPetit\");\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 620,
"y": 220,
"wires": [
[
"249051cb.faa94e"
]
]
},
{
"id": "a1fe930f.75ad",
"type": "ui_text",
"z": "a1a3302e.b623e",
"group": "31e276ab.8133e2",
"order": 0,
"width": 0,
"height": 0,
"name": "",
"label": "Darrera petició rebuda",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 180,
"y": 360,
"wires": []
},
{
"id": "a681f913.5cdc6",
"type": "function",
"z": "a1a3302e.b623e",
"name": "OK",
"func": "msg.payload = \"OK\";\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 730,
"y": 580,
"wires": [
[
"b8eab0ed.7ebb18"
]
]
},
{
"id": "843a085f.4145d8",
"type": "function",
"z": "a1a3302e.b623e",
"name": "I don't understand this command",
"func": "msg.payload = msg.payload + \" ?\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 500,
"y": 760,
"wires": [
[
"b8eab0ed.7ebb18"
]
]
},
{
"id": "b8eab0ed.7ebb18",
"type": "function",
"z": "a1a3302e.b623e",
"name": "Presenta i esborra als 3 segons",
"func": "var msg1 = {payload: msg.payload, delay: 0};\nvar msg2 = {payload: \"\", delay: 3000};\n\nreturn [ [ msg1, msg2 ] ];\n\n",
"outputs": 1,
"noerr": 0,
"x": 910,
"y": 440,
"wires": [
[
"dc110615.6c9d88"
]
]
},
{
"id": "dc110615.6c9d88",
"type": "delay",
"z": "a1a3302e.b623e",
"name": "",
"pauseType": "delayv",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 940,
"y": 520,
"wires": [
[
"66a05c8.51c4624"
]
]
},
{
"id": "31e276ab.8133e2",
"type": "ui_group",
"z": "",
"name": "Simulador",
"tab": "e08ba1f6.8f902",
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "e08ba1f6.8f902",
"type": "ui_tab",
"z": "",
"name": "simulador UDP",
"icon": "dashboard",
"order": 1
}
]