I have the following 3 I’ve collected. Honestly though, I highly recommend taking a look at WLED again. It now has HA integration and it has more effects and customization (for lighting) than esphome ever will. I wish there were a way to marry the two but since microcontrollers are like $2, I don’t lose too much sleep over having some dedicated just to lighting.
I have been thinking about running two controllers next to each other and establishing a serial link between the two so I can maintain the automation at the edge that esphome enables with the lighting effects that WLED enables and it function even if HA or wifi are down. Haven’t messed with it yet though.
- addressable_lambda:
name: "Christmas RedGreen (Static)"
lambda: |-
for (int i = 1; i < it.size(); i+=2) {
it[i] = light::ESPColor(255, 0, 18);
}
for (int i = 0; i < it.size(); i+=2) {
it[i] = light::ESPColor(0, 179, 44);
}
# from reddit user thedoctor___
# https://www.reddit.com/r/homeassistant/comments/bua3u8/esphome_what_custom_addressable_lambda_effects/
- addressable_lambda:
name: "Bluez"
lambda: |-
for (int i = 0; i < it.size(); i+=10) {
it[i] = light::ESPColor(255, 255, 255);
}
for (int i = 1; i < it.size(); i+=10) {
it[i] = light::ESPColor(255, 255, 255);
}
for (int i = 2; i < it.size(); i+=10) {
it[i] = light::ESPColor(238, 0, 255);
}
for (int i = 3; i < it.size(); i+=10) {
it[i] = light::ESPColor(238, 0, 255);
}
for (int i = 4; i < it.size(); i+=10) {
it[i] = light::ESPColor(255, 157, 0);
}
for (int i = 5; i < it.size(); i+=10) {
it[i] = light::ESPColor(255, 157, 0);
}
for (int i = 6; i < it.size(); i+=10) {
it[i] = light::ESPColor(0, 28, 209);
}
for (int i = 7; i < it.size(); i+=10) {
it[i] = light::ESPColor(0, 28, 209);
}
for (int i = 8; i < it.size(); i+=10) {
it[i] = light::ESPColor(183, 255, 0);
}
for (int i = 9; i < it.size(); i+=10) {
it[i] = light::ESPColor(183, 255, 0);
}
# from reddit user thedoctor___
# https://www.reddit.com/r/homeassistant/comments/bua3u8/esphome_what_custom_addressable_lambda_effects/
- addressable_lambda:
name: "Fire"
update_interval: 15ms
lambda: |-
int Cooling = 55;
int Sparking = 110;
static byte heat[188];
int cooldown;
// Step 1. Cool down every cell a little
for( int i = 0; i < it.size(); i++) {
cooldown = random(0, ((Cooling * 10) / it.size()) + 2);
if(cooldown>heat[i]) {
heat[i]=0;
} else {
heat[i]=heat[i]-cooldown;
}
}
// Step 2. Heat from each cell drifts 'up' and diffuses a little
for( int k= it.size() - 1; k >= 2; k--) {
heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2]) / 3;
}
// Step 3. Randomly ignite new 'sparks' near the bottom
if( random(255) < Sparking ) {
int y = random(7);
heat[y] = heat[y] + random(160,255);
}
// Step 4. Convert heat to LED colors
for( int Pixel = 0; Pixel < it.size(); Pixel++) {
// Scale 'heat' down from 0-255 to 0-191
byte t192 = round((heat[Pixel]/255.0)*191);
// calculate ramp up from
byte heatramp = t192 & 0x3F; // 0..63
heatramp <<= 2; // scale up to 0..252
// figure out which third of the spectrum we're in:
//this is where you can reverse the effect by switching the commented out lines in all 3 places.
if( t192 > 0x80) { // hottest
//it[it.size() - Pixel - 1] = ESPColor(255, 255, heatramp);
it[Pixel] = ESPColor(255, 255, heatramp);
} else if( t192 > 0x40 ) { // middle
//it[it.size() - Pixel - 1] = ESPColor(255, heatramp, 0);
it[Pixel] = ESPColor(255, heatramp, 0);
} else { // coolest
//it[it.size() - Pixel - 1] = ESPColor(heatramp, 0, 0);
it[Pixel] = ESPColor(heatramp, 0, 0);
}
}
-J