Skip to main content
DIY 6 mins

Controlling LED strips with WLED and integrating them into Home Assistant

With the open source firmware WLED and an ESP microcontroller, you can achieve great lighting effects. You can also easily integrate WLED into Home Assistant.

Controlling LED strips with WLED and integrating them into Home Assistant
Table of Contents

I wanted lighting for the keyboard tray of my ZAOR Miza XL studio desk that illuminates the equipment well and also looks a bit stylish. Although you can also control LED strips with ESPHome ESPHomeFramework for configuring ESP32/ESP8266 microcontrollers that automatically integrate into Home Assistant. Ideal for DIY sensors and actuators , which is part of Home Assistant and allows the very simple use of ESP microcontrollers, WLED WLEDOpen source firmware for ESP8266/ESP32 to control addressable LED strips (WS2812B etc.). Can be integrated into Home Assistant via API offers far more possibilities, effects and some other functions. For example, WLED devices can also be connected to and controlled by a Philips Hue Bridge.

The parts

Since I didn’t need a “true” white light color for my task, I opted for the affordable WS2812 LED strips, which I usually always have in stock. A 5 meter long strip with 150 LEDs is available from about 22 euros .

⚠ [affiliate] Keine Produkte mit Cache für home-assistant. Bitte affiliate-sync --lang en ausführen.

These strips can be cut after each LED, i.e. about every 3.3 cm, and thus brought to the desired size. The studio desk is 150 cm wide when extended, so I could cut the strip so that 45 LEDs remained - more than enough. Each WS2812 LED actually consists of 3 small individual LEDs in red, green and blue, which are combined with control electronics in one housing. If all 3 LEDs are driven with equal brightness, a white mixed light is produced.

There are plenty of reports and statements about the current consumption of LED strips. Usually 60 mA per LED is assumed, which would mean a current of 2.7 amps for white light and 45 LEDs. I made various measurements and with my Chinly strip, the 45 LEDs require just 1.1 amps at full drive.

This brings us to the power supply. A 5-volt power supply that can deliver 1.5 amps would suffice here. However, 2 amp power supplies are much simpler and very affordable. Perhaps you still have an old USB power supply from a smartphone lying around? Otherwise, you can often get corresponding power supplies for under 5 euros.

As the heart of the system, I again used a Wemos D1 Mini with an ESP8266 controller. You can get these for under 5 euros each if you order a 3-pack . You also need a 470 ohm (1/4 watt) resistor (can be 220 to 470 ohms, as it only serves for current limiting and protection of the ESP8266). The WS2812B LEDs only need 3.3 volts for control, so you can do without a level shifter.

An electrolytic capacitor with 100 to 1000 µF is important. A 10 volt type is sufficient. Of course, one with 35 or 63 volts also works. However, they then only take up unnecessary space. The capacitor is placed as close as possible to the supply voltage and smooths the voltage. This is particularly important for WLED projects, as the lighting effects can cause enormous fluctuations in current consumption. The consequence is that the power supply fluctuates greatly and can thus throw the microcontroller and the LEDs out of sync.

The build - circuit board, housing and connections

I built the simple circuit on a small perfboard. The Wemos is socketed so that you could not only easily replace it, but also do a test run without the controller and first check for correct wiring.

The barrel jack socket serves for the power supply and at the same time for mounting the circuit board in the 3D-printed housing. I can recommend this barrel jack set.

To protect the LED strip, I installed a fuse holder in the strip’s supply line and secured it with an 800 mA fuse (medium time-lag). This isn’t absolutely necessary for such short strips, as modern power supplies are short-circuit proof - but why not …

In my case, the strip is connected via a JST connector. With this nice set including crimping tool , you can build wonderfully neat plug connections. Since the supply line to the strip is very short in my case (10 cm), an AWG24 cross-section (0.25 mm2) is completely sufficient. With some practice in handling perfboards, the build is done in 15 minutes.

The housing was quickly designed in Autodesk Fusion 360. The great tutorial from Mistermaestro on Youtube is highly recommended. He explains how to get to an individual housing very quickly and easily.

Mit einem Klick auf „Play" wird das Video von YouTube geladen. Dabei werden Daten (z. B. Ihre IP-Adresse) an Google-Server übermittelt. Weitere Informationen finden Sie in unserer Datenschutzerklärung.

I used to do this in a much more complicated way. With his tips, you don’t even need screws. I printed the housing with ABS on my Wanhao Duplicator 6.

I don’t need to provide the print files to you because the housing only fits my specific build anyway.

Flashing WLED firmware and Home Assistant

You can get the WLED firmware from Github for the respective controller - in my case the ESP8266. You can flash it with the ESPHome Flasher or other tools. Exact instructions for WLED are available on the project’s official homepage: Welcome to WLED - WLED Project

Once the firmware has been successfully flashed, the controller restarts and opens a WiFi access point. With the password wled1234 you can connect to it with your smartphone or another WiFi-enabled device, integrate the new WLED controller into your home WiFi and give it a name. You can access the web interface of the WLED controller via its IP or its name:

If you want it even more convenient, download the WLED app for Android or iOS on your smartphone or tablet. This also automatically searches the WiFi for new controllers and displays them.

What’s particularly interesting about WLED devices is not the many effects, but the ability to divide an LED strip into multiple segments and control them completely individually. For example, LED 1-20 can shine bright white, while 21-40 run through an effect and LED 40-50 don’t light up. WLED also includes a timer as well as a night light function. With the playlists, previously defined presets can be run through automatically.

If you have a Philips Hue Bridge in use, you can also connect WLED controllers to it. With an alternative bridge, such as the Conbee II stick , this unfortunately doesn’t work, as WLED communicates on a WiFi basis and not via the ZigBee protocol.

WLED devices can also be connected to and controlled by Amazon Alexa - without any additional configuration, and an IR remote control can also be integrated. In addition, two buttons with short, long and double-click functions can be queried and used for control purposes, and an output for controlling a relay, for example, is also available.

In Home Assistant, you integrate WLED devices via the official integration for this. The desired lighting effects and settings are stored as presets in the WLED interface, which can then be called up in Home Assistant and of course also automated. The segments can also be controlled from Home Assistant.

WLED is a great way to not only control LED strips simply and effectively. You can also use it to build your own lamps in the style of Philips Hue lights.


Hi! I'm Markus – the Fricklr. ⚡ Electrical engineer, 🎵 musician (bass, guitar, keys) and professionally 'something with the internet' 🌐 for over 30 years – nowadays with AI too 🤖 – a 55-year-old generalist from Bavaria, Germany.

Your feedback helps me write even more interesting posts. After "Yes" there's also a small option to support my work.

Explore related topics

Content Map →
Show related content as a list
💡 Drag, hover & click to explore
Bigger dots are more relevant

What do you think? Leave a comment!

Share your thoughts, questions or experiences with the community.

Links marked with this symbol are affiliate links. As an Amazon Associate I earn from qualifying purchases. There are no additional costs for you.