To date there have been two primary methods for integrating cheap ESP8266 boards like the NodeMCU or D1 Mini with Home Assistant. The first I wrote about in January using custom Arduino code written by Bruh Automation and the second used ESPHome. Both of these methods were fine but each had their pros and cons.

Flashing custom Arduino code can be error prone and confusing sometimes. Not to mention a minefield of driver management and that the Arduino IDE requires Java. ESPHome is very simple to set up but lacks the intricate configurability of custom code. In short, there's always a trade off. But what if I told you that there's now a third way that mashes the best bits of these two options together?

A platinum level Home Assistant integration for the WLED project was released with version 0.120 on Nov 20th 2019. I'm going to walk you through flashing a D1 Mini (though the same steps apply for a NodeMCU too) using Linux. You can probably expect this process to take about 5-10 minutes.

Hardware required

Please note that the links below are Amazon affiliate links that support my bringing this content to you.

Item Price Purpose
D1 Mini $5.50 A mini wifi board with 4MB flash based on ESP-8266EX
5v LEDs $28 300 5v LEDs with WS2812b controller (1 LED = 1 pixel)
Micro USB Breakout Board 69c each MicroUSB power input board
Total $16.07

You'll also need a power supply. The Amazon listing suggest 18A at 5v to power all 300 LEDs so I would suggest only using these 5v strips in smaller projects. For longer runs, use the 12v strips from my original article. For these 5v strips you need to budget approx 60mA for each LED at full brightness.

Wiring diagram

Pay attention to the power supply comment above but here's an example wiring diagram to help you get started.

Flashing the firmware

Flashing WLED is unbeliveably easy on Linux. I grab esptool from the AUR on Arch and then executed the following one line command to flash firmware.

sudo esptool.py --port /dev/ttyUSB0 write_flash 0x00000 Downloads/WLED_0.8.6_ESP8266.bin
  1. Download the version of the latest WLED firmware from Github on the releases page
  2. Install esptool (Arch users yay -S esptool) - esptool project link
  3. Connect the D1 mini via usb to your system and then...
  4. Flash the firmware

Yes, that is it. You will now be able to perform all future updates over the air, wirelessly.

Configuring the D1 mini

  1. Using your smartphone or laptop look for a new wifi network called WLED-AP and connect to it using the default password wled1234
  2. Navigate to the IP address 4.3.2.1 in a browser
  3. Fill-in the relevant wifi information for your network
  4. Hit save

Configuring a custom name and add to Home Assistant

This video shows how to set a custom name in the WLED web server and how to integrate with Home Assistant.

How to integrate (there is no sound)

Configuring Home Assistant

This is covered in the short video above labelled 'how to integrate'.

  1. Enter the configuration menu
  2. Enter the integrations menu
  3. Use the orange plus in the bottom right to add a new integration
  4. Search for WLED from the drop down list
  5. Enter the IP address of your D1 mini
  6. Save

Configure Home Assistant interface

This is covered in the short video above labelled 'how to integrate'.

  1. Load Home Assistant Overview page and 'configure UI' from 3 dot menu in the top right
  2. Add a new light card
  3. Select the light and customise the icon as you see fit
  4. For bonus points you could add this new light to a group

Summary

That's it folks. What took me several days to understand in January previously now takes a matter of minutes...

  • No MQTT servers (though this firmware does support it)
  • No custom code compiliation (though you can if you want to customise the data pin for some reason)
  • Full effect selection available
  • Native Home Assistant API integration

There is a native Android and iOS app if you didn't want to use Home Assistant, for some reason.