D1 Mini+HC-SR501 switching off (done the basics)

Hi all, totally new to this and trying my best to learn about wled, circuits and sensors so I can create my first project.
I’m trying to create a door sensor, as someone approches, the PIR triggers and runs a light sequence then staying on with white for about 30 seconds for the actual illumination.

I’ve got the D1 mini and PIR connected on a breadboard, I’ve created presets and a playlist.
I’ve assigned the GPIO button to the PIR. It’s now a matter of adjusting the delay and distance on the PIR, but I’m running into problem.

What controls the light sequence to turn off, because the lights stay on with the last sequence in the playlist? Does the PIR trigger the D1 to turn off or does WLED control that portion, if so how?
I’m not entirely sure of the triggering mechanism of the PIR.

This has bugging me for days as its not easy to figure how how many seconds the PIR is delayed for, the pot adjustemnt is just guess work then trying to figure out the lights off time and how.

Also, am I doing this all wrong and/or is there a smarter way to do this, as I could be complicating things unnecessarily, whilst keeping things simple as I dont want to get into home assistant etc? Thanks all

You’ll have to decide if the PIR should trigger your effects as just “On” or both “On and Off”.

For On only (PIR is a button), your playlist runs the various items and gets to the “hold white” (or whatever it is) that’s the last thing you want to see for a time.
Then you need a “turn off” preset that is triggered by the playlist after you deem the PIR event to have expired.

For On-Off (PIR is a switch) you use the same “on” playlist, but the “turn-off” is triggered by the PIR switch going off.

1 Like

Oh I see, so I have two options and as simple as that! I did not know it could be put into a switched state, well the PIR. What option do I chose to make it do that? I can’t choose off in the list, just default or numbers?
I think either will do, need to determine which is more efficient and reliable, so that it resets and gets triggered as many times as needed.

Thank you so much.

Under Config->LED Preferences->Hardware Setup you choose the Button Type from the dropdown list.

Choose either Pushbutton or Switch.

You can check the KB for more info.