Once I’d built my log cabin home office and made it smart, the outside still went dark at night. So I ran addressable LED strips around two sections of the roof edge, and another one along the deck, all running WLED.
I had a few reasons:
- Seasonal effects. One set of lights can do Christmas, Halloween and anything else, without buying new lights every year.
- Another fun Home Assistant project. WLED drops straight into Home Assistant, so the lights can run on automations like everything else.
- Cost. It’s far cheaper than the branded outdoor smart light kits.
This is what I used, how it’s wired, and the slow evening effect I called Night Drift, which comes on by itself every night.
What I used
- 3x WS2812B LED strip, 5m, 300 LEDs, IP67 waterproof: two for the cabin and one for the deck. That’s 60 LEDs per metre, and every LED can be set to its own colour.
- 1x 5V 20A 100W power supply for the cabin.
- 1x ESP32 DevKitC (ESP32-WROOM-32U, 2 pack): one board for the cabin and one for the deck.
- 1x 22AWG stranded hookup wire, 50m for the power runs.
- 2x clear waterproof LED strip clips with screws, 50 pack to fix the strips along the roof edge.
- 1x IP65 ABS project box, 100 x 68 x 50mm (2 pack) to house the ESP32.
In total the cabin has 600 LEDs (two 5m strips) and the deck has 300 (one 5m strip).
Flashing WLED onto the ESP32
This bit is easier than it sounds. There’s nothing to compile:
- Plug the ESP32 into your PC with a USB cable.
- Open install.wled.me in Google Chrome. It needs Chrome (or Edge), because it talks to the board over USB from the browser and other browsers can’t do that.
- Click Install, pick the board’s port from the list, and let it flash.
- Join the board to your WiFi, then open its web page.
Then in WLED’s Config → LED Preferences, tell it about the strip: data on GPIO 16, the LED count (600 for the cabin, 300 for the deck), type WS281x and colour order GRB. If the colours come out wrong (red where you expected green), the colour order is the setting to check.
Wiring it up
The cabin. The ESP32 and the power supply live inside the cabin, with the ESP32 in its project box:
- Data: GPIO 16 on the ESP32 goes to the data in (DIN) on the first strip. The first strip’s data out is then daisy chained into the second strip’s data in, so WLED sees one long run of 600 LEDs.
- Power: both strips are powered directly from the 5V supply, each with its own run, rather than through the ESP32. The supply also powers the ESP32 through its 5V and GND pins.
- Ground: the grounds from both strips go to the same ground as the ESP32 and the supply.
That last point matters. When I had the strips on a different ground from the ESP32, the lights freaked out a bit. The data signal is measured against ground, so the strip and the board need the same ground to agree on what the signal says. Putting everything on one ground sorted it.
The deck. The deck is simpler. It has the second ESP32, powered from a USB plug, and the strip takes its 5V, GND and data (GPIO 16 again) straight from the board. A board on USB can only supply a limited current, so the deck’s WLED has its brightness limiter set to 1A.
A tip on the wire. My power runs are short, and I keep the lights dim, so 22AWG is fine for me. It is thin for 5V LEDs though. A full 5m strip on bright white can pull well over 10A, which is far more than 22AWG should carry. If your runs are longer, or you want full brightness, use thicker wire for the power, and keep WLED’s brightness limiter (in LED Preferences) switched on and set to what your supply and wiring can handle.
Home Assistant
Home Assistant has a WLED integration, and it normally finds WLED devices on the network by itself. Each strip shows up with a light, a preset selector and a few other controls.
One automation runs both strips in the evening. Thirty minutes after sunset it switches the cabin and deck to Night Drift, and at 11pm it fades them out:
Roof LEDs Night Drift automation (YAML)
alias: Cabin - Roof LEDs at night
triggers:
- trigger: sun
event: sunset
offset: "00:30:00"
id: "on"
- trigger: time
at: "23:00:00"
id: "off"
actions:
- choose:
- conditions:
- condition: trigger
id: "off"
sequence:
- action: light.turn_off
target:
entity_id:
- light.cabin_wled_strip
- light.deck_wled_strip
data:
transition: 10
- conditions:
- condition: trigger
id: "on"
sequence:
- action: select.select_option
target:
entity_id:
- select.cabin_wled_strip_preset
- select.deck_wled_strip_preset
data:
option: Night Drift
mode: single
Selecting a preset turns the strip on too, so there’s no need for a separate turn on step.
The Night Drift effect
For the evenings I wanted something that looks nice, changes slowly and smoothly, and isn’t too bright. Night Drift is WLED’s built in Palette effect, which slides a colour palette along the strip, with a custom palette and everything turned right down:
- Palette: a custom one that goes from deep indigo through navy, teal and blue, into a warm amber, then plum and violet, and back to indigo.
- Shift: 10. This is the speed the palette moves along the strip. 10 is very slow, so you notice it has changed rather than see it move.
- Size: 40. How stretched out the palette is along the strip. Lower numbers give long, gentle bands of colour.
- Rotation: 0, with Animate Shift on and Animate Rotation off.
- Brightness: 70 out of 255, so it’s a soft glow rather than floodlights.
- Transition: 4 seconds, so switching to it from another preset fades in rather than jumping.
The palette colours are dark on purpose. Each point is a position from 0 to 255 along the palette, then red, green and blue:
night-drift palette (palette0.json)
{"palette":[0,10,6,40, 40,0,40,70, 85,0,90,90, 120,20,40,90, 160,180,70,10, 195,90,20,60, 230,30,8,70, 255,10,6,40]}
You can add it in WLED’s custom palette editor, or upload it as palette0.json through WLED’s file editor at http://<wled-ip>/edit. It then shows in the palette list as a custom palette.
To build the preset in one go, send this to the JSON API and then save it as a preset called Night Drift. Set stop to your LED count (I use 300 on the deck) and pal to your custom palette’s number (the first custom palette is 200 on my strips):
Night Drift state (JSON API)
curl -X POST "http://<wled-ip>/json/state" -H "Content-Type: application/json" -d '{
"on": true, "bri": 70, "transition": 40,
"seg": [{ "id": 0, "start": 0, "stop": 600,
"fx": 65, "sx": 10, "ix": 40, "c1": 0,
"o1": true, "o2": false, "o3": false,
"pal": 200 }]
}'
Both strips have the same presets with the same names and numbers, so one automation can pick a preset on both by name. Besides Night Drift there’s a twinkle effect, Christmas, and a Halloween one that mixes orange and purple with a little green and an occasional flicker like lightning.
What’s next
The next job in the garden is a resin bound gravel path, and I’d like to run a strip up one side of it, set into the resin, so the path lights up along with the cabin and deck.
Related reading
total 1
More projects
total 13