-
Notifications
You must be signed in to change notification settings - Fork 0
/
flashing_rgb_lights.yaml
116 lines (115 loc) · 2.88 KB
/
flashing_rgb_lights.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
blueprint:
name: flashing rgb lights
description: 'Flashing RGB lights via on off and delay and finally restore the previous
light states.
'
domain: automation
source_url: https://community.home-assistant.io/t/simple-flashing-lights-via-on-off-and-delay-restore-previous-light-states/258099
input:
activated:
name: Activated
description: Enter the Entity Name for Trigger (On-Off)
selector:
entity:
domain: input_boolean
target_lights:
name: Lights
description: To flashing lights
selector:
target:
entity:
domain: light
color_rgb:
name: RGBColor
description: Choose the color for blinking lights
selector:
select:
options:
- white
- red
- green
- lime
- blue
- navy
- yellow
- orange
- turquoise
- violet
- magenta
- aliceblue
- antiquewhite
- aquamarine
- aqua
- cadetblue
- coral
- cornflowerblue
- crimson
- darkblue
- darkorange
- darkorchid
- darksalmon
- darkslategray
- deeppink
- darkviolet
- deepskyblue
- ghostwhite
- gold
- lawngreen
- lightcoral
- lightgreen
- lightseagreen
brightness_rgb:
name: (OPTIONAL) Light Brightness
description: Color Brigthness between 0 to 255
selector:
number:
min: 0
max: 255
unit_of_measurement: RGB
step: 1.0
mode: slider
delay:
name: (OPTIONAL) Delay
description: Delay flashing lights
default: 1000
selector:
number:
min: 0.0
max: 20000.0
unit_of_measurement: milliseconds
step: 1.0
mode: slider
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input 'activated'
to: 'on'
variables:
activated: !input 'activated'
delay: !input 'delay'
target_lights: !input 'target_lights'
condition: []
action:
- service: scene.create
data:
scene_id: all_lights_snapshot
snapshot_entities: "{% set lights = states.light\n | map(attribute='entity_id')\
\ | join(',') %}\n {{lights}}\n"
- service: light.turn_on
target: !input 'target_lights'
data:
color_name: !input 'color_rgb'
brightness: !input 'brightness_rgb'
- repeat:
while:
- condition: template
value_template: '{{ activated == none or is_state(activated, ''on'') }}'
sequence:
- delay:
milliseconds: '{{ delay }}'
- service: light.toggle
target: !input 'target_lights'
- service: scene.turn_on
data:
entity_id: scene.all_lights_snapshot