-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudy-cabinet-ledstrip.yaml
104 lines (97 loc) · 2.93 KB
/
study-cabinet-ledstrip.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
substitutions:
device_name: "Study Cabinet Ledstrip"
esphome:
name: "study-cabinet-ledstrip"
on_boot:
priority: -100 # Ensures this runs after most other things have initialized
then:
- light.turn_on:
id: ledstrip
effect: "Rainbow Swirl"
- delay: 5s # Let the rainbow show run for 2 seconds
- light.turn_off:
id: ledstrip
esp32:
board: nodemcu-32s
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
light:
- platform: neopixelbus
id: ledstrip
type: GRBW
variant: SK6812
method: ESP32_I2S
pin: GPIO27
num_leds: 154
gamma_correct: 2.0
name: "Study Cabinet A-RGB LEDstrip"
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: 154
- red: 0%
green: 100%
blue: 0%
white: 0%
num_leds: 154
- red: 0%
green: 0%
blue: 100%
white: 0%
num_leds: 154
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);