From 816c7d685ab46ed21ce898d198230d505f3a268c Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 14 Mar 2020 19:12:28 +0200 Subject: [PATCH] Lighting - turn on and off with the sun --- lovelace/04_system.yaml | 4 +++- packages/modes/domestina.yaml | 2 ++ packages/modules/lighting.yaml | 26 +++++++++++++++++++++++++- packages/modules/presence.yaml | 2 +- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/lovelace/04_system.yaml b/lovelace/04_system.yaml index b2eb325..fc44a50 100644 --- a/lovelace/04_system.yaml +++ b/lovelace/04_system.yaml @@ -28,7 +28,9 @@ cards: icon: mdi:lightbulb open: true entities: - - automation.master_bedroom_bedside_light_on_bedside_switch_single_click + - automation.lighting_turn_on_after_sunset + - automation.lighting_turn_off_after_sunrise + - automation.lighting_master_bedroom_bedside_light_on_bedside_switch_single_click - automation.lighting_living_room_turn_on_cube_flip_90 - automation.lighting_living_room_turn_off_cube_flip_180 diff --git a/packages/modes/domestina.yaml b/packages/modes/domestina.yaml index 52265ea..4c1c8bb 100644 --- a/packages/modes/domestina.yaml +++ b/packages/modes/domestina.yaml @@ -15,6 +15,8 @@ group: - automation.music_pause_on_cube_knock - automation.music_volume_down_on_cube_rotate_left - automation.music_volume_up_on_cube_rotate_right + - automation.lighting_turn_on_after_sunset + - automation.lighting_turn_off_after_sunrise - automation.lighting_living_room_turn_on_cube_flip_90 - automation.lighting_living_room_turn_off_cube_flip_180 - automation.bedtime_toggle_on_master_bedroom_bedside_switch_hold diff --git a/packages/modules/lighting.yaml b/packages/modules/lighting.yaml index 25320ed..602cf5c 100644 --- a/packages/modules/lighting.yaml +++ b/packages/modules/lighting.yaml @@ -22,7 +22,31 @@ light: - light.bedside_light automation: - - id: master_bedroom_bedside_light_on_bedside_switch_single_click + - id: lighting_turn_on_after_sunset + alias: Lighting · Turn on all lights after sunset + trigger: + platform: sun + event: sunset + offset: "+00:00:00" + condition: + - condition: state + entity_id: binary_sensor.georgi_home + state: "on" + action: + - service: light.turn_on + entity_id: light.all_lights + + - id: lighting_turn_off_after_sunrise + alias: Lighting · Turn off all lights after sunrise + trigger: + platform: sun + event: sunrise + offset: "+00:00:00" + action: + - service: light.turn_off + entity_id: light.all_lights + + - id: lighting_master_bedroom_bedside_light_on_bedside_switch_single_click alias: Lighting · Master bedroom · Toggle bedside light on bedisde switch single click" trigger: platform: event diff --git a/packages/modules/presence.yaml b/packages/modules/presence.yaml index 5103011..54b0f64 100644 --- a/packages/modules/presence.yaml +++ b/packages/modules/presence.yaml @@ -97,7 +97,7 @@ automation: alias: Presence · Coming home trigger: platform: state - entity_id: input_boolean.georgi_home + entity_id: binary_sensor.georgi_home to: "on" action: - service: script.routine_coming_home