Need help with an Addressable LED Light Strip custom effect

So I have been working on an addressable LED light strip to see if I can setup some permanent lights that during holidays I can just set them to the what ever holiday effect and have holiday lights. I have the light strip working and the below random color sections works. Every two seconds it changes the colors of each 5 pixel sections to something random. Ok great, but now my issue is I’m not understanding how I can have it slowly transition over say 10 seconds to one of 5 different colors.

So I’m hoping that someone can point me at some things to read/look over to understand how to make this happen. I’m new to coding in HA so I’m sure thats part of the issue.

Any assistance would be appreciated.

      - addressable_lambda:
          name: "Random Color Sections"
          update_interval: 2s
          lambda: |-
            if (initial_run) {
              it.all() = Color::BLACK;
            }
            for (int i = 0; i < it.size()/5; i++) {
              it.range(i * 5, i * 5 + 5) = Color::random_color();
            }

Sorry, not to throw you off your game, but have you had a look at the WLED project, which integrates into HomeAssistant rather nicely:

https://kno.wled.ge/

I think you will like what you see.

I will look at that but right now I would like to understand how to get this to work with how I’m doing now.

Taking a quick look at the documents, this is worth a shot:

      - addressable_lambda:
          name: "Random Color Sections"
          transition_length: 0.5s
          update_interval: 2s
          lambda: |-
            if (initial_run) {
              it.all() = Color::BLACK;
            }
            for (int i = 0; i < it.size()/5; i++) {
              it.range(i * 5, i * 5 + 5) = Color::random_color();
            }

See if this works for you.

Thanks for the post but I get a message saying that “transition_length” is an invalid option. So apparently addressable_lambda does not support it.

I’m starting to think that I need to use lambda and not addressable_lambda, but I have not given up yet.

Ok, how about if you try this:

      - addressable_lambda:
          name: "Random Color Sections"
          transition_length: 0.5s
          update_interval: 2s
          lambda: |-
            call.set_transition_length(1000);
            if (initial_run) {
              it.all() = Color::BLACK;
            }
            for (int i = 0; i < it.size()/5; i++) {
              it.range(i * 5, i * 5 + 5) = Color::random_color();
            }

After this, I’m all out of ideas : )

I tried the call.set_transition_length(1000); already and your get a message that call is not defined. Its one of the reasons I think I will have to use just lambda since it looks like its possible to get call defined there.