-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathathom-rgbww-bulb.yaml
185 lines (163 loc) · 3.99 KB
/
athom-rgbww-bulb.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
substitutions:
name: "athom-rgbww-bulb"
friendly_name: "Athom RGBWW Smart Bulb"
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
name_add_mac_suffix: true
project:
name: jamesswift.athom-rgbww-bulb
version: "0.2.0"
on_boot:
priority: 600
then:
lambda: |-
id(red).set_max_power(id(red_max).state/100);
id(green).set_max_power(id(green_max).state/100);
id(blue).set_max_power(id(blue_max).state/100);
esp8266:
board: esp8285
restore_from_flash: true
logger:
ota:
api:
wifi:
output_power: 14db
power_save_mode: light
ap:
ssid: "${friendly_name}"
web_server:
port: 80
captive_portal:
dashboard_import:
package_import_url: github://JamesSwift/athom-rgbww-bulb/athom-rgbww-bulb.yaml@main
light:
- platform: rgbww
name: none
id: bulb
restore_mode: ALWAYS_ON
warm_white: warm_white
cold_white: white
red: red
green: green
blue: blue
cold_white_color_temperature: 6000 K
warm_white_color_temperature: 3000 K
color_interlock: true
effects:
- random:
- pulse:
- flicker:
- strobe:
name: Police
colors:
- state: true
color_mode: RGB
brightness: 100%
red: 100%
green: 0%
blue: 0%
duration: 700ms
- state: true
color_mode: RGB
brightness: 100%
red: 0%
green: 0%
blue: 100%
duration: 700ms
- strobe:
name: Police Fast
colors:
- state: true
color_mode: RGB
brightness: 100%
red: 100%
green: 0%
blue: 0%
duration: 300ms
- state: true
color_mode: RGB
brightness: 100%
red: 0%
green: 0%
blue: 100%
duration: 300ms
output:
- platform: esp8266_pwm
id: warm_white
pin: GPIO13
- platform: esp8266_pwm
id: white
pin: GPIO5
- platform: esp8266_pwm
id: red
pin: GPIO4
- platform: esp8266_pwm
id: green
pin: GPIO12
- platform: esp8266_pwm
id: blue
pin: GPIO14
number:
- platform: template
optimistic: true
restore_value: true
name: "${friendly_name} Red Max Power"
id: red_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(red).set_max_power(x/100);
ESP_LOGI("light", "Set red max power to: %f", id(red).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
- platform: template
optimistic: true
restore_value: true
name: "${friendly_name} Green Max Power"
id: green_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(green).set_max_power(x/100);
ESP_LOGI("light", "Set green max power to: %f", id(green).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
- platform: template
optimistic: true
restore_value: true
name: "${friendly_name} Blue Max Power"
id: blue_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(blue).set_max_power(x/100);
ESP_LOGI("light", "Set blue max power to: %f", id(blue).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
sensor:
# WiFi Signal Sensor
- platform: wifi_signal
name: "${friendly_name} WiFi Status"
update_interval: 60s