Can't start a light effect with `on_boot` or `on_turn_on`

hello,

I my lights are working just fine, including control from HA, but I can’t get the lights to boot or turn on with the desired effect. Setting the initial color works fine. I can turn on the effects in HA after turning on, but when I turn the light off either via HA or a physical power switch, it restarts without the desired effect. Can anyone help me out, please?

esphome:
  name: table-lamp
  friendly_name: table_lamp
  on_boot:
    - priority: 500.0
      then:
        - light.turn_on: 
            id: table_lamp
            brightness: 100%
            red: 100%
            green: 50%
            blue: 0%
            effect: flicker

esp32:
  board: esp32-c3-devkitm-1
  variant: esp32c3
  framework:
    type: arduino

logger:

api:
  encryption:
    key: "XXX"

ota:
  - platform: esphome
    password: "XXX"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:
    ssid: "Table-Lamp Fallback Hotspot"
    password: "XXX"

light:
  - platform: neopixelbus
    num_leds: 7
    type: GRB
    variant: ws2812x
    id: table_lamp
    pin: GPIO10
  - platform: partition
    name: "Ring #2"
    segments:
      - id: table_lamp
        from: 0
        to: 6 
    restore_mode: ALWAYS_ON
    on_turn_on:
      then:
        - light.turn_on: 
            id: table_lamp
            brightness: 100%
            red: 100%
            green: 50%
            blue: 0%
            effect: flicker
    effects:
      - addressable_flicker: 
      - addressable_twinkle: 
      - pulse: 
      - flicker:
          
    internal: false
captive_portal:

esphome version 2024.12.4

thanks!!

Try with lower priority value

Hmm I tried with priority 800 and -100. neither one worked.

Use logger to see if the on_boot code is running:

  on_boot:
    then:
      - logger.log: "Hello World"

You might also try putting your startup configuration into a script then just call the script on boot.

Ok I added the logger.log and it didn’t show in the log. I guess the boot isn’t actually getting called. I tried this with priority -100 and priority 100