Skip to content

OpenLED and ESPHome

There are multiple ways through which you can use OpenLED (and integrate it with your smart home).

One of the ways is using ESPHome (described on this page) or using WLED.
There are other ways as well but these two are probably the easiest.

Depending on your application/project, comfort level and/or personal preference, you might chose to use WLED, ESPHome or some other application.

What is ESPHome

ESPHome is a system to control your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems.

Please note that while ESPHome is more/very customizable, it does require that you compile your configuration file and upload the compiled binary. The setup and compile process is simple and well documented, however it is not plug&play.

Common OpenLED and ESPHome use-case

You might want to use OpenLED and ESPHome for example if you want to connect sensors (ie PIR or RF proximity sensor) and use that to turn on/off lights based on motion detection or presence.

Fully functional configuration that uses both PIR and RF sensor is available in the official GitHub repository

Example .yaml configurations

Multiple example ESPHome .yaml configurations for OpenLED are provided in the OpenLED GitHub repository.
These examples covers all the basic OpenLED + ESPHome configuration and hopefully you should be able to easily customize them to fit your use-case.

How to compile and install my ESPHome configuration

Please refer to the official ESPHome build guide.

Configure the three 12V PWM channels

OpenLED has three 12V PWM channels that you can use to control different LEDs strips.
For example control RGB LED strip, or Cool-White + Warm-White LED strip, or to have multiple individual zones.

You should have the output: section that describes which pins are connected to which channel.

output:
  - platform: ledc
    pin: GPIO0 # Do not change this
    id: gpio_0 # This is the name you can use to assign to control LED CH1
    inverted: true # Do not change this
    frequency: 400Hz

  - platform: ledc
    pin: GPIO1 # Do not change this
    id: gpio_1 # This is the name you can use to assign to control LED CH2
    inverted: true # Do not change this
    frequency: 400Hz

  - platform: ledc
    pin: GPIO3 # Do not change this
    id: gpio_3 # This is the name you can use to assign to control LED CH3
    inverted: true # Do not change this
    frequency: 400Hz

Configure the addressable LED data out

light:
  # Neopixel LED strip
  - platform: neopixelbus
    id: LedsStrip
    variant: WS2812
    type: GRB
    pin: GPIO6  # Do not change this
    method:
      type: esp32_rmt
      channel : 1
    num_leds: $ledcount # This is the total number of LEDs your addressable LED strip has
    name: "$devicename Addresable LEDs"

Use variables

If you are using example configuration, instead of manually renaming each line that starts with $, you can just modify your substitutions: section at the top of the .yaml file.