I set up the ESPHome LEDC output component, which works well. I purchased the 24V version of this optocoupler, and its indicator LED lights up according to the chosen PWM value, but my LED strip is extremely dim, and the light of the LEDs is barely visible.
When directly connected to the power supply, the LEDs are blindingly bright.
Go back to basics, instead of PWM configure the output on the ESP as a simple on-off GPIO output. When the output is on, does the LED strip light the same brightness as when the strip is directly connected to the power supply?
If not the problem is with the optocoupler. If yes, post the yaml for your PWM light.
I set up something similar recently. Each row of led is basically an led strip.
Used mosfets and a pca9685. Was keen on the pca9685 to help save esp32 pins. I was able to power directly from the esp32 5v, but another power supply would be easy to include.
You use optos when there is a need to electrically isolate two systems from each other. This could be needed for security reasons (to prevent electrical shock) or i.e. because the ground levels of both systems cannot be connected because they are not potential free.
For some reason, the following board didn’t make my LED strip light up at all. The FET was bent in the envelope, but that shouldn’t make it non-functional.