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