basnijholt / adaptive-lighting

Adaptive Lighting custom component for Home Assistant
https://basnijholt.github.io/adaptive-lighting/
Apache License 2.0
1.81k stars 134 forks source link

Option to invert the brightness changes #88

Open LooneyN opened 3 years ago

LooneyN commented 3 years ago

Would it be possible to include a switch maybe to invert how the brightness changes in the evening? At the moment our lights get dimmer when it gets later. But I'd like this behavior reversed so that AL makes our lights go brighter as later (and therefore darker!) it gets outside. Would make much more sense to me personally

emansom commented 3 years ago

Do you wake up in the evening?

RubenKelevra commented 3 years ago

Hey @LooneyN,

can you describe your use case in a bit more detail?

As far as I understand it correctly you like to be awake longer and move the sunset to a later point in time (for one day?). Additionally, you like to have Adaptive Lighting react to a brightness sensor, instead of following a predetermined brightness setting, to have a consistent brightness in the room in the evening when the window isn't letting light in anymore - right?

The second thing would be https://github.com/basnijholt/adaptive-lighting/issues/122 - the first thing would need a new ticket that describes this functionality.

Thanks!

WizBangCrash commented 2 years ago

@RubenKelevra The use case I have for this feature is related to my garden patio lights. I would like them to get brighter as it gets darker when I am sitting out in the garden. I currently have an automation that increases the brightness by 10% every 20 mins after sunset, but I recently started using your integration (I love it BTW) and thought it would be great to have this increase the brightness of the patio lights as it gets later in the evening.

RubenKelevra commented 2 years ago

@WizBangCrash wrote:

@RubenKelevra The use case I have for this feature is related to my garden patio lights. I would like them to get brighter as it gets darker when I am sitting out in the garden. I currently have an automation that increases the brightness by 10% every 20 mins after sunset, but I recently started using your integration (I love it BTW) and thought it would be great to have this increase the brightness of the patio lights as it gets later in the evening.

I think we have something on the roadmap already to get a matching functionality from your user story:

Should make it possible to connect the lights on the porch and an ambient light sensor and set just goal in lux for the porch.

If the lights are "on" they would turn on and dim as necessary to get the requested apparent brightness on your porch.

Have a look on the roadmap in the discussions tab and vote on the functionalities you like to see, thanks!

WizBangCrash commented 2 years ago

@WizBangCrash wrote:

@RubenKelevra The use case I have for this feature is related to my garden patio lights. I would like them to get brighter as it gets darker when I am sitting out in the garden. I currently have an automation that increases the brightness by 10% every 20 mins after sunset, but I recently started using your integration (I love it BTW) and thought it would be great to have this increase the brightness of the patio lights as it gets later in the evening.

I think we have something on the roadmap already to get a matching functionality from your user story:

  • Incorporate ambient brightness sensors per room as feedback method to adjust for uncontrolled light sources and natural light
  • Switch from a brightness-percentage-goal to a target-brightness-in-lux-goal

Should make it possible to connect the lights on the porch and an ambient light sensor and set just goal in lux for the porch.

If the lights are "on" they would turn on and dim as necessary to get the requested apparent brightness on your porch.

Have a look on the roadmap in the discussions tab and vote on the functionalities you like to see, thanks!

@RubenKelevra I like what I see in the roadmap, but I think both those features are overkill for my garden use case. The reason being that even if I put an illuminance sensor in the garden I would never be able to meet a fixed light level once it started getting too dark with my patio lights. The patio is too big and the light strips are more for ambience than to illuminate anything (they just run around the edge of the patio). I was hoping to replace my simple automation with your cool integration and keep everything in one place :-)

I can see where I can use those features inside the house though, so will definitely try them out when you have added them.

RubenKelevra commented 2 years ago

@WizBangCrash Well having a "fixed target" for lux can obviously be bigger than what you can achieve with "just" artificial light.

The light would just turn on as soon as the sun starts beeing too dim and add a bit of light until its the only light source.

There's also a point on the roadmap which limits the maximum change rate, so you can set it something like 10%/minute to give you a slow dimming even if the sun sets fast :)

RubenKelevra commented 2 years ago

I'm already using this, crudely created in automations to test it out. I've set the maximum Lux to 80 while the artificial lighting can only achieve 38 lux on maximum brightness.

So as soon as the room gets down to 79 the light turns on and adds a bit of light to keep it at 80.

So the room will only dip down below 80 if the light can't supply more artificial lighting.

WizBangCrash commented 2 years ago

@RubenKelevra Okay. You've convinced me to try it once it becomes available :-) I will order a Zigbee illuminance sensor for the garden and get it installed and create a similar automation while I wait for the next version of AL 👍

RubenKelevra commented 2 years ago

@RubenKelevra Okay. You've convinced me to try it once it becomes available :-)

Now you have to convince me to write it :P

I will order a Zigbee illuminance sensor for the garden and get it installed and create a similar automation while I wait for the next version of AL 👍

Actually getting a non-zigbee sensor would probably be better. There's also a feature on the roadmap to get real time color / color temperature information into the integration with a sensor which support this.

Price is about the same as the zigbee ones.

You gonna need to install esphome in your HA instance and order a Wemos D1 mini (or a similar board featuring an Esp8266) plus the color sensor: TCS34725

Both should be around 10 bucks together.

