Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config options to adjust brightness profile shape #94

Closed
edgimar opened this issue Feb 25, 2021 · 5 comments
Closed

config options to adjust brightness profile shape #94

edgimar opened this issue Feb 25, 2021 · 5 comments

Comments

@edgimar
Copy link

edgimar commented Feb 25, 2021

It would be nice if there were a brightness scale-factor that causes the 'normal' computed brightness-percent value X to be replaced by max(round(s*X), min_brightness), where s is the scale factor.

OR

if you want to get fancy, you could allow the user to choose either of the following:

  1. a single (time, brightness) pair, which would be used to automatically choose an appropriate amplitude scale factor under the assumption that the "width" and "center" of the brightness profile does not change.
  2. two (time, brightness) pairs that are on either side of the "center" time, which would be used to adjust the position/shape of the profile to fit both points.
@edgimar
Copy link
Author

edgimar commented Feb 25, 2021

One correction: the "brightness scale-factor" should only affect the delta from the max brightness. In other words, the calc_brightness_pct function should replace the following:

        percent = 1 + percent
        return (delta_brightness * percent) + self.min_brightness

with

        return max(self.brightness + round(brightness_scale_factor*(delta_brightness * percent)), self.min_brightness)

Note that in the replacement, percent = 1 + percent has been removed.

@RubenKelevra
Copy link
Collaborator

Hey @edgimar,

can you explain your use case and why this would help you? :)

@edgimar
Copy link
Author

edgimar commented Aug 1, 2021

Yes I seen to have left out that key piece of info! I am already using the 'brightness scale factor' change locally, and the reason is because otherwise the brightness values never get low enough to make my bulbs as dim as I'd like at the times I want them dim.

@basnijholt
Copy link
Owner

Check out the new brightness_mode feature introduced in 1.19.0: https://github.com/basnijholt/adaptive-lighting/blob/104664d3588442730f7ea9e811dd1986aca0c2e8/README.md#custom-brightness-ramps-using-brightness_mode-with-linear-and-tanh via #699

This should give you enough control to separate brightness and color.

Some more examples:
Notice the values of brightness_mode_time_light and brightness_mode_time_dark in the text box.
image
image
image
image

@basnijholt
Copy link
Owner

Check out this new webapp to visualize the parameters https://basnijholt.github.io/adaptive-lighting/

adaptive-lighting

adaptive-lighting.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants