Motion Based Light EXCEPT when Manually turned On

manual
except
off
light
motion

#27

ok. the sample i posted here allows use of dumb switch to force the light to stay on when you are not moving around but sitting somewhere reading a book and there is no motion for the motion sensor to pick up. this way you dont have to shake an arm and a leg every 5 mins. :slight_smile:

did you want that feature or you dont really need this?

EDIT: when i say dumb switch, basically its a smart bulb in a socket controlled by a regular switch. the bulb is connected to ST but the switch is not.


#28

No I don’t have anything to use with that feature. It will only run at night so I’m not too worried about having to wave an arm if I really need to, or I can always just get up and flick the switch off then on to keep it on manually right?

I think I figured out how to set the mode restriction, now I just need to set it to give me the dimmer warning after three minutes of inactivity before turning off completely 10 seconds later.


#29

yup

thats great. between the wait 5 mins and turn off insert these 2 tasks:

set level to 60%
wait 10 seconds

but, the way that piston is right now, it only turns off 5 mins after the last motion. so, if there is continued motion after the light turns on, it wont turn off anyways.


#30

So I used this backup code and noticed a large section is greyed out. should that be modified for my example? It does not show up when I screen shot, but it does when I am editing.

I had a similar piston in CoRE and when I rebuilt it in WebCoRE, it was not working as it did. So I dumped it when I saw this example. Thoughts?


#31

i just imported the piston posted in this example with the code edsh2. i am not seeing any greyed out code.

did you use the orange button to restore the piston?

EDIT: i imported the piston with code u9et. i do see the greyed out code block. very strange. not sure what is happening.

please delete the greyed out code block.


#32

OK, I have to delete them row by row which is cool. What does “programmatic” mean? Does that just mean the inverse of what the variable currently is?


Motion/Ambient Light/Previous State based lighting piston
#33

wait, dont delete row by row. just select the if and right click on it in the gutter and delete that entire greyed out if.

did you mean !programmatic? if yes, then yes. :slight_smile:


#34

thanks


#35

sure thing.


#36

OK I think I figured out my problem of why the timer does not turn off my lights. My “light” is really a GE Smart Switch. So when I turn on the light with motion, it is turning on my switch. Is there a feature of physically turning it on vs turning it on with automation?


#37

I have the ge "dimmer "switches. And they can’t discern from programmatic or manual. I have tried, but to no avail.


#38

FINAL - Here is how I got around the physical switch issue. I used a variable that the motion sensor turns to true, and when the lights turn off after motion changes to inactive, the variable goes false. So if the switch is physically turned on, the variable does not change and then the lights stay on. Thanks for helping me think through this.


#39

after the light is turned on by motion and before it turns off, if there is motion again say 30 seconds before the wait timer expires, does the light still turn off 5 minutes after that last motion?

thanks.


#40

no, this piston would reset to motion and then once the sensor changes to motion inactive, the counter goes back to 5 minutes. In my use case, I prefer it this way. I did move the row for the variable to change to false after the light is turned off. This will ensure I can move as much as possible and everything will go back to 5 minutes. Once the lights finally turn off, then the variable will become false. Thanks again for work through this with me.


#41

yep, that was the one change needed so that if the wait is interrupted by motion, the light Is still turned off 5 minutes after the last motion.

If you would please add the FINAL FINAL snapshot to this thread, that would help out any users looking for something like this subsequently. :slight_smile:


#42

FINAL Working!!!

This piston will turn on a light with motion and turn off X time after motion. If the light is manually switched on, it will stay on regardless of motion until it is switched off again (physically, Alexa, etc.)


#43

Changed a little for my needs. Added sunset to sunrise and auto setting of variable to false if using more than 1 switch.

Backup code is qvt9p. Could not get in screenshot since using an iPad to set this up. Works like a charm, thanks @Sal


#44

Dang it. Found a glitch


#45

Sal,

I’m using your piston, but I’m not getting an override when I turn my physical Z-wave dimmer switch on…I’m finding it’s just about impossible to turn on the switch before the sensor detects the movement. I tried turning on the switch even after it was on, but that didn’t work.

Any suggestions of additional code I can add to your piston to make it so that even if the sensor turns on the light, I can have a process to override it turning back off after motion is inactive?

I tried turn the dimmer switch off and back on, but it still turned off after the motion didn’t sense movement.


#46

if use the original example piston. it was built for just that use case: