-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlights.yaml
168 lines (166 loc) · 5.09 KB
/
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
input_boolean:
toggle_light:
name: Toggle Light Power
dimmable_light:
name: Dimmable Light Power
ct_light:
name: CT Light Power
rgb_light:
name: RGB Light Power
rgbww_light:
name: RGBWW Light Power
input_number:
dimmable_light_bri:
name: Dimmable Light Brightness
min: 0
max: 255
ct_light_bri:
name: CT Light Brightness
min: 0
max: 255
rgb_light_bri:
name: RGB Light Brightness
min: 0
max: 255
rgbww_light_bri:
name: RGBWW Light Brightness
min: 0
max: 255
ct_light_temp:
name: CT Light Temp
min: 150
max: 500
rgbww_light_temp:
name: RGBWW Light Temp
min: 150
max: 500
rgb_light_h:
name: RGB Light H
min: 0
max: 360
rgb_light_s:
name: RGB Light S
min: 0
max: 100
rgbww_light_h:
name: RGBWW Light H
min: 0
max: 360
rgbww_light_s:
name: RGBWW Light S
min: 0
max: 100
light:
- platform: template
lights:
toggle_light:
friendly_name: "Toggle Lights"
value_template: "{{ is_state('input_boolean.toggle_light', 'on') }}"
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.toggle_light
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.toggle_light
dimmable_light:
friendly_name: "Dimmable Lights"
level_template: "{{states('input_number.dimmable_light_bri') | int}}"
value_template: "{{ is_state('input_boolean.dimmable_light', 'on') }}"
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.dimmable_light
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.dimmable_light
set_level:
service: input_number.set_value
data:
value: "{{ brightness }}"
entity_id: input_number.dimmable_light_bri
ct_light:
friendly_name: "CT Lights"
level_template: "{{ states('input_number.ct_light_bri') | int }}"
value_template: "{{ is_state('input_boolean.ct_light', 'on') }}"
temperature_template: "{{ states('input_number.ct_light_temp') | int }}"
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.ct_light
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.ct_light
set_level:
service: input_number.set_value
data:
value: "{{ brightness }}"
entity_id: input_number.ct_light_bri
set_temperature:
service: input_number.set_value
data:
value: "{{ color_temp }}"
entity_id: input_number.ct_light_temp
rgb_light:
friendly_name: "RGB Lights"
level_template: "{{ states('input_number.rgb_light_bri') | int }}"
value_template: "{{ is_state('input_boolean.rgb_light', 'on') }}"
color_template: "({{states('input_number.rgb_light_h') | int}}, {{states('input_number.rgb_light_s') | int}})"
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.rgb_light
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.rgb_light
set_level:
service: input_number.set_value
data:
value: "{{ brightness }}"
entity_id: input_number.rgb_light_bri
set_color:
- service: input_number.set_value
data:
value: "{{ h }}"
entity_id: input_number.rgb_light_h
- service: input_number.set_value
data:
value: "{{ s }}"
entity_id: input_number.rgb_light_s
rgbww_light:
friendly_name: "RGBWW Lights"
level_template: "{{ states('input_number.rgbww_light_bri') | int }}"
value_template: "{{ is_state('input_boolean.rgbww_light', 'on') }}"
temperature_template: "{{ states('input_number.rgbww_light_temp') | int }}"
color_template: "({{states('input_number.rgbww_light_h') | int}}, {{states('input_number.rgbww_light_s') | int}})"
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.rgbww_light
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.rgbww_light
set_level:
service: input_number.set_value
data:
value: "{{ brightness }}"
entity_id: input_number.rgbww_light_bri
set_temperature:
service: input_number.set_value
data:
value: "{{ color_temp }}"
entity_id: input_number.rgbww_light_temp
set_color:
- service: input_number.set_value
data:
value: "{{ h }}"
entity_id: input_number.rgbww_light_h
- service: input_number.set_value
data:
value: "{{ s }}"
entity_id: input_number.rgbww_light_s