Nick4
(Nick)
May 24, 2026, 11:16pm
1
I'm trying to add this kind of LED
to a Wemos S3 mini but I cannot figure out how to configure it.
It's a common cathode type and I have put 200Ohm resistors on the anodes so I guess that part is OK.
EDIT: the solution was given by @Karosm and this post shows the full code
EDIT 2: the code for a Lolin D1 mini (esp8266) is in this post
Karosm
(Karosm)
May 24, 2026, 11:56pm
3
Cathode to GND and anodes to gpio pins via resistors. On your code make LEDC outputs for those gpios and RGB light component to control outputs.
1 Like
Nick4
(Nick)
May 25, 2026, 12:03am
4
Hi guys, thanks for helping out!
I was already searching for hours but couldn't find what to use for coding.
Just now, I got it working like this:
output:
- platform: ledc
pin: GPIO16
id: gpio_16
- platform: ledc
pin: GPIO18
id: gpio_18
- platform: ledc
pin: GPIO35
id: gpio_35
light:
- platform: monochromatic
output: gpio_16
name: "Blue Light"
- platform: monochromatic
output: gpio_18
name: "Green Light"
- platform: monochromatic
output: gpio_35
name: "Red Light"
Although I like ESPHome very much as a technology but TBH, I still don't know if this is the right and only way for this kind of LED and I struggle each time when trying something new...
Karosm
(Karosm)
May 25, 2026, 12:06am
5
It's more "common" to use single RGB-light component than multiple mono.
2 Likes
zoogara
(Daryl)
May 27, 2026, 10:37am
6
Like @Karosm said - use a single light component:
output:
- platform: ledc
pin: GPIO16
id: gpio_16
- platform: ledc
pin: GPIO18
id: gpio_18
- platform: ledc
pin: GPIO35
id: gpio_35
light:
- platform: rgb
name: "RGB Light"
red: gpio_16
green: gpio_18
blue: gpio_35
Nick4
(Nick)
May 28, 2026, 9:49pm
7
Anyone knows what is needed to make this work on a D1 mini (esp8266)?
Karosm
(Karosm)
May 28, 2026, 9:59pm
8
Just replace LEDC outputs with:
output:
- platform: esp8266_pwm
It's software pwm though...
Nick4
(Nick)
May 28, 2026, 10:02pm
9
You are quick on the ball!
The code for a Lolin D1 mini (esp8266)
output:
- platform: esp8266_pwm
pin: GPIO12
id: gpio_12
- platform: esp8266_pwm
pin: GPIO13
id: gpio_13
- platform: esp8266_pwm
pin: GPIO15
id: gpio_15
light:
- platform: rgb
name: "LED"
id: rgb_led
red: gpio_12
green: gpio_13
blue: gpio_15
What does that mean 'software pwm'?
Karosm
(Karosm)
May 28, 2026, 10:21pm
10
Esp8266 doesn't have dedicated peripheral for PWM like esp32 has. So it's using cpu resources and has some limitations compared to LEDC.
1 Like