diff --git a/apps/global/virtualsensors.yaml b/apps/global/virtualsensors.yaml index 8682ba1..4d38c2a 100644 --- a/apps/global/virtualsensors.yaml +++ b/apps/global/virtualsensors.yaml @@ -9,5 +9,17 @@ virtual_sensors: conditions: media_player.apple_tv == 'paused' or media_player.apple_tv == 'idle' or media_player.apple_tv == 'standby' binary_sensor.is_apple_tv_on: media_player.apple_tv != 'off' - binary_sensor.someone_home: person.maeva == 'home' or person.pierre == 'home' + binary_sensor.someone_home: person.maeva == 'home' or person.pierre == 'home' + + # living room sensors + value_selector.living_room_ambiance_light: + values: + 0: + - not binary_sensor.living_room_occupancy + - binary_sensor.is_apple_tv_on and not binary_sensor.is_apple_tv_idle + - light.living_room + - sensor.mezzanine_motion_light_level > 10 + 1: binary_sensor.is_everybody_sleeping + 2: true + diff --git a/apps/rooms/living_room.yaml b/apps/rooms/living_room.yaml index bb255d2..a3bb975 100644 --- a/apps/rooms/living_room.yaml +++ b/apps/rooms/living_room.yaml @@ -5,7 +5,9 @@ light_mezzanine_01: smart_conditions: trigger_conditions: sensor.mezzanine_last_motion < 3 - blocking_conditions: sensor.mezzanine_motion_light_level > 10 and not self + blocking_conditions: + - sensor.mezzanine_motion_light_level > 10 and not self + - light.living_room light_brightness_pct: 15: binary_sensor.is_everybody_sleeping @@ -19,7 +21,9 @@ light_mezzanine_02: smart_conditions: trigger_conditions: sensor.mezzanine_last_motion < 3 - blocking_conditions: sensor.mezzanine_motion_light_level > 10 and not self + blocking_conditions: + - sensor.mezzanine_motion_light_level > 10 and not self + - light.living_room light_brightness_pct: 5: binary_sensor.is_everybody_sleeping @@ -31,16 +35,29 @@ light_bookshelves: class: SmartLight entity: light.living_room_bookshelves - smart_conditions: - trigger_conditions: binary_sensor.living_room_occupancy - blocking_conditions: - - sensor.mezzanine_motion_light_level > 10 - - binary_sensor.is_apple_tv_on and not binary_sensor.is_apple_tv_idle + smart_conditions: sensor.living_room_ambiance_light >= 1 - #light_brightness_pct: - # 5: binary_sensor.is_everybody_sleeping - # 25: binary_sensor.day_interval_night - # 100: True + light_brightness_pct: + 25: sensor.living_room_ambiance_light == 1 + 100: True + +light_tree: + module: smartlight + class: SmartLight + entity: light.living_room_tree + + smart_conditions: sensor.living_room_ambiance_light >= 2 + + light_brightness_pct: 35 + +light_art_deco: + module: smartlight + class: SmartLight + entity: light.living_room_art_deco + + smart_conditions: sensor.living_room_ambiance_light >= 2 + + light_brightness_pct: 35 light_living_room: module: smartlight