Closed dennisse closed 1 year ago
What do you think is a more reasonable max? 220 (~85%)? :)
@dennisse You could add a number entity that sets the max brightness (and perhaps a minimum brightness). That way everyone can set it to what works in their personal room.
Alright. I've added aab_min
and aab_max
as globals to control minimum and maximum broghtness, and added aab_add
to control how much to boost the brightness with. Also, I renamed autoadjust_brightness
to aab_enable
for consistency.
I'm reluctant to add this as something that shows up in HA. My feeling is that these aren't variables you'll play around with very often, and if you're playing around with esphome you can change these when you set up the device. I don't want this to be too complicated. I think it's enough to be able to turn autoadjustable brightness on/off in HA.
nice thanx
This adds auto-adjustable brightness.
State (on/off) is stored in a global variable. There's a switch to enable/disable the function from HA.
Brightness is calculated from the ambient light sensor. Looking at the illuminance-table at wikipedia, it seems reasonable to divide ambient light by 4 and add a bit, so the algorithm I've used is:
x / 4 * 1.1
. Also, to avoid setting a new brightness every 10 seconds, we only adjust brightness if it is off by more than 2%.