So geht es. In der Alexa bekommt sogar Änderungen bei IR Fernbedienung mit.
[
{
"id": "c898591b.0e6fe8",
"type": "tab",
"label": "Lena Tuya",
"disabled": false,
"info": ""
},
{
"id": "6fb8b57d.2a653c",
"type": "link in",
"z": "c898591b.0e6fe8",
"name": "Test Tuya",
"links": [
"d06fcf08.164fd"
],
"x": 115,
"y": 280,
"wires": [
[
"24745777.87ea88",
"2d3cb289.c9ceae"
]
]
},
{
"id": "24745777.87ea88",
"type": "switch",
"z": "c898591b.0e6fe8",
"name": "colormode",
"property": "colormode",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "hs",
"vt": "str"
},
{
"t": "eq",
"v": "ct",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 250,
"y": 220,
"wires": [
[
"5efba10b.dce29"
],
[
"8f00528b.9763d"
]
]
},
{
"id": "5efba10b.dce29",
"type": "range",
"z": "c898591b.0e6fe8",
"minin": "0",
"maxin": "254",
"minout": "0",
"maxout": "1000",
"action": "scale",
"round": true,
"property": "sat",
"name": "saturation",
"x": 480,
"y": 180,
"wires": [
[
"7bc350fb.2de61"
]
]
},
{
"id": "7bc350fb.2de61",
"type": "range",
"z": "c898591b.0e6fe8",
"minin": "0",
"maxin": "254",
"minout": "0",
"maxout": "1000",
"action": "scale",
"round": true,
"property": "bri",
"name": "value",
"x": 630,
"y": 180,
"wires": [
[
"e2b9d916.379268"
]
]
},
{
"id": "e2b9d916.379268",
"type": "range",
"z": "c898591b.0e6fe8",
"minin": "0",
"maxin": "65563",
"minout": "0",
"maxout": "360",
"action": "scale",
"round": true,
"property": "hue",
"name": "hue",
"x": 770,
"y": 180,
"wires": [
[
"86ddc18c.0f5cd"
]
]
},
{
"id": "86ddc18c.0f5cd",
"type": "function",
"z": "c898591b.0e6fe8",
"name": "joinToHexString",
"func": "msg.bri = toHex(msg.bri)\nmsg.sat = toHex(msg.sat)\nmsg.hue = toHex(msg.hue)\n\nlet arr = [msg.hue, msg.sat, msg.bri];\nmsg.payload = arr.join(\"\");\nreturn msg;\n\nfunction toHex(decimal) { // This converts a number to a string Hex AND adds padding zeros to a set number of characters.\n return (decimal + Math.pow(16, 4)).toString(16).slice(-4)\n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 940,
"y": 180,
"wires": [
[
"68a011f.1c0b6f"
]
]
},
{
"id": "8f00528b.9763d",
"type": "range",
"z": "c898591b.0e6fe8",
"minin": "0",
"maxin": "254",
"minout": "0",
"maxout": "1000",
"action": "scale",
"round": true,
"property": "bri",
"name": "value",
"x": 470,
"y": 260,
"wires": [
[
"1cb5e65b.c81d1a"
]
]
},
{
"id": "1cb5e65b.c81d1a",
"type": "function",
"z": "c898591b.0e6fe8",
"name": "joinToHexString",
"func": "msg.bri = toHex(msg.bri)\nmsg.sat = \"0000\"\nmsg.hue = \"0000\"\n\nlet arr = [msg.hue, msg.sat, msg.bri];\nmsg.payload = arr.join(\"\");\nreturn msg;\n\nfunction toHex(decimal) { // This converts a number to a string Hex AND adds padding zeros to a set number of characters.\n return (decimal + Math.pow(16, 4)).toString(16).slice(-4)\n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 940,
"y": 260,
"wires": [
[
"68a011f.1c0b6f"
]
]
},
{
"id": "2d3cb289.c9ceae",
"type": "switch",
"z": "c898591b.0e6fe8",
"name": "on/off",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 230,
"y": 340,
"wires": [
[
"7478ffb4.d10b8"
],
[
"e6f736ec.004098"
]
]
},
{
"id": "7478ffb4.d10b8",
"type": "change",
"z": "c898591b.0e6fe8",
"name": "true",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "true",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 390,
"y": 320,
"wires": [
[
"4be3cd26.926364"
]
]
},
{
"id": "e6f736ec.004098",
"type": "change",
"z": "c898591b.0e6fe8",
"name": "flase",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "false",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 390,
"y": 360,
"wires": [
[
"4be3cd26.926364"
]
]
},
{
"id": "4be3cd26.926364",
"type": "ioBroker out",
"z": "c898591b.0e6fe8",
"name": "Lena Tuya LED Strip switch_led",
"topic": "tuya.0.08200118e868e759568a.20",
"ack": "false",
"autoCreate": "false",
"stateName": "",
"role": "",
"payloadType": "",
"readonly": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 990,
"y": 360,
"wires": []
},
{
"id": "68a011f.1c0b6f",
"type": "ioBroker out",
"z": "c898591b.0e6fe8",
"name": "Lena Tuya LED Strip color_data",
"topic": "tuya.0.08200118e868e759568a.24",
"ack": "false",
"autoCreate": "false",
"stateName": "",
"role": "",
"payloadType": "",
"readonly": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 1190,
"y": 220,
"wires": []
},
{
"id": "b766d64f.558e38",
"type": "ioBroker in",
"z": "c898591b.0e6fe8",
"name": "color_mode",
"topic": "tuya.0.08200118e868e759568a.24",
"payloadType": "value",
"onlyack": true,
"func": "all",
"gap": "",
"fireOnStart": "false",
"x": 250,
"y": 780,
"wires": [
[
"a3eb0958.b769e8"
]
]
},
{
"id": "52f07af3.8b1f44",
"type": "ioBroker in",
"z": "c898591b.0e6fe8",
"name": "switch_led",
"topic": "tuya.0.08200118e868e759568a.20",
"payloadType": "value",
"onlyack": true,
"func": "all",
"gap": "",
"fireOnStart": "false",
"x": 240,
"y": 600,
"wires": [
[
"c275b713.8d6788"
]
]
},
{
"id": "c275b713.8d6788",
"type": "change",
"z": "c898591b.0e6fe8",
"name": "on",
"rules": [
{
"t": "move",
"p": "payload",
"pt": "msg",
"to": "payload.on",
"tot": "msg"
},
{
"t": "set",
"p": "payload.nodeid",
"pt": "msg",
"to": "6db05f00.c9783",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 690,
"y": 600,
"wires": [
[
"81e46aff.74a0d8"
]
]
},
{
"id": "a3eb0958.b769e8",
"type": "split",
"z": "c898591b.0e6fe8",
"name": "",
"splt": "4",
"spltType": "len",
"arraySplt": "1",
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 390,
"y": 780,
"wires": [
[
"5177cbe7.485ab4"
]
]
},
{
"id": "5177cbe7.485ab4",
"type": "join",
"z": "c898591b.0e6fe8",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "3",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "num",
"reduceFixup": "",
"x": 510,
"y": 780,
"wires": [
[
"92af89f0.547b48"
]
]
},
{
"id": "92af89f0.547b48",
"type": "change",
"z": "c898591b.0e6fe8",
"name": "",
"rules": [
{
"t": "move",
"p": "payload.0",
"pt": "msg",
"to": "hue",
"tot": "msg"
},
{
"t": "move",
"p": "payload.1",
"pt": "msg",
"to": "sat",
"tot": "msg"
},
{
"t": "move",
"p": "payload.2",
"pt": "msg",
"to": "bri",
"tot": "msg"
},
{
"t": "delete",
"p": "payload",
"pt": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 780,
"wires": [
[
"4e112b70.633bc4"
]
]
},
{
"id": "8eb7f14.6ee0c1",
"type": "comment",
"z": "c898591b.0e6fe8",
"name": "set Tuya",
"info": "",
"x": 240,
"y": 100,
"wires": []
},
{
"id": "cfb4977b.415fd8",
"type": "comment",
"z": "c898591b.0e6fe8",
"name": "get Tuya",
"info": "",
"x": 240,
"y": 480,
"wires": []
},
{
"id": "9826af61.305f2",
"type": "range",
"z": "c898591b.0e6fe8",
"minin": "0",
"maxin": "360",
"minout": "0",
"maxout": "65563",
"action": "scale",
"round": true,
"property": "hue",
"name": "hue",
"x": 250,
"y": 680,
"wires": [
[
"a3add1ea.138f1"
]
]
},
{
"id": "4e112b70.633bc4",
"type": "function",
"z": "c898591b.0e6fe8",
"name": "",
"func": "msg.hue = parseInt(msg.hue,16);\nmsg.sat = parseInt(msg.sat,16);\nmsg.bri = parseInt(msg.bri,16)\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 860,
"y": 780,
"wires": [
[
"9826af61.305f2"
]
]
},
{
"id": "a3add1ea.138f1",
"type": "range",
"z": "c898591b.0e6fe8",
"minin": "0",
"maxin": "1000",
"minout": "0",
"maxout": "254",
"action": "scale",
"round": true,
"property": "sat",
"name": "saturation",
"x": 380,
"y": 680,
"wires": [
[
"81962849.8fc1f8"
]
]
},
{
"id": "81962849.8fc1f8",
"type": "range",
"z": "c898591b.0e6fe8",
"minin": "0",
"maxin": "1000",
"minout": "0",
"maxout": "254",
"action": "scale",
"round": true,
"property": "bri",
"name": "value",
"x": 510,
"y": 680,
"wires": [
[
"b5006a27.98cc48"
]
]
},
{
"id": "81e46aff.74a0d8",
"type": "link out",
"z": "c898591b.0e6fe8",
"name": "Lena Tuya in",
"links": [
"4ec4c5f2.23c2dc"
],
"x": 895,
"y": 640,
"wires": []
},
{
"id": "b5006a27.98cc48",
"type": "change",
"z": "c898591b.0e6fe8",
"name": "on",
"rules": [
{
"t": "set",
"p": "payload.nodeid",
"pt": "msg",
"to": "6db05f00.c9783",
"tot": "str"
},
{
"t": "move",
"p": "bri",
"pt": "msg",
"to": "payload.bri",
"tot": "msg"
},
{
"t": "move",
"p": "hue",
"pt": "msg",
"to": "payload.hue",
"tot": "msg"
},
{
"t": "move",
"p": "sat",
"pt": "msg",
"to": "payload.sat",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 690,
"y": 680,
"wires": [
[
"81e46aff.74a0d8"
]
]
}
]