How do I turn off a lighting effect during a light.turn_on

I can turn the effect off from Home Assistant, but I can’t find a valid entry for a light.on command to say disable the active effect if there is one in my config.

Log showing it turn off from ESPHOME

[10:50:45][D][light:035]: ‘Left Top’ Setting:
[10:50:45][D][light:046]: State: ON
[10:50:45][D][light:084]: Transition length: 1.0s
[10:50:47][D][light:035]: ‘Left Top’ Setting:
[10:50:47][D][light:108]: Effect: ‘Flicker’
[10:50:53][D][light:035]: ‘Left Top’ Setting:
[10:50:53][D][light:084]: Transition length: 1.0s
[10:50:53][D][light:090]: Effect: ‘None’

Example config:

- light.turn_on: 
    id: left_top
    transition_length: 3s
    red: 100%
    green: 71%
    blue: 43%
    brightness: 100%

Is there something I can add to tell this specifically “No effect, if one is applied, turn it off?”
So far I’ve tried:

effect: None
effect: 'None'
effect: False
effect: 
effect: Null

and all give me a “Failed Config” message when I attempt to compile.

Is there a way to do this? Thanks!

If I use the following syntax, I don’t get an error message…

    on_turn_on:
      - light.turn_on: 
          id: my_led
          effect: "None"
          brightness: 75%

That worked! I’m assuming it’s because I’d done single quotes before, I’m surprised I didn’t try double as well.

Thank you

@jsuanet
I’m trying to accomplish something similar to the above with RGBCCT 5-in-1 Ledsand a slow rainbow effect and color interlock. I have the following, but when I switch to the white leds, the white leds stay on for the set duration of the effect previously selected, then revert back to changing colour again. I’d like it so when I select the white leds to On (or triggered at a later date by a sensor), that it switches Off the effect and stays on white util I set it back to colour.
Could you offer some help?

    
sensor:
  - platform: wifi_signal
    name: "WiFi Signal $devicename"
    update_interval: 60s
output:
  - platform: ledc
    pin: 26
    frequency: 25000Hz
    id: ledc_cw
  - platform: ledc
    pin: 18
    frequency: 25000Hz
    id: ledc_ww
  - platform: ledc
    pin: 19
    frequency: 25000Hz
    id: ledc_r
  - platform: ledc
    pin: 23
    frequency: 25000Hz
    id: ledc_g
  - platform: ledc
    pin: 05
    frequency: 25000Hz
    id: ledc_b
    
light:
  - platform: rgbww
    name: "Kitchen Colour LEDs 2"
    id: kcl2
    warm_white: ledc_ww
    cold_white: ledc_cw
    red: ledc_r
    green: ledc_g
    blue: ledc_b
    cold_white_color_temperature: 5000K
    warm_white_color_temperature: 3000K
    color_interlock: true
    
    effects:
      - lambda:
          name: Slow Rainbow
          update_interval: 16s
          lambda: |-
            static int state = 0;
            auto call = id(kcl2).turn_on();
            call.set_transition_length(15000);
            if (state == 0) {
              call.set_rgb(1.0, 0.0, 0.0);
            } else if (state == 1) {
              call.set_rgb(1.0, 0.5, 0.0);
            } else if (state == 2) {
              call.set_rgb(1.0, 1.0, 0.0);
            } else if (state == 3) {
              call.set_rgb(0.5, 1.0, 0.0);
            } else if (state == 4) {
              call.set_rgb(0.0, 1.0, 0.0);
            } else if (state == 5) {
              call.set_rgb(0.0, 1.0, 0.5);
            } else if (state == 6) {
              call.set_rgb(0.0, 1.0, 1.0);
            } else if (state == 7) {
              call.set_rgb(0.0, 0.5, 1.0);
            } else if (state == 8) {
              call.set_rgb(0.0, 0.0, 1.0);
            } else if (state == 9) {
              call.set_rgb(0.5, 0.0, 1.0);
            } else if (state == 10) {
              call.set_rgb(1.0, 0.0, 1.0);
            } else if (state == 11) {
              call.set_rgb(1.0, 0.0, 0.5);
            }
            call.perform();
            state++;
            if (state == 12)
              state = 0;
             

Sorry, I don’t have any experience with RGBCCT leds.

Hi @jsuanet,

Okay, thank you for taking the time to reply.

Darren.