WS2812 LED lighting on ESP32 with ESPHome
Addressable WS2812B strip on ESP32-C6 with ESPHome: 5 V supply, data resistor, YAML and Home Assistant light effects.
Getting started
Home Assistant
Buying
Addressable WS2812B strip on ESP32-C6 with ESPHome: 5 V supply, data resistor, YAML and Home Assistant light effects.

Goal: drive a WS2812B addressable LED strip from Home Assistant using an ESP32 board and ESPHome. This tutorial covers supply sizing, common ground, a 330 Ω data resistor, and a reliable YAML configuration.
Also in French: WS2812 lighting (FR) (overview hub).
Prep guides: ESPHome temperature sensor · ESP32 project ideas · Which ESP32 board? · Smart home hub.
light:
Adopt the device in Home Assistant, then add the light entity to dashboards and automations (sunrise wake-up, movie scene, alert colour).
| Symptom | Likely cause | Fix |
|---|---|---|
| First LEDs white, rest off | Undersized 5 V supply | Heavier PSU, inject power at both ends on long runs |
| Random colours | Missing/common GND | Tie ESP32 GND to strip GND and PSU − |
| No data | Wrong GPIO or no resistor | GPIO18 + 330 Ω on DIN; try level shifter on long cables |
| Flicker on effects | Wi-Fi or power sag | Separate PSU from USB hub; shorten data wire |
Was this page helpful?
Thank you!
What should we improve?
Torn between two models or stuck on a build? Drop us a line and we will get back to you by email.
Cookies and analytics
We use Google Analytics 4 to understand how the site is used (page views, navigation). It is only switched on if you accept. Declining does not stop you using the site. More: cookie settings and privacy policy (in French).