From 983ee5380adf24c8d80eb559a542241487fcd619 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 18 Apr 2020 13:01:37 +0300 Subject: [PATCH] Basic night time light automation --- config/lovelace/home_dashboard/09_system.yaml | 2 + config/packages/modules/lighting/state.yaml | 52 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/config/lovelace/home_dashboard/09_system.yaml b/config/lovelace/home_dashboard/09_system.yaml index c6b47ae..bf4a341 100644 --- a/config/lovelace/home_dashboard/09_system.yaml +++ b/config/lovelace/home_dashboard/09_system.yaml @@ -40,6 +40,8 @@ cards: - automation.lighting_living_room_adjust_temperature_based_on_time - automation.lighting_living_room_turn_all_lights_on_on_magic_cube_flip_90 - automation.lighting_living_room_turn_all_lights_off_on_magic_cube_flip_180 + - automation.lighting_night_mode_kitchen_turn_lights_on_motion + - automation.lighting_night_mode_hallway_turn_lights_on_motion - automation.lighting_sync_tasmota_states_on_start_up - type: divider diff --git a/config/packages/modules/lighting/state.yaml b/config/packages/modules/lighting/state.yaml index 9022d31..879ff2e 100644 --- a/config/packages/modules/lighting/state.yaml +++ b/config/packages/modules/lighting/state.yaml @@ -57,3 +57,55 @@ automation: action: - service: light.turn_off entity_id: light.living_room_all_lights + + - alias: Lighting · Night mode · Kitchen · Turn lights on motion + trigger: + platform: state + entity_id: binary_sensor.motion_1_ias_zone + from: "off" + to: "on" + condition: + condition: state + entity_id: input_boolean.sleep_mode + state: "on" + action: + - service: light.turn_on + entity_id: light.light_le_12 + data: + brightness_pct: 13 + - delay: 00:00:10 + # reset brightness and turn off + - service: light.turn_on + entity_id: light.light_le_12 + data: + brightness_pct: 100 + - service: light.turn_off + entity_id: light.light_le_12 + + - alias: Lighting · Night mode · Hallway · Turn lights on motion + trigger: + platform: state + entity_id: binary_sensor.motion_2_ias_zone + from: "off" + to: "on" + condition: + condition: state + entity_id: input_boolean.sleep_mode + state: "on" + action: + - service: light.turn_on + entity_id: + - light.light_le_6 + - light.light_le_8 + data: + brightness_pct: 13 + - delay: 00:10:00 + # reset brightness and turn off + - service: light.turn_on + entity_id: + - light.light_le_6 + - light.light_le_8 + data: + brightness_pct: 100 + - service: light.turn_off + entity_id: light.tuya_hallway_all_lights