From bcc9fdcc0ee87b68c0b9f32083199a8d7bedfe05 Mon Sep 17 00:00:00 2001 From: Andrei Nicholson Date: Thu, 22 Feb 2024 20:17:00 -0500 Subject: [PATCH] Turn off morning lights after sunrise (#46) --- automation/lights.yaml | 17 ++++++++++++----- customize/automations.yaml | 4 ++-- lovelace/views/automations.yaml | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/automation/lights.yaml b/automation/lights.yaml index 41962a2..c25c3cd 100644 --- a/automation/lights.yaml +++ b/automation/lights.yaml @@ -24,10 +24,14 @@ transition: 1800 - alias: Turn Off Lights Before Work + id: turn_off_lights_before_work + description: >- + Turn off lights weekday mornings 15 minutes after sunrise. initial_state: true trigger: - platform: time - at: "07:45:00" + platform: sun + event: sunrise + offset: "00:15:00" condition: - condition: time weekday: @@ -89,11 +93,14 @@ entity_id: light.controller_rgb_44_key_ir_cde6d9 brightness: 13 -- alias: Turn Off Night-Light 8:00am +- alias: Turn Off Night-Light After Sunrise + id: turn_off_night_light_after_sunrise + description: Turn off night-light 15 minutes after sunrise. initial_state: true trigger: - platform: time - at: "08:00:00" + platform: sun + event: sunrise + offset: "00:15:00" action: service: light.turn_off data: diff --git a/customize/automations.yaml b/customize/automations.yaml index b0d29e4..171e41c 100644 --- a/customize/automations.yaml +++ b/customize/automations.yaml @@ -37,8 +37,8 @@ automation.turn_on_night_light_at_sunset: friendly_name: Turn On Night-Light at Sunset icon: mdi:led-strip -automation.turn_off_night_light_8_00am: - friendly_name: Turn Off Night-Light 8:00am +automation.turn_off_night_light_after_sunrise: + friendly_name: Turn Off Night-Light After Sunrise icon: mdi:led-strip automation.turn_on_dining_room_lamp_before_sunset: diff --git a/lovelace/views/automations.yaml b/lovelace/views/automations.yaml index 278cfd1..e81014a 100644 --- a/lovelace/views/automations.yaml +++ b/lovelace/views/automations.yaml @@ -29,7 +29,7 @@ cards: - entity: automation.turn_off_outside_lights_sunrise - entity: automation.turn_on_outside_lights_sunset - entity: automation.turn_on_night_light_at_sunset - - entity: automation.turn_off_night_light_8_00am + - entity: automation.turn_off_night_light_after_sunrise - entity: automation.turn_on_dining_room_lamp_before_sunset - entity: automation.turn_off_dining_room_lamp