82 lines
2.3 KiB
YAML
82 lines
2.3 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
|
|
|
|
triggers:
|
|
- trigger: time
|
|
at: 00:30:00
|
|
id: p1-confort-light-off
|
|
- trigger: time
|
|
at: input_datetime.dont_disturb_nighttime_from
|
|
id: p1-confort-light-dim
|
|
- trigger: sun
|
|
event: sunset
|
|
offset: 00:30:00
|
|
id: p1-confort-light-on
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.test_start_animation
|
|
id: test_animation
|
|
|
|
conditions: []
|
|
|
|
actions:
|
|
- choose:
|
|
- conditions:
|
|
- condition: trigger
|
|
id:
|
|
- p1-confort-light-on
|
|
- test_animation
|
|
sequence:
|
|
- if:
|
|
- condition: template
|
|
value_template: "{{ is_state('binary_sensor.dont_disturb_nighttime', 'on') }}"
|
|
then:
|
|
- action: light.turn_on
|
|
target: !input light_target
|
|
data:
|
|
brightness_pct: "{{ states('input_number.dont_disturb_light_brightness') | float }} "
|
|
# color_temp: "{{ states('input_number.confort_light_color') | float }}"
|
|
color_temp_kelvin: "{{ states('input_number.confort_light_kelvin') }}"
|
|
else:
|
|
- action: light.turn_on
|
|
target: !input light_target
|
|
data:
|
|
brightness_pct: 100
|
|
# color_temp: "{{ states('input_number.confort_light_color') | float }}"
|
|
color_temp_kelvin: "{{ states('input_number.confort_light_kelvin') }}"
|
|
|
|
- conditions:
|
|
- condition: trigger
|
|
id:
|
|
- p1-confort-light-dim
|
|
sequence:
|
|
- action: light.turn_on
|
|
target: !input light_target
|
|
data:
|
|
brightness_pct: 100
|
|
rgb_color:
|
|
- 0
|
|
- 0
|
|
- 255
|
|
|
|
- conditions:
|
|
- condition: trigger
|
|
id:
|
|
- p1-confort-light-off
|
|
sequence:
|
|
- action: light.turn_off
|
|
target: !input light_target
|
|
|
|
mode: single
|