Christmas Lights pt 1


Someday, I’m going to be that guy. I really love the satisfaction of a light display that goes beyond blinking lights – synchronization, coordination – a sense of deliberateness adds an incredible feeling to the sense of holiday cheer. This feeling of physicality and practicality hits me similarly to my love of robotics – and also happens to blend some of my other hobbies, home automation and electronics.

Unfortunately I don’t have an unlimited budget to spend on holiday lights, so this year I settled with starting to lay the framework of future years with some automation. This first year, I synchronized a WLED Controller to some great (and shockingly cheap) outdoor WS2812 light strips with some Phillips Hue color bulbs to create a randomized and coordinated color ‘show’ every evening.

These were integrated with a Node Red flow that connected all the related systems together – using internal flow variables to select a single random color every day, then distribute it to the lights when they turn on.

Next year:

  • More lights!
  • +1 automated integration (one more every year?)
  • Custom Circuit Boards to support WLED
  • Turn the lights on in the morning for am departures
I always say “Done is Beautiful” – this box isn’t pretty, but it went from idea to functional in a week, and that makes it beautiful. Next year I might get some more dedicated PCBs now that I’m familiar with the ecosystem.

Color Randomization

JavaScript
// Generate random RGB
const r = Math.floor(Math.random() * 256);
const g = Math.floor(Math.random() * 256);
const b = Math.floor(Math.random() * 256);

// Pack into an object for convenience
const color = {
    r,
    g,
    b,
    rgb: [r, g, b],
    hex: "#" + ((1 << 24) + (r << 16) + (g << 8) + b)
        .toString(16)
        .slice(1)
};

// Store globally so any flow can read it
global.set("dailyColor", color);

// Optional: attach to msg for debug/status
msg.dailyColor = color;
return msg;

WLED Prep + Send

JavaScript
const color = global.get("dailyColor");
if (!color) return null;

msg.headers = { "Content-Type": "application/json" };
msg.payload = {
  on: true,
  bri: 150,
  seg: [{
    fx: 54,                // Chase 3 (from your effects list)
    sx: 0,                 // slowest speed
    ix: 128,
    col: [[color.r, color.g, color.b]]
  }]
};

return msg;

Send the above block into a POST Node Red node.