Hey everyone,
I wanted to share my recent project where I integrated a random LED effect controller using an ESP32 with WLED into my daughter’s room. It’s been a fun and creative way to enhance her space with dynamic lighting!
The Goal:
I have a WS2811 LED strip controlled by an ESP32 running WLED. WLED has around 50 preset effects, and I wanted a way to randomly select an effect each time a button is pressed. This would add an element of surprise and variety to the lighting.
The Challenge:
Initially, I wasn’t sure how to implement the random number generation within the existing setup. I needed a rule or script that could pick a number between 1 and 50 and use it as a parameter for the effect selection.
The Solution:
After some research and experimentation, I found that using a Pico remote button along with a custom rule in Hubitat was the way to go. Here’s a simplified version of how I achieved it:
-
Hardware Setup:
- ESP32 with WLED flashed onto it.
- Pico remote button connected to the ESP32.
-
Software Integration:
- Configured a custom driver in Hubitat that integrates WLED with the ESP32.
- Set up a rule where pressing the Pico button triggers a random number generator between 1 and 50.
- The generated number is then sent as a parameter to the LED strip, selecting a new effect each time.
-
Testing and Fine-Tuning:
- Tested the random number generation to ensure it covers the full range and doesn’t repeat too often.
- Verified that each number corresponds correctly to an effect in WLED.
Outcome:
It works perfectly! Every time my daughter presses the button, the LED strip cycles through different effects, adding a playful and dynamic element to her room. It’s been a great way to incorporate some tech fun into her space.
Tips for Others:
- Ensure your ESP32 firmware is up-to-date to support the necessary scripts.
- Test each component separately before integrating them to troubleshoot any issues early on.
- Consider using a rule engine like Hubitat for easier automation and integration with other smart home devices.
I hope this project inspires others to explore creative ways to enhance their spaces with smart lighting! Feel free to reach out if you have questions or need help setting something similar up.
Best regards,
[Your Name]