From 34f66f8ff875c9e7a8110fd5387ada4ffb49e176 Mon Sep 17 00:00:00 2001 From: shbatm Date: Wed, 16 Apr 2025 12:25:01 -0500 Subject: [PATCH 1/8] Allow using alarm sensor as trigger time --- parabolic_alarm.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parabolic_alarm.yaml b/parabolic_alarm.yaml index ab53870..f22186e 100644 --- a/parabolic_alarm.yaml +++ b/parabolic_alarm.yaml @@ -6,13 +6,15 @@ blueprint: alarm_start_time: name: 🕒 Start Time description: - Datetime helper for the alarm to start. Use time only and Workday sensor + Datetime helper or sensor for the alarm to start. Use time only and Workday sensor to determine what days to run. selector: entity: filter: - domain: - input_datetime + - domain: sensor + device_class: timestamp multiple: false workday_sensor: name: 📆 Workday Sensor From 1b34146670da9122ebdfc0ec73e932258d0ea991 Mon Sep 17 00:00:00 2001 From: shbatm Date: Wed, 16 Apr 2025 12:43:39 -0500 Subject: [PATCH 2/8] Add option to finish at the givent time --- parabolic_alarm.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/parabolic_alarm.yaml b/parabolic_alarm.yaml index f22186e..39ddd5d 100644 --- a/parabolic_alarm.yaml +++ b/parabolic_alarm.yaml @@ -16,6 +16,12 @@ blueprint: - domain: sensor device_class: timestamp multiple: false + complete_at_start_time: + name: 🏁 Finish at Start Time + description: + Complete the transitions by the time given in the Start Time as opposed to starting at the Start Time. + selector: + boolean: workday_sensor: name: 📆 Workday Sensor description: @@ -168,6 +174,7 @@ blueprint: trigger: - trigger: time at: !input alarm_start_time + offset: "{{ -(alarm_length_1 + alarm_length_2 + alarm_length_3)*60 if complete_at_start_time else 0 }}" condition: - condition: state entity_id: !input workday_sensor @@ -220,5 +227,4 @@ action: steps_per_minute: !input steps_per_minute light_timeout: !input light_timeout target_light: !input target_light -mode: parallel -max: 10 +mode: single From 938f68ec39f69c9d4c1fc58c627fef2cbdf567dc Mon Sep 17 00:00:00 2001 From: shbatm Date: Wed, 16 Apr 2025 12:56:04 -0500 Subject: [PATCH 3/8] Fix offset formatting --- parabolic_alarm.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parabolic_alarm.yaml b/parabolic_alarm.yaml index 39ddd5d..11d3bf1 100644 --- a/parabolic_alarm.yaml +++ b/parabolic_alarm.yaml @@ -173,8 +173,9 @@ blueprint: source_url: https://github.com/steku/ha_cercadian_alarm/blob/main/parabolic_alarm.yaml trigger: - trigger: time - at: !input alarm_start_time - offset: "{{ -(alarm_length_1 + alarm_length_2 + alarm_length_3)*60 if complete_at_start_time else 0 }}" + at: + entity_id: !input alarm_start_time + offset: "{{ -(alarm_length_1 + alarm_length_2 + alarm_length_3)*60 if complete_at_start_time else 0 }}" condition: - condition: state entity_id: !input workday_sensor From e91adc42eaa7cb3cf71166dde4cac3a07be101eb Mon Sep 17 00:00:00 2001 From: shbatm Date: Wed, 16 Apr 2025 13:10:57 -0500 Subject: [PATCH 4/8] Correct formatting for Offset --- parabolic_alarm.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/parabolic_alarm.yaml b/parabolic_alarm.yaml index 11d3bf1..7291795 100644 --- a/parabolic_alarm.yaml +++ b/parabolic_alarm.yaml @@ -66,7 +66,7 @@ blueprint: default: 10 selector: number: - min: 1.0 + min: 0.0 max: 60.0 step: 1.0 mode: slider @@ -171,11 +171,17 @@ blueprint: mode: slider default: 5 source_url: https://github.com/steku/ha_cercadian_alarm/blob/main/parabolic_alarm.yaml +trigger_variables: + input_alarm_length_1: !input alarm_length_1 + input_alarm_length_2: !input alarm_length_2 + input_alarm_length_3: !input alarm_length_3 + input_complete_at_start_time: !input complete_at_start_time + calculated_runtime: "{{ -(input_alarm_length_1 + input_alarm_length_2 + input_alarm_length_3)*60 if input_complete_at_start_time else 0 }}" trigger: - trigger: time at: entity_id: !input alarm_start_time - offset: "{{ -(alarm_length_1 + alarm_length_2 + alarm_length_3)*60 if complete_at_start_time else 0 }}" + offset: "{{ calculated_runtime }}" condition: - condition: state entity_id: !input workday_sensor From 2f9adcfac8ed93683075e59fde09b308227167ae Mon Sep 17 00:00:00 2001 From: shbatm Date: Wed, 16 Apr 2025 13:19:47 -0500 Subject: [PATCH 5/8] Update parabolic_alarm.yaml --- parabolic_alarm.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parabolic_alarm.yaml b/parabolic_alarm.yaml index 7291795..3ca884d 100644 --- a/parabolic_alarm.yaml +++ b/parabolic_alarm.yaml @@ -181,7 +181,8 @@ trigger: - trigger: time at: entity_id: !input alarm_start_time - offset: "{{ calculated_runtime }}" + offset: >- + "{{ calculated_runtime }}" condition: - condition: state entity_id: !input workday_sensor From 343b710ab9d60aa5acb442b951b83467d7e1df18 Mon Sep 17 00:00:00 2001 From: shbatm Date: Wed, 16 Apr 2025 14:10:42 -0500 Subject: [PATCH 6/8] Update parabolic_alarm.yaml --- parabolic_alarm.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/parabolic_alarm.yaml b/parabolic_alarm.yaml index 3ca884d..77c4a20 100644 --- a/parabolic_alarm.yaml +++ b/parabolic_alarm.yaml @@ -172,6 +172,7 @@ blueprint: default: 5 source_url: https://github.com/steku/ha_cercadian_alarm/blob/main/parabolic_alarm.yaml trigger_variables: + input_alarm_entity: !input alarm_start_time input_alarm_length_1: !input alarm_length_1 input_alarm_length_2: !input alarm_length_2 input_alarm_length_3: !input alarm_length_3 @@ -179,10 +180,8 @@ trigger_variables: calculated_runtime: "{{ -(input_alarm_length_1 + input_alarm_length_2 + input_alarm_length_3)*60 if input_complete_at_start_time else 0 }}" trigger: - trigger: time - at: - entity_id: !input alarm_start_time - offset: >- - "{{ calculated_runtime }}" + at: >- + {{ { "entity_id": input_alarm_entity, "offset": calculated_runtime } }} condition: - condition: state entity_id: !input workday_sensor From 4f10220e5b7f6c2aab3a7eed35e75f591181c400 Mon Sep 17 00:00:00 2001 From: shbatm Date: Wed, 16 Apr 2025 14:25:25 -0500 Subject: [PATCH 7/8] Change to offset value instead of calculated --- parabolic_alarm.yaml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/parabolic_alarm.yaml b/parabolic_alarm.yaml index 77c4a20..86263bd 100644 --- a/parabolic_alarm.yaml +++ b/parabolic_alarm.yaml @@ -16,12 +16,17 @@ blueprint: - domain: sensor device_class: timestamp multiple: false - complete_at_start_time: - name: 🏁 Finish at Start Time + offset_from_start_time: + name: 🏁 Offset From Start Time description: - Complete the transitions by the time given in the Start Time as opposed to starting at the Start Time. + Adjust the amount of time before or after the set Start Time value to start the transition. Useful if the start time comes from an alarm entity and you want to adjust where in the brightness cycle you are when the alarm goes off. + default: 0 selector: - boolean: + number: + min: -60.0 + max: 60.0 + step: 1.0 + mode: slider workday_sensor: name: 📆 Workday Sensor description: @@ -171,17 +176,11 @@ blueprint: mode: slider default: 5 source_url: https://github.com/steku/ha_cercadian_alarm/blob/main/parabolic_alarm.yaml -trigger_variables: - input_alarm_entity: !input alarm_start_time - input_alarm_length_1: !input alarm_length_1 - input_alarm_length_2: !input alarm_length_2 - input_alarm_length_3: !input alarm_length_3 - input_complete_at_start_time: !input complete_at_start_time - calculated_runtime: "{{ -(input_alarm_length_1 + input_alarm_length_2 + input_alarm_length_3)*60 if input_complete_at_start_time else 0 }}" trigger: - trigger: time - at: >- - {{ { "entity_id": input_alarm_entity, "offset": calculated_runtime } }} + at: + entity_id: !input alarm_start_time + offset: !input offset_from_start_time condition: - condition: state entity_id: !input workday_sensor From d8665a518ff866751095ba232341675ee49a167e Mon Sep 17 00:00:00 2001 From: shbatm Date: Wed, 16 Apr 2025 14:57:15 -0500 Subject: [PATCH 8/8] Change offset to text --- parabolic_alarm.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/parabolic_alarm.yaml b/parabolic_alarm.yaml index 86263bd..586b095 100644 --- a/parabolic_alarm.yaml +++ b/parabolic_alarm.yaml @@ -19,14 +19,10 @@ blueprint: offset_from_start_time: name: 🏁 Offset From Start Time description: - Adjust the amount of time before or after the set Start Time value to start the transition. Useful if the start time comes from an alarm entity and you want to adjust where in the brightness cycle you are when the alarm goes off. - default: 0 + Adjust the amount of time before or after the set Start Time value to start the transition. Enter seconds or HH:MM:SS format (e.g. "-00:05:00" to start 5 minutes before the Start Time. Useful if the start time comes from an alarm entity and you want to adjust where in the brightness cycle you are when the alarm goes off. See https://www.home-assistant.io/docs/automation/trigger/#sensors-of-datetime-device-class-with-offsets for caution about using positive offsets. + default: "-00:05:00" selector: - number: - min: -60.0 - max: 60.0 - step: 1.0 - mode: slider + text: workday_sensor: name: 📆 Workday Sensor description: