Update Twanne's lighting blueprints

This commit is contained in:
2025-05-15 00:02:28 -04:00
parent f1180cc34b
commit 3a2fc504f3
3 changed files with 146 additions and 113 deletions

View File

@@ -1,7 +1,7 @@
blueprint: blueprint:
name: Smart Lux Dimmer name: Smart Lux Dimmer
author: AntonH author: AntonH
description: 'Version 4.1 description: 'Version 4.3
Switch or dim lights based on the value of a light sensor. Switch or dim lights based on the value of a light sensor.
@@ -24,7 +24,8 @@ blueprint:
value? value?
selector: selector:
entity: entity:
domain: filter:
- domain:
- sensor - sensor
device_class: device_class:
- illuminance - illuminance
@@ -81,8 +82,8 @@ blueprint:
min: 0.0 min: 0.0
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider
unit_of_measurement: '%' unit_of_measurement: '%'
mode: slider
light_value_2: light_value_2:
name: Brightness at minimum light level name: Brightness at minimum light level
description: Brightness of the light at minimum ambient light. description: Brightness of the light at minimum ambient light.
@@ -92,8 +93,8 @@ blueprint:
min: 0.0 min: 0.0
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider
unit_of_measurement: '%' unit_of_measurement: '%'
mode: slider
transition_time: transition_time:
name: Transition time name: Transition time
description: 'The time it takes for the light to transition from the set value description: 'The time it takes for the light to transition from the set value
@@ -124,9 +125,9 @@ blueprint:
value: include_color value: include_color
- label: Set temperature - label: Set temperature
value: include_temp value: include_temp
multiple: false
sort: false
custom_value: false custom_value: false
sort: false
multiple: false
light_color: light_color:
name: Light color name: Light color
description: Color of the light when between minimum and maximum ambient light description: Color of the light when between minimum and maximum ambient light
@@ -161,8 +162,8 @@ blueprint:
min: 0.0 min: 0.0
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider
unit_of_measurement: '%' unit_of_measurement: '%'
mode: slider
light_brightness_under_min: light_brightness_under_min:
name: Brightness when ambient light value under min. name: Brightness when ambient light value under min.
description: Brightness of the light when the ambient light is lower than the description: Brightness of the light when the ambient light is lower than the
@@ -173,8 +174,8 @@ blueprint:
min: 0.0 min: 0.0
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider
unit_of_measurement: '%' unit_of_measurement: '%'
mode: slider
include_color_or_temp_over_under: include_color_or_temp_over_under:
name: Include color or temperature values when outside range name: Include color or temperature values when outside range
description: 'Set a color or temperature value for the light when over maximum description: 'Set a color or temperature value for the light when over maximum
@@ -193,9 +194,9 @@ blueprint:
value: include_color_outside_range value: include_color_outside_range
- label: Set temperature when outside range - label: Set temperature when outside range
value: include_temp_outside_range value: include_temp_outside_range
multiple: false
sort: false
custom_value: false custom_value: false
sort: false
multiple: false
light_color_over_max: light_color_over_max:
name: Color when ambient light value over max. name: Color when ambient light value over max.
description: Color of the light when the ambient light is higher than the set description: Color of the light when the ambient light is higher than the set
@@ -236,18 +237,25 @@ variables:
include_brightness_over_under: !input include_brightness_over_under include_brightness_over_under: !input include_brightness_over_under
include_color_or_temp_over_under: !input include_color_or_temp_over_under include_color_or_temp_over_under: !input include_color_or_temp_over_under
light_sensor: !input light_sensor_entity light_sensor: !input light_sensor_entity
maxB: !input max_brightness_value max_brightness_value: !input max_brightness_value
minB: !input min_brightness_value min_brightness_value: !input min_brightness_value
light1: !input light_value_1 maxB: '{{ max_brightness_value * 2.55 }}'
light2: !input light_value_2 minB: '{{ min_brightness_value * 2.55 }}'
light_value_1: !input light_value_1
light_value_2: !input light_value_2
light1: '{{ light_value_1 * 2.55 }}'
light2: '{{ light_value_2 * 2.55 }}'
slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}' slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}'
constant: '{{ light1 - ( slope * maxB ) }}' constant: '{{ light1 - ( slope * maxB ) }}'
trigger: light_brightness_over_max: !input light_brightness_over_max
platform: state light_brightness_under_min: !input light_brightness_under_min
brightness_over_max_pct: '{{ light_brightness_over_max * 2.55 }}'
brightness_under_min_pct: '{{ light_brightness_under_min * 2.55 }}'
triggers:
trigger: state
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
condition: conditions: !input run_conditions
- condition: !input run_conditions actions:
action:
- choose: - choose:
- conditions: - conditions:
- condition: template - condition: template
@@ -258,20 +266,20 @@ action:
- condition: template - condition: template
value_template: '{{ include_color_or_temp == "include_no_color_temp" }}' value_template: '{{ include_color_or_temp == "include_no_color_temp" }}'
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}' }}'
target: !input target_light target: !input target_light
- conditions: - conditions:
- condition: template - condition: template
value_template: '{{ include_color_or_temp == "include_color" }}' value_template: '{{ include_color_or_temp == "include_color" }}'
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}' }}'
rgb_color: !input light_color rgb_color: !input light_color
target: !input target_light target: !input target_light
@@ -279,10 +287,10 @@ action:
- condition: template - condition: template
value_template: '{{ include_color_or_temp == "include_temp" }}' value_template: '{{ include_color_or_temp == "include_temp" }}'
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}' }}'
color_temp: !input light_temp color_temp: !input light_temp
target: !input target_light target: !input target_light
@@ -302,20 +310,20 @@ action:
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
above: !input max_brightness_value above: !input max_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: !input light_brightness_over_max brightness: '{{ brightness_over_max_pct }}'
target: !input target_light target: !input target_light
- conditions: - conditions:
- condition: numeric_state - condition: numeric_state
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
below: !input min_brightness_value below: !input min_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: !input light_brightness_under_min brightness: '{{ brightness_under_min_pct }}'
target: !input target_light target: !input target_light
- conditions: - conditions:
- condition: numeric_state - condition: numeric_state
@@ -323,10 +331,10 @@ action:
below: !input max_brightness_value below: !input max_brightness_value
above: !input min_brightness_value above: !input min_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}' }}'
target: !input target_light target: !input target_light
- conditions: - conditions:
@@ -340,10 +348,10 @@ action:
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
above: !input max_brightness_value above: !input max_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: !input light_brightness_over_max brightness: '{{ brightness_over_max_pct }}'
rgb_color: !input light_color_over_max rgb_color: !input light_color_over_max
target: !input target_light target: !input target_light
- conditions: - conditions:
@@ -351,10 +359,10 @@ action:
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
below: !input min_brightness_value below: !input min_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: !input light_brightness_under_min brightness: '{{ brightness_under_min_pct }}'
rgb_color: !input light_color_under_min rgb_color: !input light_color_under_min
target: !input target_light target: !input target_light
- conditions: - conditions:
@@ -363,10 +371,10 @@ action:
below: !input max_brightness_value below: !input max_brightness_value
above: !input min_brightness_value above: !input min_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}' }}'
rgb_color: !input light_color rgb_color: !input light_color
target: !input target_light target: !input target_light
@@ -381,10 +389,10 @@ action:
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
above: !input max_brightness_value above: !input max_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: !input light_brightness_over_max brightness: '{{ brightness_over_max_pct }}'
color_temp: !input light_temp_over_max color_temp: !input light_temp_over_max
target: !input target_light target: !input target_light
- conditions: - conditions:
@@ -392,10 +400,10 @@ action:
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
below: !input min_brightness_value below: !input min_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: !input light_brightness_under_min brightness: '{{ brightness_under_min_pct }}'
color_temp: !input light_temp_under_min color_temp: !input light_temp_under_min
target: !input target_light target: !input target_light
- conditions: - conditions:
@@ -404,10 +412,10 @@ action:
below: !input max_brightness_value below: !input max_brightness_value
above: !input min_brightness_value above: !input min_brightness_value
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: data:
transition: !input transition_time transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}' }}'
color_temp: !input light_temp color_temp: !input light_temp
target: !input target_light target: !input target_light

View File

@@ -31,9 +31,12 @@ blueprint:
text: {} text: {}
light_sensor_entity: light_sensor_entity:
name: Light Sensor name: Light Sensor
description: Which light sensor do you want to use to measure the ambient light
value?
selector: selector:
entity: entity:
domain: filter:
- domain:
- sensor - sensor
device_class: device_class:
- illuminance - illuminance
@@ -94,15 +97,17 @@ variables:
light_sensor: !input light_sensor_entity light_sensor: !input light_sensor_entity
maxB: !input max_brightness_value maxB: !input max_brightness_value
minB: !input min_brightness_value minB: !input min_brightness_value
light1: !input light_value_1 light_value_1: !input light_value_1
light2: !input light_value_2 light_value_2: !input light_value_2
light1: '{{ light_value_1 * 2.55 }}'
light2: '{{ light_value_2 * 2.55 }}'
slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}' slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}'
constant: '{{ light1 - ( slope * maxB ) }}' constant: '{{ light1 - ( slope * maxB ) }}'
days: !input schedule_days days: !input schedule_days
trigger: triggers:
platform: state trigger: state
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
condition: conditions:
- condition: numeric_state - condition: numeric_state
entity_id: !input light_sensor_entity entity_id: !input light_sensor_entity
above: !input min_brightness_value above: !input min_brightness_value
@@ -111,9 +116,9 @@ condition:
before: !input schedule_stop before: !input schedule_stop
- condition: template - condition: template
value_template: '{{ now().strftime(''%a'') | lower in days }}' value_template: '{{ now().strftime(''%a'') | lower in days }}'
action: actions:
- service: light.turn_on - action: light.turn_on
data: data:
brightness_pct: "{% if states(light_sensor)|int > maxB %}\n 0\n{% else %}\n {{ brightness: "{% if states(light_sensor)|int > maxB %}\n 0\n{% else %}\n {{ ((
(( slope * states(light_sensor)|int ) + constant)|round }}\n{% endif %}\n" slope * states(light_sensor)|int ) + constant)|round }}\n{% endif %}\n"
target: !input target_light target: !input target_light

View File

@@ -1,7 +1,7 @@
blueprint: blueprint:
name: The Everything Light name: The Everything Light
author: AntonH author: AntonH
description: "**Version 2.5**\nThe Everything Light: select any trigger and turn description: "**Version 2.10**\nThe Everything Light: select any trigger and turn
on your light in multiple ways:\n - just turn the light on in it's default state\n on your light in multiple ways:\n - just turn the light on in it's default state\n
\ - turn it on with a set brightness, color and/or temperature value\n - turn \ - turn it on with a set brightness, color and/or temperature value\n - turn
it on dynamically with a brightness value that changes according to an ambient it on dynamically with a brightness value that changes according to an ambient
@@ -61,7 +61,7 @@ blueprint:
temperature can be set. temperature can be set.
- **DYNAMIC MODE** - **DYNAMIC MODE:**
The light will be assigned a brightness value based on the value of a ambient The light will be assigned a brightness value based on the value of a ambient
light sensor, optionally color or temperature can be set. light sensor, optionally color or temperature can be set.
@@ -74,15 +74,15 @@ blueprint:
options: options:
- label: DEFAULT MODE - label: DEFAULT MODE
value: default value: default
- label: TOGGLE - label: TOGGLE MODE
value: toggle value: toggle
- label: FIXED MODE - label: FIXED MODE
value: fixed value: fixed
- label: DYNAMIC MODE - label: DYNAMIC MODE
value: dynamic value: dynamic
multiple: false
sort: false
custom_value: false custom_value: false
sort: false
multiple: false
transition_time: transition_time:
name: Transition time (FIXED & DYNAMIC MODE) name: Transition time (FIXED & DYNAMIC MODE)
description: "The time it takes for the light to transition to the assigned description: "The time it takes for the light to transition to the assigned
@@ -110,9 +110,9 @@ blueprint:
value: include_color value: include_color
- label: Set temperature - label: Set temperature
value: include_temperature value: include_temperature
multiple: false
sort: false
custom_value: false custom_value: false
sort: false
multiple: false
light_color: light_color:
name: Light color (FIXED & DYNAMIC MODE) name: Light color (FIXED & DYNAMIC MODE)
description: Color of the light when between minimum and maximum ambient light description: Color of the light when between minimum and maximum ambient light
@@ -125,22 +125,28 @@ blueprint:
color_rgb: {} color_rgb: {}
light_temperature: light_temperature:
name: Light temperature (FIXED & DYNAMIC MODE) name: Light temperature (FIXED & DYNAMIC MODE)
description: Temperature of the light when between minimum and maximum ambient description: 'Temperature of the light when between minimum and maximum ambient
light values. light values.
(not all lights will support all values, please consult your lights spec sheet.)
'
default: 2000 default: 2000
selector: selector:
color_temp: {} color_temp:
unit: kelvin
min: 1500
max: 6500
brightness: brightness:
name: Brightness (FIXED BRIGHTNESS MODE) name: Brightness (FIXED BRIGHTNESS MODE)
description: Set the brightness value the light needs to turn on at description: Set the brightness value the light needs to turn on at
default: 0 default: 100
selector: selector:
number: number:
min: 0.0 min: 0.0
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider mode: slider
unit_of_measurement: '%'
light_sensor_entity: light_sensor_entity:
name: Light Sensor (DYNAMIC MODE) name: Light Sensor (DYNAMIC MODE)
description: Which light sensor do you want to use to measure the ambient light description: Which light sensor do you want to use to measure the ambient light
@@ -188,7 +194,6 @@ blueprint:
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider mode: slider
unit_of_measurement: '%'
light_value_2: light_value_2:
name: Brightness at minimum light level (DYNAMIC MODE) name: Brightness at minimum light level (DYNAMIC MODE)
description: Brightness of the light at minimum ambient light. description: Brightness of the light at minimum ambient light.
@@ -199,7 +204,6 @@ blueprint:
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider mode: slider
unit_of_measurement: '%'
light_brightness_over_max: light_brightness_over_max:
name: Brightness when ambient light value over max (DYNAMIC MODE) name: Brightness when ambient light value over max (DYNAMIC MODE)
description: Brightness of the light when the ambient light is higher than the description: Brightness of the light when the ambient light is higher than the
@@ -211,19 +215,17 @@ blueprint:
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider mode: slider
unit_of_measurement: '%'
light_brightness_under_min: light_brightness_under_min:
name: Brightness when ambient light value under min (DYNAMIC MODE) name: Brightness when ambient light value under min (DYNAMIC MODE)
description: Brightness of the light when the ambient light is lower than the description: Brightness of the light when the ambient light is lower than the
set minimum value. set minimum value.
default: 100 default: 255
selector: selector:
number: number:
min: 0.0 min: 0.0
max: 100.0 max: 100.0
step: 1.0 step: 1.0
mode: slider mode: slider
unit_of_measurement: '%'
include_color_or_temp_over_under: include_color_or_temp_over_under:
name: Include color or temperature values when outside range (DYNAMIC MODE) name: Include color or temperature values when outside range (DYNAMIC MODE)
description: 'Set a color or temperature value for the light when over maximum description: 'Set a color or temperature value for the light when over maximum
@@ -242,9 +244,9 @@ blueprint:
value: include_color_outside_range value: include_color_outside_range
- label: Set temperature when outside range - label: Set temperature when outside range
value: include_temp_outside_range value: include_temp_outside_range
multiple: false
sort: false
custom_value: false custom_value: false
sort: false
multiple: false
light_color_over_max: light_color_over_max:
name: Color when ambient light value over max (DYNAMIC MODE) name: Color when ambient light value over max (DYNAMIC MODE)
description: Color of the light when the ambient light is higher than the set description: Color of the light when the ambient light is higher than the set
@@ -267,18 +269,32 @@ blueprint:
color_rgb: {} color_rgb: {}
light_temp_over_max: light_temp_over_max:
name: Temperature when ambient light value over max (DYNAMIC MODE) name: Temperature when ambient light value over max (DYNAMIC MODE)
description: Temperature of the light when the ambient light is higher than description: 'Temperature of the light when the ambient light is higher than
the set maximum value. the set maximum value.
(not all lights will support all values, please consult your lights spec sheet.)
'
default: 2000 default: 2000
selector: selector:
color_temp: {} color_temp:
unit: kelvin
min: 1500
max: 6500
light_temp_under_min: light_temp_under_min:
name: Temperature when ambient light value under min (DYNAMIC MODE) name: Temperature when ambient light value under min (DYNAMIC MODE)
description: Temperature of the light when the ambient light is lower than the description: 'Temperature of the light when the ambient light is lower than
set minimum value. the set minimum value.
(not all lights will support all values, please consult your lights spec sheet.)
'
default: 2000 default: 2000
selector: selector:
color_temp: {} color_temp:
unit: kelvin
min: 1500
max: 6500
include_turn_off: include_turn_off:
name: Include light turn off function name: Include light turn off function
description: 'Select if the light needs to turn back off again and how you want description: 'Select if the light needs to turn back off again and how you want
@@ -307,8 +323,8 @@ blueprint:
value: trigger value: trigger
- label: Staircase function - label: Staircase function
value: staircase value: staircase
sort: false
custom_value: false custom_value: false
sort: false
turn_off_triggers: turn_off_triggers:
name: Turn off triggers name: Turn off triggers
description: Triggers that turn the light off description: Triggers that turn the light off
@@ -343,71 +359,75 @@ variables:
include_color_or_temp: !input include_color_or_temp include_color_or_temp: !input include_color_or_temp
light_color: !input light_color light_color: !input light_color
light_temperature: !input light_temperature light_temperature: !input light_temperature
light_brightness: !input brightness brightness: !input brightness
light_brightness: '{{ brightness * 2.55 }}'
light_sensor: !input light_sensor_entity light_sensor: !input light_sensor_entity
maxB: !input max_brightness_value maxB: !input max_brightness_value
minB: !input min_brightness_value minB: !input min_brightness_value
light1: !input light_value_1 light_value_1: !input light_value_1
light2: !input light_value_2 light_value_2: !input light_value_2
light1: '{{ light_value_1 * 2.55 }}'
light2: '{{ light_value_2 * 2.55 }}'
slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}' slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}'
constant: '{{ light1 - ( slope * maxB ) }}' constant: '{{ light1 - ( slope * maxB ) }}'
dynamic_brightness_pct: "{% if mode == \"dynamic\" %}\n {{ (( slope * states(light_sensor)|int dynamic_brightness: "{% if mode == \"dynamic\" %}\n {{ (( slope * states(light_sensor)|int
) + constant)|round }}\n{% else %}\n 0\n{% endif %}\n" ) + constant)|round }}\n{% else %}\n 0\n{% endif %}\n"
include_color_or_temp_over_under: !input include_color_or_temp_over_under include_color_or_temp_over_under: !input include_color_or_temp_over_under
light_brightness_over_max: !input light_brightness_over_max light_brightness_over_max: !input light_brightness_over_max
brightness_over_max_pct: '{{ light_brightness_over_max * 2.55 }}'
light_color_over_max: !input light_color_over_max light_color_over_max: !input light_color_over_max
light_temp_over_max: !input light_temp_over_max light_temp_over_max: !input light_temp_over_max
light_brightness_under_min: !input light_brightness_under_min light_brightness_under_min: !input light_brightness_under_min
brightness_under_min_pct: '{{ light_brightness_under_min * 2.55 }}'
light_color_under_min: !input light_color_under_min light_color_under_min: !input light_color_under_min
light_temp_under_min: !input light_temp_under_min light_temp_under_min: !input light_temp_under_min
include_turn_off: !input include_turn_off include_turn_off: !input include_turn_off
trigger: !input triggers trigger: !input triggers
condition: conditions: !input run_conditions
- condition: !input run_conditions actions:
action:
- choose: - choose:
- conditions: '{{ mode == "toggle" }}' - conditions: '{{ mode == "toggle" }}'
sequence: sequence:
- service: homeassistant.toggle - action: homeassistant.toggle
target: !input target_light target: !input target_light
- conditions: '{{ mode == "default" }}' - conditions: '{{ mode == "default" }}'
sequence: sequence:
- service: homeassistant.turn_on - action: homeassistant.turn_on
target: !input target_light target: !input target_light
- conditions: '{{ mode == "fixed" }}' - conditions: '{{ mode == "fixed" }}'
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: "{% if include_color_or_temp == \"include_color\" %}\n {{ { \"transition\": data: "{% if include_color_or_temp == \"include_color\" %}\n {{ { \"transition\":
transition_time, \"brightness_pct\": light_brightness, \"rgb_color\": light_color transition_time, \"brightness\": light_brightness, \"rgb_color\": light_color
} }}\n{% elif include_color_or_temp == \"include_temperature\" %}\n {{ { } }}\n{% elif include_color_or_temp == \"include_temperature\" %}\n {{ {
\"transition\": transition_time, \"brightness_pct\": light_brightness, \"color_temp\": \"transition\": transition_time, \"brightness\": light_brightness, \"color_temp\":
light_temperature } }}\n{% else %}\n {{ { \"transition\": transition_time, light_temperature } }}\n{% else %}\n {{ { \"transition\": transition_time,
\"brightness_pct\": light_brightness } }}\n{% endif %}\n" \"brightness\": light_brightness } }}\n{% endif %}\n"
target: !input target_light target: !input target_light
- conditions: '{{ mode == "dynamic" }}' - conditions: '{{ mode == "dynamic" }}'
sequence: sequence:
- service: light.turn_on - action: light.turn_on
data: "{% if states(light_sensor)|int > maxB %}\n {% if include_color_or_temp_over_under data: "{% if states(light_sensor)|int > maxB %}\n {% if include_color_or_temp_over_under
== \"include_color_outside_range\" %}\n {{ { \"transition\": transition_time, == \"include_color_outside_range\" %}\n {{ { \"transition\": transition_time,
\"brightness_pct\": light_brightness_over_max, \"rgb_color\": light_color_over_max \"brightness\": brightness_over_max_pct, \"rgb_color\": light_color_over_max
} }}\n {% elif include_color_or_temp_over_under == \"include_temp_outside_range\" } }}\n {% elif include_color_or_temp_over_under == \"include_temp_outside_range\"
%}\n {{ { \"transition\": transition_time, \"brightness_pct\": light_brightness_over_max, %}\n {{ { \"transition\": transition_time, \"brightness\": brightness_over_max_pct,
\"color_temp\": light_temp_over_max } }}\n {% else %}\n {{ { \"transition\": \"color_temp\": light_temp_over_max } }}\n {% else %}\n {{ { \"transition\":
transition_time, \"brightness_pct\": light_brightness_over_max } }}\n {% transition_time, \"brightness\": brightness_over_max_pct } }}\n {% endif
endif %}\n{% elif states(light_sensor)|int < minB %}\n {% if include_color_or_temp_over_under %}\n{% elif states(light_sensor)|int < minB %}\n {% if include_color_or_temp_over_under
== \"include_color_outside_range\" %}\n {{ { \"transition\": transition_time, == \"include_color_outside_range\" %}\n {{ { \"transition\": transition_time,
\"brightness_pct\": light_brightness_under_min, \"rgb_color\": light_color_under_min \"brightness\": brightness_under_min_pct, \"rgb_color\": light_color_under_min
} }}\n {% elif include_color_or_temp_over_under == \"include_temp_outside_range\" } }}\n {% elif include_color_or_temp_over_under == \"include_temp_outside_range\"
%}\n {{ { \"transition\": transition_time, \"brightness_pct\": light_brightness_under_min, %}\n {{ { \"transition\": transition_time, \"brightness\": brightness_under_min_pct,
\"color_temp\": light_temp_under_min } }}\n {% else %}\n {{ { \"transition\": \"color_temp\": light_temp_under_min } }}\n {% else %}\n {{ { \"transition\":
transition_time, \"brightness_pct\": light_brightness_under_min } }}\n {% transition_time, \"brightness\": brightness_under_min_pct } }}\n {% endif
endif %}\n{% else %}\n {% if include_color_or_temp == \"include_color\" %}\n %}\n{% else %}\n {% if include_color_or_temp == \"include_color\" %}\n {{
\ {{ { \"transition\": transition_time, \"brightness_pct\": light_brightness, { \"transition\": transition_time, \"brightness\": light_brightness, \"rgb_color\":
\"rgb_color\": light_color } }}\n {% elif include_color_or_temp == \"include_temperature\" light_color } }}\n {% elif include_color_or_temp == \"include_temperature\"
%}\n {{ { \"transition\": transition_time, \"brightness_pct\": dynamic_brightness_pct, %}\n {{ { \"transition\": transition_time, \"brightness\": dynamic_brightness,
\"color_temp\": light_temperature } }}\n {% else %}\n {{ { \"transition\": \"color_temp\": light_temperature } }}\n {% else %}\n {{ { \"transition\":
transition_time, \"brightness_pct\": dynamic_brightness_pct } }}\n {% endif transition_time, \"brightness\": dynamic_brightness } }}\n {% endif %}\n{%
%}\n{% endif %}\n" endif %}\n"
target: !input target_light target: !input target_light
- if: !input turn_off_conditions - if: !input turn_off_conditions
then: then:
@@ -420,11 +440,11 @@ action:
timeout: !input staircase_duration timeout: !input staircase_duration
else: else:
- delay: !input staircase_duration - delay: !input staircase_duration
- service: homeassistant.turn_off - action: homeassistant.turn_off
target: !input target_light target: !input target_light
- conditions: '{{ "trigger" in include_turn_off and not "staircase" in include_turn_off - conditions: '{{ "trigger" in include_turn_off and not "staircase" in include_turn_off
}}' }}'
sequence: sequence:
- wait_for_trigger: !input turn_off_triggers - wait_for_trigger: !input turn_off_triggers
- service: homeassistant.turn_off - action: homeassistant.turn_off
target: !input target_light target: !input target_light