forked from KaufHA/kauf-rgbww-bulbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kauf-bulb.yaml
238 lines (190 loc) · 6.1 KB
/
kauf-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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
substitutions:
name: kauf-bulb # **** CHANGE DEVICE NAME TO SOMETHING UNIQUE PER DEVICE. RENAME YAML FILE TO SAME NAME. ****
# **** USE DASHES (-) INSTEAD OF SPACES OR UNDERSCORE (_). USE ONLY LOWER CASE LETTERS. ****
friendly_name: Kauf Bulb # **** CHANGE FRIENDLY NAME TO SOMETHING UNIQUE PER DEVICE ****
esp8266: # https://esphome.io/components/esp8266.html
board: esp01_1m
restore_from_flash: true
external_components:
- source:
type: git
url: https://github.com/KaufHA/kauf-rgbww-bulbs
refresh: 0s
# - source:
# type: local
# path: kauf_rgbww_components
- source:
type: git
url: https://github.com/KaufHA/common
refresh: 0s
esphome:
name: $name
project:
name: "kauf.rgbww"
version: "1.73y"
on_boot:
then:
- lambda: |-
// restore light state per setting. Default is to restore previous state so we don't need an action for that.
if (id(select_boot_state).state == "Always On - Last Value") {
auto call = id(kauf_light).turn_on();
call.perform();
}
else if (id(select_boot_state).state == "Always On - Bright White") {
auto call = id(kauf_light).turn_on();
call.set_color_mode(ColorMode::COLOR_TEMPERATURE);
call.set_color_temperature(150);
call.set_brightness(1.0);
call.perform();
}
else if (id(select_boot_state).state == "Always Off") {
auto call = id(kauf_light).turn_off();
call.perform();
}
// turn on WLED if effect is selected
if ( id(effect).state == "WLED / DDP" ) { id(kauf_light)->set_use_wled(); }
button:
- platform: restart
id: restart_button
name: $friendly_name Restart Firmware
entity_category: diagnostic
disabled_by_default: true
wifi:
# **** ENTER WI-FI CREDENTIALS HERE, USING SECRETS.YAML RECOMMENDED ****
ssid: initial_ap # !secret wifi_ssid
password: asdfasdfasdfasdf # !secret wifi_password
# Uncomment below to set a static IP
# manual_ip:
# static_ip: !secret kauf_bulb_rgb_ip_address
# gateway: !secret wifi_gateway
# subnet: !secret wifi_subnet
# dns1: !secret wifi_dns1
# use_address allows wireless programming through dashboard.
# Set to the bulb's IP Address. Remove after programming.
# use_address: 192.168.86.249
# default is 20, 17 is recommended.
output_power: 17
# using fast_connect as default since it is required for hidden networks.
# feel free to change or override.
fast_connect: true
forced_hash: 2048874009
logger: # Enable logging
# baud_rate: 0 # Disable UART logging since TX pad not easily available
api: # Enable Home Assistant API
# password: !secret api_password # optional password field for Home Assistant API.
ota:
# password: !secret ota_password # optional password for OTA updates.
debug: # outputs additional debug info when logs start
web_server: # web server allows access to device with a web browser
# auth: # optional login details for web interface
# username: admin
# password: !secret web_server_password
# PWM outputs for each LED channel
output:
- platform: esp8266_pwm
pin: GPIO4
frequency: 1000 Hz
id: pwm_red
- platform: esp8266_pwm
pin: GPIO12
frequency: 1000 Hz
id: pwm_green
- platform: esp8266_pwm
pin: GPIO14
frequency: 1000 Hz
id: pwm_blue
- platform: esp8266_pwm
pin: GPIO5
frequency: 1000 Hz
id: pwm_cw
- platform: esp8266_pwm
pin: GPIO13
frequency: 1000 Hz
id: pwm_ww
light:
# Additive RGB light for Warm White
- platform: kauf_rgbww
id: warm_rgb
entity_category: config
default_transition_length: 0ms
aux: true
disabled_by_default: true
name: $friendly_name Warm RGB
forced_hash: 4077116474
# Additive RGB light for Cold White
- platform: kauf_rgbww
id: cold_rgb
entity_category: config
default_transition_length: 0ms
aux: true
disabled_by_default: true
name: $friendly_name Cold RGB
forced_hash: 301094535
# Main RGBWW light
- platform: kauf_rgbww
id: kauf_light
default_transition_length: 250ms
name: $friendly_name
red: pwm_red
green: pwm_green
blue: pwm_blue
warm_white: pwm_ww
cold_white: pwm_cw
warm_rgb: warm_rgb
cold_rgb: cold_rgb
forced_hash: 2723974766
select:
# default light state on boot
- platform: template
name: $friendly_name Power On State
id: select_boot_state
optimistic: true
options:
- "Restore Power Off State"
- "Always On - Last Value"
- "Always On - Bright White"
- "Always Off"
# defaulting to always on is nice so you know new bulbs are working
initial_option: "Always On - Bright White"
restore_value: true
icon: mdi:restart-alert
set_action:
- script.execute: save_changes
entity_category: config
forced_hash: 3524332562
- platform: template
name: $friendly_name Effect
id: effect
optimistic: true
options:
- "None"
- "WLED / DDP"
initial_option: "None"
restore_value: true
icon: mdi:string-lights
set_action:
- lambda: |-
if ( x == "None" ) { id(kauf_light)->clr_use_wled(); }
if ( x == "WLED / DDP" ) { id(kauf_light)->set_use_wled(); }
- script.execute: save_changes
entity_category: config
forced_hash: 5841966
sensor:
- platform: uptime
name: $friendly_name Uptime
update_interval: 60s
entity_category: diagnostic
disabled_by_default: true
# Send IP Address to HA. Disabled by default, not as important now that Home Assistant provides link.
text_sensor:
- platform: wifi_info
ip_address:
name: $friendly_name IP Address
entity_category: diagnostic
disabled_by_default: true
script:
- id: save_changes
mode: restart
then:
- delay: 3s
- lambda: 'global_preferences->sync();'