This is how to create a simple smart LED using ESP Home using a small arduino library called fastled
Stuff you will need:
- Individually addressable LED strip (like WS2812)
- A Soldering Iron with some tin
- Usb A male connector with some wires
- ESP8266/ESP32/Arduino board (D1 mini will do the trick)
- Home assistant with ESPHome Add-on
- 20 mins
Connection schema:
- Connect the +5V (Red wire is preferable) from the USB connector to the 5V pin on the D1 mini and to the
+5V pad of the LED - Connect the GND (White wire is preferable) from the USB connector to the GND connector on the D1 mini and to the GND pad of the LED
- Connect the DATA (GREEN wire is preferable) from the LED Din connector to the D4 connector on the D1 mini
- Create a device and have the code below (adjust to your preferences):
esphome:
name: office_led
platform: ESP8266
board: d1_mini
wifi:
ssid: "YOUR-WIFI-SSID"
password: "YOUR-WIFI-PASSWORD"
# Optional manual IP
manual_ip:
static_ip: 192.168.1.24
gateway: 192.168.1.1
subnet: 255.255.255.0
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
light:
- platform: fastled_clockless
chipset: WS2812
pin: D4
num_leds: 20
rgb_order: GRB
name: "OFFICE LED"
id: office_led
effects:
- strobe:
- addressable_rainbow:
- addressable_scan:
- addressable_twinkle:
- addressable_random_twinkle:
- addressable_fireworks:
- addressable_flicker:
The LED in action…