basnijholt / adaptive-lighting

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

Improve manual control #54

Closed broyuken closed 1 year ago

broyuken commented 3 years ago

Is there a way we could change AL so that when a light is turned on and the state is updated in HA it checks to see if it has been manually controlled? For example my wife will turn on a light and instantly set it to a brightness she wants. The next time AL checks it will auto adjust that light because it’s not at a level it thinks it should be at. Then if she adjusts it again it finally turns on manual control. This really hurts the WAF (wife acceptance factor). I tried setting the update interval to 1 second but that didn’t help either. Right now it is the default which I believe is 45 seconds?

basnijholt commented 3 years ago

Unfortunately, I think this is unavoidable. How would you for example indicate to enable Adaptive Lighting upon turning on the light?

broyuken commented 3 years ago

When the state of the light goes from off to on in HA?

basnijholt commented 3 years ago

Ah, I think I misunderstood what the problem was. I will give it some more thought while looking at the code.

broyuken commented 3 years ago

Yea I think just having a poll happen instantly when the light was turned on would solve the problem.

basnijholt commented 3 years ago

Does this sequence happen in Home Assistant:

  1. light.turn_on(entity_id=some_light)
  2. light.turn_on(entity_id=some_light, brightness=some_value_your_wife_wants)

If so, I don't understand why that doesn't already work...

Or are you using something external from Home Assistant?

broyuken commented 3 years ago

No the sequence of events that is causing the issue is...

  1. light turned on at switch
  2. HA state updates from off to on
  3. Wife changes level of light from wall switch
  4. On next update AL updates light to the level it thinks it should be at
  5. Angry wife
  6. Wife changes light level again from wall
  7. AL sees light is manually adjusted
  8. Light stays at correct level now
basnijholt commented 3 years ago
  1. Wife changes level of light from wall switch

Does this communicate via Home Assistant or some external app/device?

broyuken commented 3 years ago

It’s a zwave wall switch using the open zwave beta integration.

jamescadd commented 3 years ago

Is it possible to have AL only adapt the light temperature, not the brightness? I have a similar issue where I'd like to have the temperature vary throughout the day, but it should never override the brightness of the light. My use case is Lutron Aurora dimmers controlling the brightness through the Hue hub. Regardless of control I prefer not to have AL adjust the brightness of the lights.

broyuken commented 3 years ago

Yes there’s a switch with each instance that you can turn off. It should be something like switch.adaptive_lighting_adapt_brightness_living_room

broyuken commented 3 years ago

It’s a zwave wall switch using the open zwave beta integration.

Little more info to clear this up, it’s a zwave dimmer switch, and she is manually adjusting the brightness using the switch itself. No smart bulbs involved here, just the switch. The switch uses the open zwave beta integration to HA.

RicardoCst commented 3 years ago

Yes its very annoying.

No the sequence of events that is causing the issue is...

1. light turned on at switch

2. HA state updates from off to on

3. Wife changes level of light from wall switch

4. On next update AL updates light to the level it thinks it should be at

5. Angry wife

6. Wife changes light level again from wall

7. AL sees light is manually adjusted

8. Light stays at correct level now
jd1900 commented 3 years ago

I think this is very related to the this issue: https://github.com/basnijholt/adaptive-lighting/issues/96

IMHO, disabling brightness control and updating temperature not "turning on" the device (just changing temperature) could fix it.

RubenKelevra commented 3 years ago

@basnijholt no sure, but wasn't this fixed in the meantime with the "take_over_control" setting?

RubenKelevra commented 2 years ago

This ticket is stale but still feels important.

I think it will be fixed by having just different types over manual overrides in v2.

Keep this ticket open until you can verify that it's properly working in the upcoming version 2.

th3w1zard1 commented 1 year ago

This is exactly the issue I was having which is why I created #450. When it's merged it should close this issue.

th3w1zard1 commented 1 year ago

@broyuken This should be fixed in 1.10.0