basnijholt / adaptive-lighting

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

Allow lights to stay off in sleep mode #915

Open bavo opened 9 months ago

bavo commented 9 months ago

It would be cool if I could leave some lights turned off during sleep mode.

There are some lights in my house that cannot be dimmed very low, so it would be awesome if I could set the sleep_brightness to 0. (currently the docs say only 1-100 is allowed) This would leave the lights off during sleep mode. Or it could be an extra configuration boolean sleep_mode_keep_off or something?

If this is already possible and I missed something in the docs, please let me know 😄

bavo commented 9 months ago

I'm just now thinking this solution might not work, because the sleep brightness is not set for each light individually but globally for each room. And I feel like it would be overkill to force people to make multiple AL configurations for a single room.

A solution would be an extra multi-select list of lights which should not turn on in sleep mode?

Other solutions that might work?

th3w1zard1 commented 8 months ago

Not 100% sure, but perhaps this PR addresses what you're looking for?

568

Otherwise you could use an automation that fires whenever the sleep event is triggered. I don't have hass setup on any device atm but I remember in the event it'll pass the light group(s) entity ids which you can scan for. The automation would be setup to just keep the light off Nope this wouldn't work as the integration would still call light.turn_on before the automation starts.

I'm just now thinking this solution might not work, because the sleep brightness is not set for each light individually but globally for each room. And I feel like it would be overkill to force people to make multiple AL configurations for a single room.

So for the room in question what you could do is have two configurations: one that you're currently using and the other specifically for use with the sleep switch.

so it would be awesome if I could set the sleep_brightness to 0. (currently the docs say only 1-100 is allowed)

I can't see why you'd want a zero brightness sleep switch, that'd be the same as an off call which can already be done with an automation.