Need Motion Sensor Lighting Help


#1

1) Give a description of the problem
I created a piston based on another user’s piston named Andy. His was pyh4d. From my understanding it was supposed to do all the things I need in a piston. I have a very cranky stepson who comes over on every other Monday night, Wednesday nights, Friday Nights, and Sunday nights…yeah, I know, it’s a weird custody schedule. It’s not me or my wife’s fault though. That’s another story.

But anyway, my stepson gets upset because our cat goes to the basement at all hours of the night, activating the sensor I have for the basement stairs and laundry room, which is for my wife can see if she ever needs to go down there. So in frustration, my stepson will unscrew the 3 light bulbs, which irritates me. I’ve even had schedules set up in Smartthings Smart Lighting to only work during certain hours and certain days, but it just hasn’t been good enough and lights still get unscrewed and I’m trying to be extra loving and patient to my stepson because his own father is a monster to him and his brothers.

So I want to create a good motion sensor with no conflicts that do these key things:

Turn on when there’s motion, but have different brightness settings at specific times of the day (as seen in the piston). Not operate at all after 8:00pm (but only on the nights my stepson is over because I want me and my wife to be able to see without falling down the stairs on the other nights). I want Alexa or Smartthings to manually override the lights if my wife or I ask them to turn on (not to turn off through the motion sensor, if possible). Then here’s the last and most important for me, to keep my cool with my stepson…I want him to be able to do a button press on a Smartthings button (preferably a double press since the other presses are already customized…unless I just go out and buy a special dedicated button just for this purpose) that will allow him to pause or stop motion sensing, no matter what time of day, when he’s with us, so that way he doesn’t keep messing with our light fixtures. Last time he did it so much that I had to buy a new fixture and replace it…and we have very brittle and short wire in our house, which makes it extra annoying.

Sorry for the long explanation. Just hoped someone would understand my needs and desperation as a stepparent and help me. It’s definitely not like the Brady Bunch anymore.

2) What is the expected behaviour?
Explained above.

3) What is happening/not happening?
Right now nothing happens. No lights come on and it reads as false in Webcore.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

First, you have four triggers that are all the same doing different things. You should make motion sensor 1 changes to active a single condition in an if statement and them move all the other logic under that.

I would suggest a virtual switch that you can turn on/off with Alexa and then use that as a check in this piston to ignore the motion sensor. You could also make a second virtual switch for when your stepson is present and use its status to override the motion sensor. something like this:

if motion sensor 1 changes to active
 then
   if manual switch is on or stepson present is on
     then
       exit "Ignoring motion"
   endif
   if time time is between...
   end if
   set piston status "Motion lighting"
end if

I suggest creating a separate piston to turn on/off the lights based on the Alexa switch command. Just keeps things cleaner.


#3

Use a single IF block for all same triggers.

IF motion sensor 1 changes to ACTIVE
  then here all your needs

or even better rent an apartment for the stepson LOL

edit : ops just saw that guxdude had the same suggestion… Sorry for the repetition.