The settings I use for ESPHome is shared in the Roadmap.


Not gonna say the zigbee ones are not gonna sork, but if you put it looking outside anyway, you can also use one which has the benefit of capturing the current ambient light temperature and color :)

Dperrigo18 commented 2 years ago

I would like to second to having just a inverted switch as I do work nights sometimes and on my days off I don't switch my schedule just to say consistent, so it is mostly just either dark or extremely bright in my place overnight. I think it would be cool to have my lights sync to what the sun would normally do but overnight with my light getting brighter after sunset and dimming during sunrise. A light sensor won't help in this case as I have my windows blocked off to sleep during the day.

Jonybat commented 11 months ago

I just ran into this use case (make ambient lighting brighter as it gets darker) and I simply inverted the min/max brightness values (eg min 100 and max 1) and it just works.

I understand it might not be intentional, and probably does not work with the non default brightness modes, but have you guys tried that?

orrpan commented 10 months ago

I just ran into this use case (make ambient lighting brighter as it gets darker) and I simply inverted the min/max brightness values (eg min 100 and max 1) and it just works.

I understand it might not be intentional, and probably does not work with the non default brightness modes, but have you guys tried that?

I do the same, only strange thing i sleep brightness keeps transitioning (maybe not related)

selectric401 commented 9 months ago

It probably isn't intentional, but I can at least anecdotally confirm that using "tanh" or "linear" brightness modes, inverting max/min brightness settings simply leaves the lights at "minimum" brightness all day and all night. Unfortunately, it doesn't quite work the way I want it to in "default", since I'd like to make use of the brightness_mode_time_dark and light settings.

The use case I'm trying to use Adaptive Lighting for is to have the lights at a dimmer setting when turned on during the day and have them get gradually brighter as the sun sets. (I have a separate automation that activates AL's sleep mode for when I want some darker lights late in the night before I'm going to bed.) Maybe this isn't an intended use case, and if there's another integration out there that can handle this sort of thing better, I'd love to hear about it. My place gets plenty of natural light during the day, but (especially in the winter, where sunset is around 16:30) it drops off pretty dramatically once the sun starts setting and I need more artificial light to compensate.

OBoudreaux commented 8 months ago

I would like to expand on this request to invert the brightness curve in the middle of the day to let the sun take over. The current brightness curve is perfect for a room without much natural light.

I'd like to ramp up the brightness fairly quickly (after my alarm) and ramp down after sunrise. In the evening the brightness would ramp up again as the sun sets and remain high until some offset from bedtime.

This is likely able to be accomplished with separate AM and PM profiles. I'll give it a show when the simulator is back up. I'd imagine this feature is "baked in" with #122 but I don't have any lux sensors.

RubenKelevra commented 8 months ago

Hey @OBoudreaux, you don't need a Lux sensor for automatic adjustments. Some weather plug-ins offer values of solar radiation which can be used to adjust the maximum brightness as necessary.

Inverting the curve however doesn't work, as most people like to also use adaptive lighting to extend the daytime and dim down to improve sleepyness in the evening.

Adapting to the brightness offered by the sun however is meeting your requirements without blocking the common use cases of other people, leading to weird behavior in some scenarios.

Lmk if you need any further help :)

OBoudreaux commented 8 months ago

Inverting the curve however doesn't work, as most people like to also use adaptive lighting to extend the daytime and dim down to improve sleepyness in the evening.

I believe "Inverting the curve" was the wrong way to say it. Having two peaks would be more accurate.

RubenKelevra commented 8 months ago

@OBoudreaux ah I see what you mean.

But I think you're underestimating the problem. If there's a thunderstorm or an overcast sky the illumination of the sun is much less than if the sky is bright and this is not even taking obstructions of the sun in winter into account.

I'm running a brightness sensor for around have a year now and the difference is tenfold in terms of brightness.

I think it would make more sense to get a 10 dollar sensor and put it on a window to measure the actual illumination by the sun and do some rough estimation based on that for each room.

If you doesn't want to add a sensor for each room, which I agree can be quite expensive.

basnijholt commented 6 months ago

[Copy pasting this message in a few recent open issues]

I just wanted to take a moment to express my heartfelt thanks to everyone that is active in this repo. Your contributions, from answering questions to addressing issues, have been invaluable. It's amazing to see how supportive and helpful our community is!

Adaptive Lighting is all about enhancing your living spaces with smart, sunlight-responsive lighting. We've had quite a few discussions and open issues recently, and I see this as a positive sign of our community's engagement and growth. If you come across anything in the documentation that's unclear or if you have suggestions for improvement, please don't hesitate to share!. Your feedback is crucial for making Adaptive Lighting better for everyone.

On a personal note, I've recently welcomed twin boys into my family, which has been an incredible and life-changing experience. As you can imagine, my time is now more limited, and while I'm doing my best to keep up with the project, there may be delays in my responses. I appreciate your understanding and patience during this time.

Rest assured, I'm fully committed to addressing any bugs, especially those related to new Home Assistant updates, as swiftly as possible. I understand that many issues may stem from hardware limitations or misunderstandings about things like Zigbee groups. Your continued support and collaboration in helping each other out not only strengthen our community but also enhance the Adaptive Lighting experience for all.

Thank you once again for your understanding, patience, and support. Let's keep our houses well lit and adaptive for maximal enjoyment of life! 🌞🏠🌙