Skip to main content

store value in flow

[
{
"id": "23f23ed.59af2c2",
"type": "switch",
"z": "d2b0b2fb.dc997",
"name": "",
"property": "parts.index",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "num"
},
{
"t": "eq",
"v": "1",
"vt": "num"
},
{
"t": "eq",
"v": "2",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 230,
"y": 2000,
"wires": [
[
"bab8eaf9.c7ecb8"
],
[
"7ec554e9.187e5c"
],
[
"d727cfe3.03715"
]
]
},
{
"id": "6679d831.0dfa28",
"type": "split",
"z": "d2b0b2fb.dc997",
"name": "",
"splt": ",",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 230,
"y": 1900,
"wires": [
[
"23f23ed.59af2c2"
]
]
},
{
"id": "bab8eaf9.c7ecb8",
"type": "function",
"z": "d2b0b2fb.dc997",
"name": "",
"func": "flow.set(\"0\",msg.payload);",
"outputs": 1,
"noerr": 0,
"x": 370,
"y": 1960,
"wires": [
[
"7678f26e.4d3d0c"
]
]
},
{
"id": "7ec554e9.187e5c",
"type": "function",
"z": "d2b0b2fb.dc997",
"name": "",
"func": "flow.set(\"1\",msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 370,
"y": 2000,
"wires": [
[
"7678f26e.4d3d0c"
]
]
},
{
"id": "d727cfe3.03715",
"type": "function",
"z": "d2b0b2fb.dc997",
"name": "",
"func": "flow.set(\"2\",msg.payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 370,
"y": 2040,
"wires": [
[
"7678f26e.4d3d0c"
]
]
},
{
"id": "7678f26e.4d3d0c",
"type": "function",
"z": "d2b0b2fb.dc997",
"name": "",
"func": "var R = flow.get(\"0\")\n\nvar G = flow.get(\"1\")\n\nvar B = flow.get(\"2\")\n\nmsg.payload ={\n\n \"rgb\": [R,G,B]\n\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 630,
"y": 2000,
"wires": [
[]
]
}
]