From 247f84c088e07f2fbbfc08f4b2f4efa85c6ed019 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Tue, 28 Apr 2020 23:49:57 +0300 Subject: [PATCH] Hallway day mode light automation --- .../advanced_dashboard/09_system.yaml | 2 + config/packages/modules/lighting/state.yaml | 42 ++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/config/lovelace/advanced_dashboard/09_system.yaml b/config/lovelace/advanced_dashboard/09_system.yaml index 49f467f..6c1ca65 100644 --- a/config/lovelace/advanced_dashboard/09_system.yaml +++ b/config/lovelace/advanced_dashboard/09_system.yaml @@ -60,6 +60,8 @@ cards: - automation.lighting_kitchen_night_mode_motion_turn_lights_on - automation.lighting_kitchen_night_mode_motion_turn_lights_off - type: divider + - automation.lighting_hallway_day_mode_motion_turn_lights_on + - automation.lighting_hallway_day_mode_motion_turn_lights_off - automation.lighting_hallway_night_mode_motion_turn_lights_on - automation.lighting_hallway_night_mode_motion_turn_lights_off - type: divider diff --git a/config/packages/modules/lighting/state.yaml b/config/packages/modules/lighting/state.yaml index 3c20298..85209f6 100644 --- a/config/packages/modules/lighting/state.yaml +++ b/config/packages/modules/lighting/state.yaml @@ -109,7 +109,7 @@ automation: entity_id: binary_sensor.motion_1_ias_zone to: "off" for: - minutes: 10 + minutes: 5 condition: condition: template value_template: "{{ not is_state('input_select.house_mode', 'day') }}" @@ -121,6 +121,44 @@ automation: - service: light.turn_off entity_id: light.light_le_12 + - alias: Lighting · Hallway · Day mode · Motion · Turn lights on + trigger: + platform: state + entity_id: binary_sensor.motion_2_ias_zone + to: "on" + condition: + condition: and + conditions: + - condition: state + entity_id: input_select.house_mode + state: 'day' + - condition: state + entity_id: sun.sun + state: 'below_horizon' + action: + - service: light.turn_on + entity_id: light.hallway_all_lights + + - alias: Lighting · Hallway · Day mode · Motion · Turn lights off + trigger: + platform: state + entity_id: binary_sensor.motion_2_ias_zone + to: "off" + for: + minutes: 5 + condition: + condition: and + conditions: + - condition: state + entity_id: input_select.house_mode + state: 'day' + - condition: state + entity_id: sun.sun + state: 'below_horizon' + action: + - service: light.turn_off + entity_id: light.hallway_all_lights + - alias: Lighting · Hallway · Night mode · Motion · Turn lights on trigger: platform: state @@ -145,7 +183,7 @@ automation: entity_id: binary_sensor.motion_2_ias_zone to: "off" for: - minutes: 10 + minutes: 5 condition: condition: template value_template: "{{ not is_state('input_select.house_mode', 'day') }}"