16 Commits

Author SHA1 Message Date
a47dedcae5 conditions and advanced target 2025-11-10 11:22:29 -05:00
18ebe99a41 conditions and advanced target 2025-11-10 10:54:26 -05:00
c04b71095c conditions and advanced target 2025-11-10 10:53:05 -05:00
1be86b7d48 conditions and advanced target 2025-11-10 10:36:54 -05:00
d32bb93747 conditions and advanced target 2025-11-10 10:36:08 -05:00
c0137387b3 conditions and advanced target 2025-11-10 10:29:44 -05:00
1a63451f87 conditions and advanced target 2025-11-10 10:24:09 -05:00
43c777f75c conditions and advanced target 2025-11-10 10:19:29 -05:00
6c4b80af50 conditions and advanced target 2025-11-10 10:12:32 -05:00
cf0ae4043f conditions and advanced target 2025-11-10 10:11:35 -05:00
bcef0c5e1a conditions and advanced target 2025-11-10 09:43:08 -05:00
3fe5bef2ba conditions and advanced target 2025-11-10 09:36:50 -05:00
8171597885 conditions and advanced target 2025-11-10 09:31:47 -05:00
9ff1580896 conditions and advanced target 2025-11-10 09:19:42 -05:00
7181024497 revert multiples as they are treated like "ands" in the condtions (#11) 2025-04-29 15:56:49 -04:00
7bb03ddf05 Add minimum brightness and pre-post actions (#9)
* Add  pre-post actions
  * post will only be executed if light is not turned off to disable the automation
* Add minimum starting brightness for light
* Make Workday sensor optional by using multiple
2025-04-22 10:15:33 -04:00
2 changed files with 47 additions and 41 deletions

View File

@ -3,6 +3,18 @@ blueprint:
description: Turn a light on based on a start time, whether it is a workday and whether a person is home. This is to match the sunrise and allow for a natural wake up. description: Turn a light on based on a start time, whether it is a workday and whether a person is home. This is to match the sunrise and allow for a natural wake up.
domain: automation domain: automation
input: input:
pre_action:
name: 🎮 Pre Script Action
description: An action you want to perform before the lights turn on.
default: []
selector:
action: {}
conditions:
name: Conditions
description: Set your own conditions for this automation. All conditions must pass unless you add your own OR block
default: []
selector:
condition:
alarm_start_time: alarm_start_time:
name: 🕒 Start Time name: 🕒 Start Time
description: description:
@ -18,31 +30,10 @@ blueprint:
multiple: false multiple: false
offset_from_start_time: offset_from_start_time:
name: 🏁 Offset From Start Time name: 🏁 Offset From Start Time
description: description: 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.
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:00:00" default: "-00:00:00"
selector: selector:
text: text:
workday_sensor:
name: 📆 Workday Sensor
description:
Binary Sensor that is used to determine whether it should run. Typically
from Workday Integration. More information here - https://www.home-assistant.io/integrations/workday/
selector:
entity:
filter:
- domain:
- binary_sensor
multiple: false
person_sensor:
name: 👤 Person Sensor
description: Select the person sensor so that the alarm will only run when you are home.
selector:
entity:
filter:
- domain:
- person
multiple: true
alarm_script: alarm_script:
name: 📄 Script to trigger name: 📄 Script to trigger
description: Light Alarm Script description: Light Alarm Script
@ -53,14 +44,12 @@ blueprint:
- script - script
multiple: false multiple: false
target_light: target_light:
name: 💡 Lights description: A single light or group
description: The light(s) with kelvin
selector: selector:
entity: target:
filter: entity:
- domain: domain: light
- light name: Target Light
multiple: false
light_timeout: light_timeout:
name: ⏱️ Timeout name: ⏱️ Timeout
description: Light will turn off after this time on last run. Setting this to 0 will leave the light on. description: Light will turn off after this time on last run. Setting this to 0 will leave the light on.
@ -83,6 +72,16 @@ blueprint:
max: 60.0 max: 60.0
step: 1.0 step: 1.0
mode: slider mode: slider
start_brightness:
name: ⭐️ Start Brightness
description: Starting value for brightness
selector:
number:
min: 1.0
max: 100.0
step: 1.0
mode: slider
default: 1.0
start_kelvin_temp: start_kelvin_temp:
description: Start Kelvin value (warm) for 1st run description: Start Kelvin value (warm) for 1st run
selector: selector:
@ -171,6 +170,12 @@ blueprint:
step: 1.0 step: 1.0
mode: slider mode: slider
default: 5 default: 5
post_action:
name: 🎮 Post Script Action
description: An action you want to run after the script has finished
default: []
selector:
action: {}
source_url: https://github.com/steku/ha_cercadian_alarm/blob/main/parabolic_alarm.yaml source_url: https://github.com/steku/ha_cercadian_alarm/blob/main/parabolic_alarm.yaml
trigger: trigger:
- trigger: time - trigger: time
@ -178,17 +183,16 @@ trigger:
entity_id: !input alarm_start_time entity_id: !input alarm_start_time
offset: !input offset_from_start_time offset: !input offset_from_start_time
condition: condition:
- condition: state condition: and
entity_id: !input workday_sensor conditions: !input conditions
state: "on"
- condition: state
entity_id: !input person_sensor
state: "home"
action: action:
- choose:
- conditions: []
sequence: !input pre_action
- action: light.turn_on - action: light.turn_on
data: data:
color_temp_kelvin: !input start_kelvin_temp color_temp_kelvin: !input start_kelvin_temp
brightness_pct: 1 brightness_pct: !input start_brightness
entity_id: !input target_light entity_id: !input target_light
- delay: - delay:
seconds: 5 seconds: 5
@ -216,9 +220,8 @@ action:
light_timeout: 0 light_timeout: 0
target_light: !input target_light target_light: !input target_light
- if: - if:
- condition: state - condition: template
state: "on" value_template: "{{ expand(target_light.entity_id) | selectattr('state', '==', 'on') | list | count > 0 }}"
entity_id: !input target_light
then: then:
- action: !input alarm_script - action: !input alarm_script
data: data:
@ -229,4 +232,7 @@ action:
steps_per_minute: !input steps_per_minute steps_per_minute: !input steps_per_minute
light_timeout: !input light_timeout light_timeout: !input light_timeout
target_light: !input target_light target_light: !input target_light
- choose:
- conditions: []
sequence: !input post_action
mode: single mode: single

View File

@ -112,7 +112,7 @@ sequence:
seconds: "{{ individual_step }}" seconds: "{{ individual_step }}"
- if: - if:
- condition: template - condition: template
value_template: "{{ is_state(target_light, 'on') }}" value_template: "{{ not is_state(target_light, 'off') }}"
then: then:
- data: - data:
brightness: "{{ brightness }}" brightness: "{{ brightness }}"
@ -126,7 +126,7 @@ sequence:
- condition: template - condition: template
value_template: "{{ light_timeout != 0 }}" value_template: "{{ light_timeout != 0 }}"
- condition: template - condition: template
value_template: "{{ is_state(target_light, 'on') }}" value_template: "{{ not is_state(target_light, 'off') }}"
then: then:
- delay: - delay:
minutes: "{{ light_timeout }}" minutes: "{{ light_timeout }}"