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.
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.
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).
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.
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?
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!
Access WLED Web Interface: Open the WLED web interface for your LED strip.
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
Create an Automation: In Home Assistant, create an automation triggered by your motion sensor.
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
Create a Second Automation: Triggered similarly based on the location of the motion.
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!