Turn on leds one by one (like wipe, but keep them on)

Hello, I am pretty new to WLED and just implemented it in HASSIO using the integration. Really like the amount of effects, reliability and speed!

I have got a led strip of 468 leds between both my stairs. The strip is behind the stair railing.
When movement is detected, I would like to turn the leds on one by one starting from downstairs all the way to the attic. Like the wipe effect, but than keep them on when they are all turned on. Is there a way to set the effect like this without modifying the WLED code?

As a bonus, I would also like the following. When movement is detected on the first floor I like to turn the part of the strip from the stair between ground floor and first floor on from top to bottom. The part of the strip from the stair between the first floor and second floor should turn on from bottom to top. I believe I should be able to use segmentats for that.

Take a look at the github project files, specifically the usermods section, and see the wipe basic meant for exactly the situation you describe.
You will need to integrate that usermod into WLED and build the firmware. If others have already done it, they may make it available to you if you cannot build it yourself.

1 Like

Wow thank you for your fast reply! I gonna take a look at that. Building the firmware is totally new for me though. I gonna give it a try :slight_smile:

1 Like

Indeed this project looks exactly like what I would like to achieve. Thanks for your advice.

I have googled around to look how to build my own firmare. To be honest I have no idea what to do or what I am doing. :sweat_smile:

I have done the following in Arduino IDE so far:

  1. Install the ESP8266 board manager.
  2. Selected the NodeMCU 1.0 (ESP 12-E Module). I use the NodeMCUv2 and am succesfully running Wled on this default Binary: WLED_0.x.x_ESP8266.bin;
  3. Copied the code in ‘wled06_usermod.ino’ from the stairway_wipe_basic into ‘usermod.ccp’.
  4. Tried compiling.
  5. Received error ‘ESPAsyncTCP.h: No such file or directory’.

Would be great to receive any assistance on this. I would really like to learn how to do this, but I have no experience with Arduino IDE.

In that case, get rid of the Arduino IDE (at least temporarily). Instead, install Visual Studio Code, and follow online guidance for integrating PlatformIO into VS Code for use with Arduino.

Don’t install ANY library in VS Code or platformIO.
Then point VS Code/Platform IO at your clone / fork of WLED, and you can copy in the usermod file from its folder into the main folder where the empty usermod file is.
Then you follow more online guidance for compiling your first PlatformIO project for arduino / ESP8266.
It will be so much easier.
Also, there are probably easier ways to do the above steps, but that’s what worked for me.

I’ve gotten to the point of installing everything, loading the code, but not found how to select the board yet.

The internet is filled with examples of how to open an existing platformio arduino project, compile, build, and deploy to esp8266/esp32. Both html (blogs/web pages), and video (youtube and such).

Everything I’ve found so far all starts from scratch.

Let’s say you accept all the default settings when installing VS Code & Platform IO’s IDE.
Now you have a default folder associated with PlatformIO projects.
Copy the WLED clone/fork to that folder.
Now pretend you are about to compile Tasmota, and watch this: https://www.youtube.com/watch?v=Sz2zc_0PdiY
Starting around 15-20 minutes in is where the magic happens.

2 Likes

I’m going to split this out of this thread. Sorry OP.

I have succesfully built the default master branch and uploaded it to a NodeMCU v2. Thank you for your advice and the youtube link!

However, I am not able to use the usermod stairway_basic_wipe. The file in it is a .ino file which causes ‘40 problems’. Do you have any advice on that?

Ok, so I copied the content of the .ino file into usermod.cpp and the errors disappeared. Also I followed these instructions: https://docs.platformio.org/en/latest/faq.html#convert-arduino-file-to-c-manually

The file project compiled succesfully and I have even succesfully loaded the firmware over the air on a fresh NodeMCU using the Default WLed I just installed on it. So, it looks like I’m almost there.

The usermod’s descriptions is the following: Use userVar0 and userVar1 (API calls &U0=,&U1=, uint16_t)

So I have called the following /win&U1=, nothing happens. When i try /win&T=1 for example it turns on, win&T=0 makes the strip turns of. So the API should be working. Might there be a problem with my usermod?

Just to answer my own question… I have to use command as follows: /win&U0=1. Works like a charm!

Thanks a lot for your help!

1 Like

I am so glad you got it to work for you :smile:

1 Like

is there any way to achieve the same without new firmware in 2024?)

Open this as a new topic, this post has been marked as solved.

That sounds like a fantastic project! You can achieve your effects using Home Assistant automations and WLED segments. Here’s how you can set it up:

Step 1: Create Segments in WLED

  1. Access WLED Web Interface: Open the WLED web interface for your LED strip.
  2. Set Up Segments: Go to the “Segments” section:
    • Define a segment for the ground floor to first floor (e.g., LEDs 1-156).
    • Define another segment for the first floor to the attic (e.g., LEDs 157-468).

Step 2: Home Assistant Automations

Automation for Full Stair Wipe Effect

  1. Create an Automation: In Home Assistant, create an automation triggered by your motion sensor.
  2. Action Steps:
    • First, activate the wipe effect on the entire strip.
    • Use a delay or a repeat action to turn on each LED one by one.

Here’s an example automation YAML:

alias: Stair Wipe Effect
trigger:
  - platform: state
    entity_id: binary_sensor.motion_sensor  # Update with your motion sensor
    to: 'on'
action:
  - service: light.turn_on
    target:
      entity_id: light.your_wled_strip  # Update with your WLED entity
    data:
      effect: 'Wipe'
      transition: 1  # Transition time for effect
  - delay: "00:00:05"  # Wait for effect to start
  - service: light.turn_on
    target:
      entity_id: light.your_wled_strip
    data:
      brightness: 255
      segments: 
        - id: 0
          start: 0
          stop: 467  # Ensure all are set to on after wipe

Bonus Automation for Specific Floor Effects

  1. Create a Second Automation: Triggered similarly based on the location of the motion.
  2. Action Steps:
    • Activate the first segment from top to bottom.
    • Activate the second segment from bottom to top.

Example YAML for the bonus:

alias: Floor Specific Wipe Effect
trigger:
  - platform: state
    entity_id: binary_sensor.motion_sensor_first_floor  # Update with your first floor motion sensor
    to: 'on'
action:
  - service: light.turn_on
    target:
      entity_id: light.your_wled_strip
    data:
      segments: 
        - id: 0  # Ground to first floor
          start: 0
          stop: 156
          brightness: 255
        - id: 1  # First to second floor
          start: 157
          stop: 468
          brightness: 255

Final Touches

  • Testing: Test the automations to ensure they work as expected.
  • Adjustments: You may need to tweak delays or brightness settings based on your preferences.

This setup allows you to achieve both the full wipe effect and the specific floor effects using segments, all controlled through Home Assistant. Let me know if you need any more help!