Intercept turn on/off for LED strip for a custom turn on sequence

I am wanting to run an effect when an LED strip is turned on/off. The strip runs up the stairs so if the motion sensor at the top landing is triggered, I want the LEDs to turn on from top to bottom. Same for the bottom landing; turn on from bottom to top. Did anyone create anything like that?

There an example of a color wipe on the site but wasn’t sure if the turn_on/turn_off can be overridden.

  • platform: …
    • addressable_lambda:
      name: “My Custom Effect”
      update_interval: 16ms
      lambda: |-
      // Example: Simple color wipe
      for (int i = 1; i < it.size(); i++) {
      it[i] = it[i - 1].get();
      it[0] = light::ESPColor::random_color();
1 Like