From b31f32bd5b70b4a621dc89708b596ee98eac0579 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Fri, 15 Dec 2023 22:38:22 -0500 Subject: [PATCH] Migrate K late bedtime automation to UI #154 --- automations.yaml | 49 ++++++++++++++++++++++++++++++++++++++------ packages/kallen.yaml | 28 ------------------------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/automations.yaml b/automations.yaml index 4bf02ef..feca1ce 100644 --- a/automations.yaml +++ b/automations.yaml @@ -4240,20 +4240,57 @@ - timer-finished alias: Timer finished sequence: - - service: light.turn_on + - alias: Turn on Christmas lights + service: light.turn_on target: - entity_id: light.christmas_tree + entity_id: + - light.christmas_tree + - light.christmas_lights_front_window data: {} - alias: Turn on Christmas tree - conditions: - condition: trigger id: - sunrise alias: Sunrise sequence: - - service: light.turn_off + - alias: Turn off Christmas tree + service: light.turn_off target: - entity_id: light.christmas_tree + entity_id: + - light.christmas_tree + - light.christmas_lights_front_window data: {} - alias: Turn off Christmas tree mode: single +- id: '1702697525835' + alias: Kallen Late Bedtime + description: For those nights we want to let Kallen stay up later for whatever reason + trigger: + - platform: state + entity_id: input_boolean.kallen_late_bedtime + from: 'off' + to: 'on' + id: late-on + alias: Late Bedtime On + - platform: state + entity_id: input_boolean.kallen_late_bedtime + from: 'on' + to: 'off' + id: late-off + alias: Late Bedtime Off + condition: + - condition: time + after: input_datetime.kallen_wakeup_time + before: input_datetime.kallen_bedtime + alias: Time is between wakeup and bedtime + action: + - if: + - condition: state + entity_id: input_boolean.kallen_scheduling_evening_ran + state: 'on' + then: + - service: script.kallen_scheduling_evening + data: {} + - service: script.house_scheduling_evening + data: {} + alias: If scheduling has already run, set the new times + mode: restart diff --git a/packages/kallen.yaml b/packages/kallen.yaml index e9786e1..d67641c 100644 --- a/packages/kallen.yaml +++ b/packages/kallen.yaml @@ -163,34 +163,6 @@ automation: {% from 'time.jinja' import current_time %} {{ current_time('datetime',24) }} - - id: 1d552b1f-c0ed-4d80-b8ba-3c085d2c3d3a - alias: "Kallen Late Bedtime" - description: "For those nights we want to let Kallen stay up later for whatever reason" - mode: restart - trigger: - - platform: state - entity_id: input_boolean.kallen_late_bedtime - from: 'off' - to: 'on' - id: late-on - - platform: state - entity_id: input_boolean.kallen_late_bedtime - from: 'on' - to: 'off' - id: late-off - condition: - - condition: time - after: input_datetime.kallen_wakeup_time - before: input_datetime.kallen_bedtime - action: - - if: - - condition: state - entity_id: input_boolean.kallen_scheduling_evening_ran - state: 'on' - then: - - service: script.kallen_scheduling_evening - - service: script.house_scheduling_evening - - id: 94b57d79-efe0-4f34-b5e3-baeaa5eea9f4 alias: Kallen Asleep trigger: