I’m currently working on a project using ESPHome to create a dynamic brightness control system for my LED lights. I’ve successfully integrated an PCA9685 LED driver and mapped the outputs to my lights. The max_power setting works perfectly for adjusting the maximum brightness while maintaining all the nice features like blinking and effects. However, I want to take it a step further by integrating a light sensor to automatically adjust the brightness based on the ambient light conditions.
For now, I’m using a numerical slider to manually adjust the brightness, but my goal is to automate this process. I’ve tried experimenting with the following code, but it doesn’t seem to work as intended:
yaml
number:
- platform: template
name: “Brightness”
id: brightness
optimistic: true
min_value: 0
max_value: 1
step: 0.01
on_value:
then:
- logger.log: “brightness changed”
- output.set_max_power:
id: pwm00
I’m wondering if there’s a better way to achieve this functionality. Perhaps I need to adjust the way I’m handling the output.set_max_power command or integrate the light sensor data more effectively. I’m also curious if others have successfully implemented similar systems and if they have any tips or recommendations.
If anyone has experience with dynamic brightness control or integrating light sensors in ESPHome, I’d love to hear your insights! Let’s collaborate to make this project a success. ![]()