let count = msg.payload; let total = 10; // Anzahl LEDs let leds = []; for (let i = 0; i < total; i++) { if (i < count) { leds.push([0,255,0]); // grĂ¼n } else { leds.push([0,0,0]); // aus } } msg.payload = { "Leds": leds }; return msg;