Skip to content

Recipes

Short, complete jobs. Each assumes the chapters it leans on; each ends with a check, because a recipe you cannot verify is a rumour.

A strip that greets the sunset

Goal: porch lights on at sunset, off at 23:00, no hub.

  1. Build the look on the control page (warm colour, modest brightness — chapter 4's budget set first) and save it as a preset, say number 1.
  2. In Config → Time & Macros, set your location, then in Time-Controlled Presets use one of the last two timer slots: trigger sunset, offset 0, apply preset 1, active every day.
  3. In another slot: trigger time, 23:00, apply a preset that is simply "off" (save the all-off state as a preset too), every day.

Check: the device's clock is right (it shows on the info page; wrong time is an NTP problem — chapter 17), and tomorrow's sunset is roughly when the project's sunrise/sunset maths says. The first evening tells you the rest.

Two rooms, one gesture

Goal: the living-room and kitchen controllers change together.

  1. Put both devices in the same sync group (Config → Sync Interfaces): on the one you will touch, enable send; on the other, receive; same group number both ways if you want either to lead.
  2. Leave the one you will not touch with send off, so two controllers do not chase each other.

Check: change the colour on the leader. The follower follows within a heartbeat — and its own web page shows the new state, because there is only ever one state per device (chapter 2).

A button by the door

Goal: one physical press for "all off", one for "evening".

  1. Wire a pushbutton between the button pin (GPIO0 by default on many boards) and ground; declare it in Config → LED Preferences.
  2. Save preset 2 = evening look, preset 3 = everything off.
  3. In Config → Time & Macros → Button actions, set short press → preset 2, long press → preset 3.

Check: press it. Then check the web page still agrees — the button is just another door into the same state.

Drive it from a script

Goal: a cron job on some other machine dims the house strips at midnight.

curl -s -X POST http://wled-porch.local/json/state \
  -H 'Content-Type: application/json' \
  -d '{"bri":40,"transition":50}' > /dev/null

Check: curl -s http://wled-porch.local/json/state shows "bri": 40 — and the 5-second fade (transition: 50, in the API's 100 ms units) is why nobody in the house noticed it happen.

The holiday rotation

Goal: three festive looks, rotating all evening, then dark.

  1. Save the three looks as presets 10, 11, 12.
  2. Create a playlist (chapter 10): ps [10, 11, 12], dur 600 each (60 seconds a look), repeat 0 — loop until told otherwise.
  3. Timer: apply the playlist's preset at 17:00; apply the off preset at 23:30.

Check: at 17:01 the info page's pl field names the playlist; at 23:31, on reads false. The season is handled.