Will do. I have a few NodeMCUs that I plan on getting upgraded today (but probably tomorrow sigh).
Yay! 0.85 (and 0.86 as well) had that horrible WiFi drop off bug. Really annoying to have to go an reset NodeMCUs that are tucked away in my attic every few days. LOL
Ahhh!
I needed it for my LED strip which has a esp01_1m board and the latest version which has a esp01_1m release is 0.8.5 lol
Can someone please confirm I’m not looking at it wrong?
Also, how can I flash it to a device that doesn’t have a usb port? lol
That is not how I read the release notes. The 0.86 release notes say
Note regarding ESP01:
ESP01 with 512k flash no longer supports Alexa, Blynk or Hue sync interfaces. If you use them, please do not update.
ESP01 with 1MB flash either supports OTA updates OR the above interfaces, just choose the respective binary.
From the next version onward, it will very likely be impossible for me to maintain 512k ESP01 support.
ESP01 1M will stay supported, although OTA updates will not be possible.
To get the most out of WLED, I highly recommend you to upgrade to a board with 4MB flash.
Either OTA if that is available to you, or using a FTDI.
Hey,
I just wanted to drop my Custom Lambda Effects. Maybe it will help someone.
- addressable_lambda:
name: "Expo Light" //Breathing light
update_interval: 16ms
lambda: |-
static int x = -400;
float y = 0.35+0.65*exp(-pow(x, 2)/49000);
int8_t r = ceil(current_color.r * y);
int8_t g = ceil(current_color.g * y);
int8_t b = ceil(current_color.b * y);
it.all() = ESPColor(r,g,b);
x += 1;
if (x == 400)
x = -400;
- addressable_lambda:
name: "Wipe In"
update_interval: 12ms
lambda: |-
static int x = 0;
if (initial_run) {
x = 0;
it.all() = ESPColor::BLACK;
}
if (x < it.size()) {
it[x] = current_color;
x += 1;
}
- addressable_lambda:
name: "Wipe Out"
update_interval: 12ms
lambda: |-
static int x = 0;
if (initial_run) {
x = it.size();
}
if (x > 0) {
x -= 1;
it[x] = ESPColor::BLACK;
}
Hey 7h30n3!
Thanks for the lambda posts! The wipe in and out is not working, due to an was not declared in this scope for initial_run. Any suggestions? Expo runs fine.
I want to create a affect for my garden. I have 10 lights, all driven by 8 ws2812b leds. For start I want to let bulb 1 and 6 to glow up, followed by 2 and 7 etc
Someone any idea?
Thank you and a great weekend!
I think your problems should be gone, when you use the dev or the latest beta release of ESPHome., because the Wipe effect makes use of this commit: https://github.com/esphome/esphome/pull/1035
This is how you update to the latest beta: https://esphome.io/guides/faq.html#how-do-i-update-to-the-latest-version
super! Thank you! I’ll give it a shot
It worked! Dev version has better UI aswell. I have another problem and maybe someone here can help me;
I made 10 garden lights with in each light 8 ws2812b leds( in a circle)
I’d like a wipe-in and out effect with the lights on both sides of the garden fading in or out with effect.
So the effect should be: light 1 and 6 fade in, light 2 and 7 fade in etc…
I’ve been practicing with range, but I get stuk. I’ve to turn on leds 1 to 8 and 40 to 48 simultaneously. after that 9 to 16 an 49 to 57 should turn on, while the first-ones stay on.
This is the code I have now, but no luck for me…
- addressable_lambda:
name: "Wipe In"
update_interval: 50ms
lambda: |-
static int x = 40;
static int y = 0;
if (initial_run) {
x = 40;
y = 0;
it.all() = ESPColor::BLACK;
}
if (x < it.size(), (y < it.size())) {
it[x, y] = current_color;
y += 1;
x += 1;
}
Hope I’m clear and someone can help me
My scan lambda:
- addressable_lambda:
name: Blue Scan
update_interval: 25ms
lambda:
static int step = 0;
static int direction = 1;
if(initial_run){
step = 0;
}
it[step] = ESPColor(0,0,255);
if(step >0 && step < it.size()){
it[step + (direction * -1)] = ESPColor::BLACK;
}
step = step + direction;
if(step >= it.size() || step < 0){
direction = direction * -1;
step = step + (direction * 2);
}
Hey guys,
Trying to create a breathing red for my non addressable ESPHome stips.
Can I use these, and am I putting them into the lights ESP .yaml
Thanks
Hey Liminal! I haven’t tried any effects for a non-addressable light yet, but maybe I should. Would a ‘breathing red’ raise and lower brightness over 2 seconds or so? I’ll see what I can do. Dashdrum
OK, here’s my first crack at a Breathing Red effect. I’m sure others could do it better, but it’s a start. Note that you can control the length of each “breath” by changing the step_limit and update_interval (not less than 25ms or so). Experiment and have fun!
This code would go below the effects: line in the light definition.
- lambda:
name: Breathing Red
update_interval: 50ms
lambda: |-
static int step = 0;
const int step_limit = 80;
float brightness;
auto call = id(led_mirror).turn_on();
call.set_rgb(1,0,0);
brightness = (float)step / ((float)step_limit / 2.0f);
if(brightness > 1.0f){
brightness = 1.0f - (brightness - 1.0f );
}
call.set_brightness(brightness);
call.set_white(0.0);
call.set_transition_length(0);
call.perform();
step = ++step % step_limit;
Thank you!
I actually ended up getting one from here that works ok
I just tried to compare the two, but I really have no idea LOL, they look so different to the untrained eye?
Different approaches, same basic result. (I like theirs better)
Is it possible to change the brightness of each LED individually?
Yes it is, if they are addressable
Hi there, thought I’d share my (what I consider to be) improved rainbow effect.
lambda: |-
uint8_t led_change = 24; //(higher is more change) the difference in hue for each led down the strip
float speed = 7; //(lower is faster) the speed the first led colour changes at (therefore affecting all)
if (initial_run) {
it.all() = Color(0, 0, 0);
}
unsigned long time = millis() / speed;
int repetitions = time / 1529;
uint16_t hue = time - (1529 * repetitions);
for (int i = 0; i < it.size(); i++) {
if (hue >= 0 && hue < 255) {
uint8_t green = hue;
it[i] = Color(255, green, 0);
} else if (hue >= 255 && hue < 510) {
uint8_t red = hue - 255;
it[i] = Color((255 - red), 255, 0);
} else if (hue >= 510 && hue < 765) {
uint8_t blue = hue - 510;
it[i] = Color(0, 255, blue);
} else if (hue >= 765 && hue < 1020) {
uint8_t green = hue - 765;
it[i] = Color(0, (255 - green), 255);
} else if (hue >= 1020 && hue < 1275) {
uint8_t red = hue - 1020;
it[i] = Color(red, 0, 255);
} else if (hue >= 1275 && hue < 1530) {
uint8_t blue = hue - 1275;
it[i] = Color(255, 0, (255 - blue));
}
hue+=led_change;
if (hue >= 1530) {
hue-=1530;
}
}
The default rainbow effect I found to be too dull in the mixed led colours and only bright on the single led colours. This effect focuses on making sure all colours are equally shown (imo).
I’m also currently working on an effect that uses the currently chosen colour in Home Assistant and (not sure if this is the right term) waves colours similar to it.
lambda: |-
uint8_t led_change = 15; //(higher is more change) the difference in hue for each led down the strip
uint8_t hue_variation = 180; //(higher is more variation) the amount the hue changes from the current colour
int speed = 7; //(lower is faster) the speed the first led colour changes at (therefore affecting all)
if (initial_run) {
it.all() = Color(0, 0, 0);
}
Color pickedColor = current_color;
uint16_t pickedHue = 1500;
if (pickedColor.b == 0) {
if (pickedColor.g < 255) {
pickedHue = 1000 + pickedColor.g;
} else {
pickedHue = 1255 + (255 - pickedColor.r);
}
} else if (pickedColor.r == 0) {
if (pickedColor.b < 255) {
pickedHue = 1510 + pickedColor.b;
} else {
pickedHue = 1765 + (255 - pickedColor.g);
}
} else if (pickedColor.g == 0) {
if (pickedColor.r < 255) {
pickedHue = 2020 + pickedColor.r;
} else {
pickedHue = 2275 + (255 - pickedColor.b);
}
}
uint16_t minHue = pickedHue - hue_variation;
uint16_t maxHue = pickedHue + hue_variation;
unsigned long time = millis() / speed;
int repetitions = time / (hue_variation * 2);
uint16_t hue = minHue + (time - ((hue_variation * 2) * repetitions));
bool backwards = false;
if ((repetitions % 2) == 0) {
backwards = true;
} else {
backwards = false;
}
if (backwards) {
hue = minHue + (maxHue- hue);
}
for (int i = 0; i < it.size(); i++) {
if (hue >= 1000 && hue < 1255) {
uint8_t green = hue - 1000;
it[i] = Color(255, green, 0);
} else if (hue >= 1255 && hue < 1510) {
uint8_t red = hue - 1255;
it[i] = Color((255 - red), 255, 0);
} else if (hue >= 1510 && hue < 1765) {
uint8_t blue = hue - 1510;
it[i] = Color(0, 255, blue);
} else if (hue >= 1765 && hue < 2020) {
uint8_t green = hue - 1765;
it[i] = Color(0, (255 - green), 255);
} else if (hue >= 2020 && hue < 2275) {
uint8_t red = hue - 2020;
it[i] = Color(red, 0, 255);
} else if (hue >= 2275 && hue < 2530) {
uint8_t blue = hue - 2275;
it[i] = Color(255, 0, (255 - blue));
} else if (hue >= 745 && hue < 1000) {
uint8_t blue = hue - 745;
it[i] = Color(255, 0, (255 - blue));
} else if (hue >= 2530 && hue < 2785) {
uint8_t green = hue - 2530;
it[i] = Color(255, green, 0);
} else {
it[i] = Color(255, 255, 255);
}
hue+=led_change;
if (hue >= maxHue) {
hue-=(hue_variation * 2);
}
}
Currently the colours seems to only fade correctly on the first led and I can’t figure out how to properly do it for the rest of the strip
With both effects, changing the variable with the comments will change certain aspects about the effect.
Side note: I’m not sure if this is a well known thing or not, but I still wish I had known it sooner; The addressable lambda section for FastLED lights is extremely similar to how you would write code for a FastLED light on an Arduino using the Arduino IDE. Means that most FastLED functions (like beatsin16()
for example) can be used within the lambda.
Hi @7h30n3
thanks for sharing your Wipe In/Out effects!
Now I want to use them in the on_turn_on and on_turn_off actions of the light component.
Unfortunately only the on_turn_on works, but I guess that because an effect in general is for the light to be on, it is not compatible to call a light effect for the on_turn_off
Do you know how could I have the Wipe Out effect when turning off the led strip?
The code:
light:
- platform: neopixelbus
type: GRB
variant: LC8812
pin: GPIO26
num_leds: 29
id: "neopixel_bookshelf"
name: "Neopixel Bookshelf"
on_turn_on:
- light.turn_on:
id: "neopixel_bookshelf"
effect: "Wipe In"
on_turn_off:
- light.turn_off:
id: "neopixel_bookshelf"
effect: "Wipe Out"
effects:
- addressable_lambda:
name: "Wipe In"
update_interval: 20ms
lambda: |-
static int x = 0;
if (initial_run) {
x = 0;
it.all() = ESPColor(0,0,0);
}
if (x < it.size()) {
it[x] = current_color;
x += 1;
}
- addressable_lambda:
name: "Wipe Out"
update_interval: 20ms
lambda: |-
static int x = 0;
if (initial_run) {
x = it.size();
}
if (x > 0) {
x -= 1;
it[x] = ESPColor(0,0,0);
}
The error:
Failed config
light.neopixelbus: [source bookshelf.yaml:41]
platform: neopixelbus
type: GRB
variant: LC8812
pin: GPIO26
num_leds: 29
id: neopixel_bookshelf
name: Neopixel Bookshelf
on_turn_on:
- light.turn_on:
id: neopixel_bookshelf
effect: Wipe In
on_turn_off: [source bookshelf.yaml:53]
- [source bookshelf.yaml:53]
light.turn_off: [source bookshelf.yaml:54]
id: neopixel_bookshelf
[effect] is an invalid option for [light.turn_off].
effect: Wipe Out [source bookshelf.yaml:55]
effects:
- addressable_lambda:
name: Wipe In
update_interval: 20ms
lambda: |-
static int x = 0;
if (initial_run) {
x = 0;
it.all() = ESPColor(0,0,0);
}
if (x < it.size()) {
it[x] = current_color;
x += 1;
}
- addressable_lambda:
name: Wipe Out
update_interval: 20ms
lambda: |-
static int x = 0;
if (initial_run) {
x = it.size();
}
if (x > 0) {
x -= 1;
it[x] = ESPColor(0,0,0);
}
Thanks for the help!