Breathing Red Effect ESPHome?

Hey guys,

What’s the best way to add a breathing red effect to my non addressable LED lights. (running on a magic home controller)

I have found this;

But I have no idea how to add it to the .yaml or, how to get just red?

Any advice would be great :slight_smile:

hello:
maybe look here at 'lambda-effect"

Thanks,

That did help :slight_smile:

I was missing effects, now im stuck on ID. but have no idea what it needs in this context.

Keep looking

Here’s how I do it on a non-addressable RGBW strip:

  - platform: rgb
    name: "Cabinets"
    id: h8011    # < --  here is where your ID is set
    red: pwm_r
    green: pwm_g
    blue: pwm_b
    effects:
          - lambda:
             name: Red Breathing
             update_interval: 1s
             lambda: |-
              static bool state = true;
              static int color = 1;
              auto call = id(h8011).turn_on(); //the id of your light
              call.set_transition_length(1000);
              call.set_rgb(1.0, 0.0, 0.0); // color, 1.0 is fully lit
              if (state) 
              {
                  call.set_brightness(1.0);
              }
              else
              {
                  call.set_brightness(0.20);
              }
              call.perform();
              state = !state;     
              
          - lambda:
             name: Breathing
             update_interval: 1s
             lambda: |-
              static bool state = true;
              static int color = 1;
              auto call = id(h8011).turn_on(); //the id of your light
              call.set_transition_length(1000);
              if (state) 
              {
                  call.set_brightness(1.0);
              }
              else
              {
                  call.set_brightness(0.20);
              }
              call.perform();
              state = !state;         

The second ‘Breathing’ effect allows me to set the color in the light.turn_on call from HA, along with the effect name.

HTH,

2 Likes

Mate, thankyou!

I was overthinking it as usual HAHA, I just wasn’t sure where it should go or what it has to be called. But I got it now.

Thanks again, big help :slight_smile: