jseidl / hass-magic_areas

Areas with batteries included for Home Assistant
MIT License
260 stars 28 forks source link

Utilize scene.turn_on instead of turning on ALL lights when presence detected #216

Closed rsnodgrass closed 2 years ago

rsnodgrass commented 2 years ago

Currently magic_areas assumes that ALL lights assigned to a room should be turned on to full upon entry to the room. This will leverage HA's ever improving scene support. If a scene is defined, this scene would override the default of light.turn_on/off behavior of magic_areas and use the scene instead.

Ideally, a scene could be assigned for room entry that allows setting which lights to turn on, at what dimmable level, as well as other devices in a room that might be turned on (e.g. a fan, or climate setting). For leaving a room, a second scene would be needed to set the "away" settings for a room.

I think three scenes would be needed:

These would need to be optionally assigned to auto_areas rooms instead of the default lights.turn_on/turn_off, since I don't think programmatically defined scenes can be edited within UI to assign lights/etc.

I believe Scenes can be assigned to Areas in HA, so with consistent naming (e.g. includes one of the above terms like Sleep), so that might be a way to "automate" this.

jseidl commented 2 years ago

Hi, are you on the current release or in the beta one?

The beta release has support for different light groups which might solve one of your concerns (turning on all lights).

As per the brightness, the main idea is to use Adaptive Lighting to control that.

Give the beta release a try with Adaptive Lighting and let me know if that addresses the needs. Scene support can be a feature request but isn't on the backlog as of now.