62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
blueprint:
|
|
name: confort_light_manage
|
|
description: Comfort light to switch on lights at a certain time
|
|
domain: automation
|
|
# source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
|
|
author: Tiziano Trabattoni
|
|
input:
|
|
light_target:
|
|
name: Light
|
|
selector:
|
|
target:
|
|
entity:
|
|
domain: light
|
|
|
|
# trigger_variables:
|
|
# use_sun: !input sun_condition
|
|
|
|
triggers:
|
|
- trigger: time
|
|
at: input_datetime.dont_disturb_nighttime_to
|
|
id: p1-confort-light-off
|
|
- trigger: sun
|
|
event: sunset
|
|
offset: 00:30:00
|
|
id: p1-confort-light-on
|
|
|
|
conditions: []
|
|
|
|
actions:
|
|
- choose:
|
|
- conditions:
|
|
- condition: trigger
|
|
id:
|
|
- p1-confort-light-on
|
|
sequence:
|
|
- if:
|
|
- condition: template
|
|
# value_template: "{{ use_dont_disturb }}"
|
|
value_template: "{{ dont_disturb_nighttime }}"
|
|
then:
|
|
- action: light.turn_on
|
|
target: !input light_target
|
|
data:
|
|
brightness_pct: states('dont_disturb_light_brightness')
|
|
color_temp_kelvin: 2700
|
|
else:
|
|
- action: light.turn_on
|
|
target: !input light_target
|
|
data:
|
|
brightness_pct: 100
|
|
color_temp_kelvin: 2700
|
|
|
|
- conditions:
|
|
- condition: trigger
|
|
id:
|
|
- p1-confort-light-off
|
|
sequence:
|
|
- action: light.turn_off
|
|
target: !input light_target
|
|
|
|
mode: single
|