[
{
"id": "d4752b13.24a73",
"type": "homeeDevice",
"z": "acb00e70.85a73",
"virtual-homee": "",
"name": "WLED",
"nodeId": "1088",
"showNodeId": true,
"profile": "1002",
"icon": "default",
"attributes": [
{
"instance": 0,
"minimum": 0,
"maximum": 1,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"unit": "",
"step_value": 1,
"editable": 1,
"type": 1,
"state": 1,
"last_changed": 1643013877,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "",
"name": "",
"options": {
"can_observe": [
300
],
"automations": [
"toggle"
],
"history": {
"day": 35,
"week": 5,
"month": 1,
"stepped": true
}
},
"id": "2867",
"node_id": "1088"
},
{
"instance": 0,
"minimum": 0,
"maximum": 100,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"unit": "%25",
"step_value": 1,
"editable": 1,
"type": 2,
"state": 1,
"last_changed": 1643013877,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "",
"name": "",
"options": {
"automations": [
"step",
"fade"
]
},
"id": "2868",
"node_id": "1088"
},
{
"instance": 1,
"minimum": 0,
"maximum": 117,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"unit": "text",
"step_value": 1,
"editable": 1,
"type": 2,
"state": 1,
"last_changed": 1642055230,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "Effects",
"name": "",
"id": "2869",
"node_id": "1088"
},
{
"type": 2,
"state": 1,
"instance": 2,
"minimum": 0,
"maximum": 100,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"data": "",
"name": "",
"unit": "",
"step_value": 1,
"editable": 1,
"last_changed": 1643474847,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"options": [],
"id": "2870",
"node_id": "1088"
},
{
"type": 2,
"state": 1,
"instance": 3,
"minimum": 0,
"maximum": 100,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"data": "",
"name": "",
"unit": "%25",
"step_value": 1,
"editable": 1,
"last_changed": 1643476092,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"options": [],
"id": "2871",
"node_id": "1088"
},
{
"instance": 0,
"minimum": 0,
"maximum": 16777215,
"current_value": 16456644,
"target_value": 16456644,
"last_value": 16456644,
"unit": "",
"step_value": 1,
"editable": 1,
"type": 23,
"state": 1,
"last_changed": 1642940941,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "7001020%3B16419669%3B12026363%3B16573766",
"name": "",
"id": "2873",
"node_id": "1088"
},
{
"instance": 0,
"minimum": 1,
"maximum": 3,
"current_value": 1,
"target_value": 1,
"last_value": 1,
"unit": "",
"step_value": 1,
"editable": 1,
"type": 124,
"state": 1,
"last_changed": 1642940941,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "",
"name": "",
"id": "2874",
"node_id": "1088"
}
],
"statusTemplate": "",
"x": 190,
"y": 420,
"wires": [
[
"8a82d8f1.7c96f",
"d595d727.a90ae",
"2d39be1a.dbb4ea"
]
]
},
{
"id": "8a82d8f1.7c96f",
"type": "switch",
"z": "acb00e70.85a73",
"name": "",
"property": "payload.attributeId",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "2869",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 390,
"y": 480,
"wires": [
[
"cb244106.0c02f"
]
]
},
{
"id": "cb244106.0c02f",
"type": "function",
"z": "acb00e70.85a73",
"name": "",
"func": "\nreturn {\n payload:{\n \"seg\":[{\n \"id\":0,\n \"fx\":msg.payload.targetValue\n \n },{\n \"id\":1,\n \"fx\":msg.payload.targetValue\n \n },{\n \"id\":2,\n \"fx\":msg.payload.targetValue\n \n }]\n \n }\n \n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 520,
"y": 480,
"wires": [
[
"af6e754e.47c77"
]
]
},
{
"id": "d6d2d998.0097c8",
"type": "json",
"z": "acb00e70.85a73",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 550,
"y": 660,
"wires": [
[
"26b8a8f9.e42bc8"
]
]
},
{
"id": "26b8a8f9.e42bc8",
"type": "function",
"z": "acb00e70.85a73",
"name": "",
"func": "var effects =[\n \"Solid\",\n \"Blink\",\n \"Breathe\",\n \"Wipe\",\n \"Wipe Random\",\n \"Random Colors\",\n \"Sweep\",\n \"Dynamic\",\n \"Colorloop\",\n \"Rainbow\",\n \"Scan\",\n \"Dual Scan\",\n \"Fade\",\n \"Theater\",\n \"Theater Rainbow\",\n \"Running\",\n \"Saw\",\n \"Twinkle\",\n \"Dissolve\",\n \"Dissolve Rnd\",\n \n \"Sparkle\",\n \"Dark Sparkle\",\n \"Sparkle+\",\n \"Strobe\",\n \"Strobe Rainbow\",\n \"Mega Strobe\",\n \"Blink Rainbow\",\n \"Android\",\n \"Chase\",\n \"Chase Random\",\n \n \"Chase Rainbow\",\n \"Chase Flash\",\n \"Chase Flash Rnd\",\n \"Rainbow Runner\",\n \"Colorful\",\n \"Traffic Light\",\n \"Sweep Random\",\n \"Running 2\",\n \"Aurora\",\n \"Stream\",\n \"Scanner\",\n \"Lighthouse\",\n \"Fireworks\",\n \"Rain\",\n \"Tetris\",\n \"Fire Flicker\",\n \"Gradient\", \n \"Loading\", \n \"Police\", \n \"Police All\",\n \"Two Dots\", \n \"TWO Areas\", \n \"Running DUAL\", \n \"Halloween\", \n \"Tri Chase\", \n \"Tri Wipe\", \n \"Tri Fade\", \n \"Lightning\", \n \"ICU\", \n \"Multi Comet\",\n \"Dual Scanner\",\n \"Stream 2\", \n \"Oscillate\", \n \"Pride 2015\", \n \"Juggle\", \n \"Palette\", \n \"Fire 2012\", \n \"Colorwaves\", \n \"BPM\", \n \"Fill Noise\",\n \"Noise 1\",\n \"Noise 2\",\n \"Noise 3\", \n \"Noise 4\", \n \"Colortwinkle\",\n \"Lake\", \n \"Meteor\", \n \"Smooth Meteor\",\n \"Railway\", \n \"Ripple\",\n \"Twinklefox\",\n \"Twinklecat\",\n \"Halloween Eyes\",\n \"Solid Pattern\",\n \"Solid Pattern Tri\",\n \"Spots\",\n \"Spots Fade\",\n \"Glitter\",\n \"Candle\",\n \"Fireworks Stardust\",\n \"Firework 1D\",\n \"Bouncing Ball\",\n \"Sinelon\",\n \"Sinelon Dual\",\n \"Sinelon Rainbow\",\n \"Popcorn\",\n \"Drip\",\n \"Plasma\",\n \"Percent\",\n \"Ripple Rainbow\",\n \"Heartbeat\",\n \"Pacifica\",\n \"Candle Multi\",\n \"Solid Glitter\",\n \"Sunrice\",\n \"Phased\",\n \"TwinkleUp\",\n \"Noise Pal\",\n \"Sine\",\n \"Phased Noise\",\n \"Flow\",\n \"Chuchun\",\n \"Dancing\",\n \"Washingmachine\",\n \"Candy Cane\",\n \"Blends\",\n \"TV Simulator\",\n \"Dynamic Smooth\"\n ]\n\nreturn {payload:{\n \"attributes\":[{\n \"id\":2869,\n \"data\": effects[msg.payload.state.seg[0].fx],\n \"value\": msg.payload.state.seg[0].fx\n },\n {\n \"id\":2867,\n \"value\":msg.payload.state.on == true ? 1 : 0\n \n },\n {\n \"id\":2868,\n \"value\": Math.round(msg.payload.state.bri/2.55)\n },\n {\n \"id\":2870,\n \"value\": Math.round(msg.payload.state.seg[0].sx/2.55)\n },\n {\n \"id\":2871,\n \"value\": Math.round(msg.payload.state.seg[0].ix/2.55)\n },\n {\n \"id\":2873,\n \"value\":parseInt((ConvertRGBtoHex(msg.payload.state.seg[0].col[0][0],msg.payload.state.seg[0].col[0][1],msg.payload.state.seg[0].col[0][2])),16)\n }]\n \n }\n \n } \nfunction ColorToHex(color) {\n var hexadecimal = color.toString(16);\n return hexadecimal.length == 1 ? \"0\" + hexadecimal : hexadecimal;\n}\n\nfunction ConvertRGBtoHex(red, green, blue) {\n return ColorToHex(red) + ColorToHex(green) + ColorToHex(blue);\n}\n\n \n//parseInt(msg.payload.hex,16)",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 660,
"wires": [
[
"920fa352.63129"
]
]
},
{
"id": "989fc228.949cd",
"type": "link in",
"z": "acb00e70.85a73",
"name": "",
"links": [
"920fa352.63129"
],
"x": 75,
"y": 420,
"wires": [
[
"d4752b13.24a73"
]
]
},
{
"id": "920fa352.63129",
"type": "link out",
"z": "acb00e70.85a73",
"name": "",
"links": [
"989fc228.949cd"
],
"x": 865,
"y": 660,
"wires": []
},
{
"id": "3e79fd94.ced32a",
"type": "websocket in",
"z": "acb00e70.85a73",
"name": "",
"server": "",
"client": "",
"x": 320,
"y": 660,
"wires": [
[
"d6d2d998.0097c8"
]
]
},
{
"id": "af6e754e.47c77",
"type": "websocket out",
"z": "acb00e70.85a73",
"name": "",
"server": "",
"client": "",
"x": 740,
"y": 420,
"wires": []
},
{
"id": "d595d727.a90ae",
"type": "switch",
"z": "acb00e70.85a73",
"name": "",
"property": "payload.attributeId",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "2870",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 390,
"y": 520,
"wires": [
[
"3e522818.31623"
]
]
},
{
"id": "3e522818.31623",
"type": "function",
"z": "acb00e70.85a73",
"name": "",
"func": "\nreturn {\n payload:{\n \"seg\":[{\n \"id\":0,\n \"sx\":Math.round(msg.payload.targetValue*2.55)\n \n },{\n \"id\":1,\n \"sx\":Math.round(msg.payload.targetValue*2.55)\n \n },{\n \"id\":2,\n \"sx\":Math.round(msg.payload.targetValue*2.55)\n \n }]\n \n }\n \n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 520,
"y": 520,
"wires": [
[
"af6e754e.47c77"
]
]
},
{
"id": "2d39be1a.dbb4ea",
"type": "function",
"z": "acb00e70.85a73",
"name": "",
"func": "var id = msg.payload.attributeId;\nif (id === 2867){\n return {payload:{\n \"on\":msg.payload.targetValue === 1 ? true : false\n }\n }\n}\nelse if (id === 2871){\n return {\n payload:{\n \"seg\":[{\n \"id\":0,\n \"ix\":Math.round(msg.payload.targetValue*2.55)\n \n },{\n \"id\":1,\n \"ix\":Math.round(msg.payload.targetValue*2.55)\n \n },{\n \"id\":2,\n \"ix\":Math.round(msg.payload.targetValue*2.55)\n \n }]\n \n }\n \n }\n}\nelse if ( id === 2873){\n var hex = \"#\"+String (Math.abs(msg.payload.targetValue).toString(16));\n var red = parseInt(hex[1]+hex[2],16);\n var green = parseInt(hex[3]+hex[4],16);\n var blue = parseInt(hex[5]+hex[6],16);\n node.send({payload:hex})\n return {\n payload:{\n \"seg\":[{\n \"id\":0,\n \"col\":[[red,green,blue],[0,0,0],[0,0,0]]\n \n }]\n \n }\n \n }\n}\nelse if (id === 2868){\n return {\n payload:\n {\"bri\":Math.round(msg.payload.targetValue*2.55)}\n \n \n \n }\n}\nelse \nreturn",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 400,
"y": 420,
"wires": [
[
"af6e754e.47c77"
]
]
}
]
Sorry hatte ich vergessen