-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathledstrip-study-workbench.yaml
196 lines (186 loc) · 5.67 KB
/
ledstrip-study-workbench.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
substitutions:
device_name: "Ledstrip Study Workbench"
esphome:
name: "ledstrip-study-workbench"
comment: ESP32C3
platformio_options:
board_build.f_cpu: 80000000L # Set CPU frequency to 80MHz
esp32:
board: esp32-c3-devkitm-1
packages:
wifi: !include /config/esphome/common/wifi.yaml
network_diagnostics: !include /config/esphome/common/network_diagnostics.yaml
base_config: !include /config/esphome/common/base_config.yaml
e131:
method: unicast
status_led:
pin: GPIO2
power_supply:
- id: led_power_control
pin: GPIO18 # GPIO pin connected to the gate of the IRLZ34N via 100 Ohm
light:
- platform: neopixelbus
type: GRB
variant: WS2812X
pin: GPIO06
num_leds: 91
power_supply: led_power_control # This controls the MOSFET
gamma_correct: 1.3
color_correct: [100%, 80%, 80%]
name: "${device_name}"
id: led_strip
internal: false
effects:
- e131:
universe: 1
channels: RGB
- addressable_rainbow:
name: Rainbow Swirl
speed: 10
width: 154
- addressable_color_wipe:
name: "Colorful Wipe"
colors:
- red: 100%
green: 0%
blue: 0%
white: 0%
num_leds: 91
- red: 0%
green: 100%
blue: 0%
white: 0%
num_leds: 91
- red: 0%
green: 0%
blue: 100%
white: 0%
num_leds: 91
add_led_interval: 100ms
- addressable_scan:
name: "Ping Pong"
move_interval: 100ms
scan_width: 10
- addressable_lambda:
name: "Simple Color Wipe"
update_interval: 100ms
lambda: |-
for (int i = it.size() - 1; i > 0; i--) {
it[i] = it[i - 1].get();
}
it[0] = ESPColor::random_color(); // Correct random color function
- addressable_lambda:
name: "Random Sparkle"
update_interval: 50ms
lambda: |-
it.all().fade_to_black(50); // Correct fading method
if (random_uint32() % 10 > 8) {
it[random_uint32() % it.size()] = ESPColor::random_color(); // Correct random color function
}
- addressable_lambda:
name: "Gradient Shift"
update_interval: 50ms
lambda: |-
static uint16_t start_index = 0;
it.shift_right(1);
start_index++;
if (start_index >= it.size()) {
start_index = 0;
}
float hue = float(start_index) / it.size();
int hue_deg = int(hue * 360); // Convert to degrees
int saturation = 255; // Maximum saturation
int value = 255; // Maximum brightness
// Create an HSV color and set it to the first LED
ESPHSVColor hsv_color(hue_deg, saturation, value);
it[0].set_hsv(hsv_color);
# Define Partition 1: First 20 LEDs
- platform: partition
name: "LED Strip - Soldering Section"
id: soldering_section
default_transition_length: 0s
restore_mode: ALWAYS_OFF
segments:
- id: led_strip
from: 0
to: 24
effects:
- pulse:
name: "Slow Pulse"
transition_length: 2s
update_interval: 2s
min_brightness: 20%
max_brightness: 100%
- platform: partition
name: "LED Strip - Main Section"
id: main_section
default_transition_length: 0s
restore_mode: ALWAYS_OFF
segments:
- id: led_strip
from: 25
to: 90
effects:
- e131:
universe: 1
channels: RGB
- addressable_rainbow:
name: Rainbow Swirl
speed: 10
width: 154
- addressable_color_wipe:
name: "Colorful Wipe"
colors:
- red: 100%
green: 0%
blue: 0%
white: 0%
num_leds: 91
- red: 0%
green: 100%
blue: 0%
white: 0%
num_leds: 91
- red: 0%
green: 0%
blue: 100%
white: 0%
num_leds: 91
add_led_interval: 100ms
- addressable_scan:
name: "Ping Pong"
move_interval: 100ms
scan_width: 10
- addressable_lambda:
name: "Simple Color Wipe"
update_interval: 100ms
lambda: |-
for (int i = it.size() - 1; i > 0; i--) {
it[i] = it[i - 1].get();
}
it[0] = ESPColor::random_color(); // Correct random color function
- addressable_lambda:
name: "Random Sparkle"
update_interval: 50ms
lambda: |-
it.all().fade_to_black(50); // Correct fading method
if (random_uint32() % 10 > 8) {
it[random_uint32() % it.size()] = ESPColor::random_color(); // Correct random color function
}
- addressable_lambda:
name: "Gradient Shift"
update_interval: 50ms
lambda: |-
static uint16_t start_index = 0;
it.shift_right(1);
start_index++;
if (start_index >= it.size()) {
start_index = 0;
}
float hue = float(start_index) / it.size();
int hue_deg = int(hue * 360); // Convert to degrees
int saturation = 255; // Maximum saturation
int value = 255; // Maximum brightness
// Create an HSV color and set it to the first LED
ESPHSVColor hsv_color(hue_deg, saturation, value);
it[0].set_hsv(hsv_color);