Hello
I would like to control a WLED via an ESP8266 with a color picker.
Unfortunately I can't get any further, a string comes out of the color picker.
I shortened it to the bare essentials and added the 4th digit.
But I need an array in this format.
How do I get there. Can someone help me with this????
translated with googlel
[
{
"id": "9ab0ef5f789c0c44",
"type": "http request",
"z": "363f2541d69f348e",
"name": "POST to WLED",
"method": "POST",
"ret": "obj",
"paytoqs": "query",
"url": "http://192.168.1.85/json/state",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 1220,
"y": 1880,
"wires": [
[]
]
},
{
"id": "56adea9a670c5309",
"type": "function",
"z": "363f2541d69f348e",
"name": "on: Farbe",
"func": "var bri = flow.get(\"bri\")\nvar color = flow.get(\"colorDinett\")\n\n\n\nmsg.payload = {\n \"on\":true,\n \"bri\": bri ,\n \"seg\": [{\n \"start\": 0,\n \"stop\": 150,\n \"len\": 150,\n \"col\": color,\n \"fx\": 0,\n \"sx\": 127,\n \"ix\": 255,\n \"pal\": 0,\n \"sel\": true,\n \"rev\": false,\n \"cln\": -1\n }]\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 1880,
"wires": [
[
"71a44fd542c86c70",
"9ab0ef5f789c0c44"
]
]
},
{
"id": "5cf8a3668641ba76",
"type": "ui_colour_picker",
"z": "363f2541d69f348e",
"name": "Farbe Dinett",
"label": "Farbe Dinett",
"group": "b8db3199.f0dbe",
"format": "rgb",
"outformat": "string",
"showSwatch": true,
"showPicker": false,
"showValue": false,
"showHue": false,
"showAlpha": false,
"showLightness": true,
"square": "false",
"dynOutput": "false",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"topic": "topic",
"topicType": "msg",
"className": "",
"x": 250,
"y": 1840,
"wires": [
[
"a27dba35f49416cc",
"b5d0d0d7836ad245"
]
]
},
{
"id": "7f11720b8b5e6e11",
"type": "debug",
"z": "363f2541d69f348e",
"name": "Farbe",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 950,
"y": 1840,
"wires": []
},
{
"id": "a27dba35f49416cc",
"type": "change",
"z": "363f2541d69f348e",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "rgb",
"fromt": "str",
"to": "",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "(",
"fromt": "str",
"to": "",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": ")",
"fromt": "str",
"to": ",0",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "\"",
"fromt": "str",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 450,
"y": 1840,
"wires": [
[
"ca23b5eea0058ea4",
"56adea9a670c5309",
"7f11720b8b5e6e11",
"f948ed40288da3b0"
]
]
},
{
"id": "46a4fa682f27a190",
"type": "ui_slider",
"z": "363f2541d69f348e",
"name": "",
"label": "Helligkeit Dinett",
"tooltip": "",
"group": "b8db3199.f0dbe",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"outs": "all",
"topic": "topic",
"topicType": "msg",
"min": "10",
"max": "255",
"step": "10",
"className": "",
"x": 260,
"y": 1880,
"wires": [
[
"7b543a51a49d3b75"
]
]
},
{
"id": "71a44fd542c86c70",
"type": "debug",
"z": "363f2541d69f348e",
"name": "Farbe",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 830,
"y": 1880,
"wires": []
},
{
"id": "7b543a51a49d3b75",
"type": "function",
"z": "363f2541d69f348e",
"name": "Dimmer",
"func": "var bri = msg.paylod\nflow.set(\"bri\",msg.payload)\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 1880,
"wires": [
[
"56adea9a670c5309"
]
]
},
{
"id": "ca23b5eea0058ea4",
"type": "function",
"z": "363f2541d69f348e",
"name": "Farbe",
"func": "var color = msg.paylod\nflow.set(\"colorDinett\",msg.payload)\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 730,
"y": 1800,
"wires": [
[]
]
},
{
"id": "f948ed40288da3b0",
"type": "split",
"z": "363f2541d69f348e",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": "4",
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 730,
"y": 2000,
"wires": [
[
"907e6a782b533bdd"
]
]
},
{
"id": "907e6a782b533bdd",
"type": "debug",
"z": "363f2541d69f348e",
"name": "Farbe",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 890,
"y": 2000,
"wires": []
},
{
"id": "b5d0d0d7836ad245",
"type": "debug",
"z": "363f2541d69f348e",
"name": "Farbe",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 470,
"y": 1780,
"wires": []
},
{
"id": "b8db3199.f0dbe",
"type": "ui_group",
"name": "Info",
"tab": "c77f413b.09f91",
"order": 3,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "c77f413b.09f91",
"type": "ui_tab",
"name": "Info",
"icon": "mi-info",
"order": 1,
"disabled": false,
"hidden": false
}
]