Moin,
Ich mal wieder
Versuche gerade die WLED mit einer Paulmann 501.40 Fernbedienung über Node Red zu steuern (Farbänderung) Das An und aus geht schon ganz gut. aber ich komme nicht weiter. Ich lasse die Hue und trans umrechnen zu RGB aber mehr als mal kurz auf zu blinken aber keine Farbe wechsel passiert nichts
Hier der Flow :
[{"id":"264f65496ba97177","type":"tab","label":"22:01 11.01.2025","disabled":false,"info":"","env":[]},{"id":"b14c06740554e8f4","type":"zigbee2mqtt-in","z":"264f65496ba97177","name":"","server":"7fb5c27f6bb8fb7b","friendly_name":"RGB (501.40)","device_id":"0xb4e3f9fffeef96e3","state":"0","outputAtStartup":true,"filterChanges":false,"enableMultiple":false,"x":150,"y":300,"wires":[["c7663bcc11e359b4"]]},{"id":"c7663bcc11e359b4","type":"function","z":"264f65496ba97177","name":"Farbzuweisung und Ein/Aus","func":"function hslToRgb(h, s, l) {\n let r, g, b;\n h /= 360; // Normalisiere den Hue-Wert\n s /= 100; // Normalisiere den Saturation-Wert\n l /= 100; // Normalisiere den Lightness-Wert\n\n if (s === 0) {\n r = g = b = l; // Grau\n } else {\n const hue2rgb = function(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n // Berechnung der RGB-Werte\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];\n}\n\nif (msg.payload.action === 'on_1') {\n msg.payload = { \"on\": true }; // Einschalten\n} else if (msg.payload.action === 'off_1') {\n msg.payload = { \"on\": false }; // Ausschalten\n} else if (msg.payload.action === 'move_to_hue_and_saturation_1') {\n const hue = msg.payload.action_hue;\n const saturation = Math.min(msg.payload.action_saturation, 100); // Maximal 100%\n const transitionTime = msg.payload.action_transition_time;\n\n // Setze Lightness auf 50% für sichtbare Farben\n const lightness = 50; \n const [r, g, b] = hslToRgb(hue, saturation, lightness);\n\n // Debug-Ausgaben hinzufügen\n node.warn(`HSL: ${hue}, ${saturation}, ${lightness}`);\n node.warn(`RGB: ${r}, ${g}, ${b}`);\n\n msg.payload = {\n \"on\": true,\n \"bri\": 255, // Setze die Helligkeit\n \"seg\": [{\n \"id\": 0,\n \"r\": r, // Rot\n \"g\": g, // Grün\n \"b\": b, // Blau\n \"transition\": transitionTime * 2000 // Übergangszeit in Millisekunden\n }]\n };\n} else {\n return null; // Ignoriere unbekannte Aktionen\n}\nreturn msg;\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":300,"wires":[["682257f36b229443","7b9ddbfb16fd0761"]]},{"id":"682257f36b229443","type":"debug","z":"264f65496ba97177","name":"Debug Payload","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":440,"wires":[],"info":"msg.payload = { color: msg.payload.colors }; // Zeigt nur die Farbänderungen an\r\nreturn msg;\r\n"},{"id":"202f7cb9d030bc38","type":"debug","z":"264f65496ba97177","name":"HTTP Antwort","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":true,"statusVal":"","statusType":"auto","x":1080,"y":500,"wires":[]},{"id":"937e19bc5a2fad3b","type":"debug","z":"264f65496ba97177","name":"Debug Ausgabe","active":false,"tosidebar":true,"console":false,"complete":true,"statusVal":"","statusType":"auto","x":1080,"y":600,"wires":[]},{"id":"7b9ddbfb16fd0761","type":"wled2","z":"264f65496ba97177","address":"192.168.178.161/json","brightness":128,"delay":0,"color1":"#ffffff","color2":"#fd1212","color3":"#351fdb","effect":0,"effectIntensity":128,"effectSpeed":128,"name":"","palette":"0","preset":0,"state":"toggle","x":970,"y":220,"wires":[["202f7cb9d030bc38","937e19bc5a2fad3b"]]},{"id":"7fb5c27f6bb8fb7b","type":"zigbee2mqtt-server","name":"","host":"192.168.178.150","mqtt_port":"1883","mqtt_username":"","mqtt_password":"","mqtt_qos":"0","tls":"4230868a2749a2ba","usetls":false,"base_topic":"zigbee2mqtt"},{"id":"4230868a2749a2ba","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false,"alpnprotocol":""}]
type or paste code here
Und hier die Debug Ausgabe:
12.1.2025, 00:42:30node: Farbzuweisung und Ein/Aus
function : (warn)
"HSL: 240, 100, 50"
12.1.2025, 00:42:30node: Farbzuweisung und Ein/Aus
function : (warn)
"RGB: 0, 0, 255"
12.1.2025, 00:42:30node: HTTP Antwort
zigbee2mqtt/RGB : msg : Object
{ topic: "zigbee2mqtt/RGB ", changed: object, payload: object, payload_raw: object, homekit: object … }
12.1.2025, 00:42:30node: Farbzuweisung und Ein/Aus
function : (warn)
"HSL: 246, 100, 50"
12.1.2025, 00:42:30node: Farbzuweisung und Ein/Aus
function : (warn)
"RGB: 25, 0, 255"
12.1.2025, 00:42:31node: HTTP Antwort
zigbee2mqtt/RGB : msg : Object
object
topic: "zigbee2mqtt/RGB "
changed: object
old: object
action: "move_to_hue_and_saturation_1"
action_hue: 240
action_saturation: 254
action_transition_time: 6
battery: 100
linkquality: 72
new: object
action: "move_to_hue_and_saturation_1"
action_hue: 246
action_saturation: 254
action_transition_time: 0
battery: 100
linkquality: 76
payload: object
on: true
bri: 255
seg: array[1]
0: object
id: 0
r: 25
g: 0
b: 255
transition: 0
payload_raw: object
action: "move_to_hue_and_saturation_1"
action_hue: 246
action_saturation: 254
action_transition_time: 0
battery: 100
linkquality: 76
homekit: object
Battery: object
BatteryLevel: 100
StatusLowBattery: 0
format: object
empty
selector: "zigbee2mqtt_RGB"
item: object
date_code: "NULL"
definition: object
description: "RGB remote control"
exposes: array[3]
0: object
access: 5
category: "diagnostic"
description: "Remaining battery in %"
label: "Battery"
name: "battery"
property: "battery"
type: "numeric"
unit: "%"
value_max: 100
value_min: 0
1: object
access: 1
category: "diagnostic"
description: "Triggered action (e.g. a button click)"
label: "Action"
name: "action"
property: "action"
type: "enum"
values: array[32]
[0 … 9]
0: "on"
1: "off"
2: "toggle"
3: "brightness_move_to_level"
4: "brightness_move_up"
5: "brightness_move_down"
6: "brightness_step_up"
7: "brightness_step_down"
8: "brightness_stop"
9: "color_temperature_move_stop"
[10 … 19]
10: "color_temperature_move_up"
11: "color_temperature_move_down"
12: "color_temperature_step_up"
13: "color_temperature_step_down"
14: "enhanced_move_to_hue_and_saturation"
15: "move_to_hue_and_saturation"
16: "color_hue_step_up"
17: "color_hue_step_down"
18: "color_saturation_step_up"
19: "color_saturation_step_down"
[20 … 29]
20: "color_loop_set"
21: "color_temperature_move"
22: "color_move"
23: "hue_move"
24: "hue_stop"
25: "move_to_saturation"
26: "move_to_hue"
27: "recall"
28: "store"
29: "add"
[30 … 31]
30: "remove"
31: "remove_all"
2: object
access: 1
category: "diagnostic"
description: "Link quality (signal strength)"
label: "Linkquality"
name: "linkquality"
property: "linkquality"
type: "numeric"
unit: "lqi"
value_max: 255
value_min: 0
model: "501.40"
options: array[1]
0: object
access: 2
description: "Simulate a brightness value. If this device provides a brightness_move_up or brightness_move_down action it is possible to specify the update interval and delta. The action_brightness_delta indicates the delta for each interval. "
features: array[2]
label: "Simulated brightness"
name: "simulated_brightness"
property: "simulated_brightness"
type: "composite"
supports_ota: false
vendor: "Paulmann"
disabled: false
endpoints: object
1: object
bindings: array[5]
0: object
cluster: "genPowerCfg"
target: object
endpoint: 1
ieee_address: "0x0ceff6fffecdfa7c"
type: "endpoint"
1: object
cluster: "genOnOff"
target: object
endpoint: 1
ieee_address: "0x0ceff6fffecdfa7c"
type: "endpoint"
2: object
cluster: "genLevelCtrl"
target: object
endpoint: 1
ieee_address: "0x0ceff6fffecdfa7c"
type: "endpoint"
3: object
cluster: "lightingColorCtrl"
target: object
endpoint: 1
ieee_address: "0x0ceff6fffecdfa7c"
type: "endpoint"
4: object
cluster: "genScenes"
target: object
endpoint: 1
ieee_address: "0x0ceff6fffecdfa7c"
type: "endpoint"
clusters: object
input: array[5]
0: "genBasic"
1: "genPowerCfg"
2: "genIdentify"
3: "haDiagnostic"
4: "touchlink"
output: array[8]
0: "genIdentify"
1: "genGroups"
2: "genScenes"
3: "genOnOff"
4: "genLevelCtrl"
5: "genOta"
6: "lightingColorCtrl"
7: "touchlink"
configured_reportings: array[2]
0: object
attribute: "batteryPercentageRemaining"
cluster: "genPowerCfg"
maximum_report_interval: 65000
minimum_report_interval: 3600
reportable_change: 10
1: object
attribute: "batteryPercentageRemaining"
cluster: "genPowerCfg"
maximum_report_interval: 65000
minimum_report_interval: 3600
reportable_change: 10
scenes: array[0]
2: object
bindings: array[5]
0: object
cluster: "genPowerCfg"
target: object
1: object
cluster: "genOnOff"
target: object
2: object
cluster: "genLevelCtrl"
target: object
endpoint: 1
ieee_address: "0x0ceff6fffecdfa7c"
type: "endpoint"
3: object
cluster: "lightingColorCtrl"
target: object
4: object
clusters: object
configured_reportings: array[2]
scenes: array[0]
3: object
4: object
friendly_name: "RGB "
ieee_address: "0xb4e3f9fffeef96e3"
interview_completed: true
interviewing: false
manufacturer: "Paulmann Licht GmbH"
model_id: "501.40"
network_address: 28115
power_source: "Battery"
software_build_id: "2.7.6_r22"
supported: true
type: "EndDevice"
current_values: object
homekit: object
format: object
_msgid: "b41e13d297d28dfe"
12.1.2025, 00:47:24node: HTTP Antwort
zigbee2mqtt/RGB : msg : Object
{ topic: "zigbee2mqtt/RGB ", changed: object, payload: object, payload_raw: object, homekit: object … }
Wenn mir jemand helfen könnte wäre ich echt Dankbar
Liebe Grüße
Roy