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.