1) Give a description of the problem
Hey all, this is my first piston and I need a little help! I’m using a SmartThings motion and multipurpose sensor to turn on bathroom lights and have these scenarios:
2) What is the expected behaviour?
- Person enters bathroom, motion is detected, door is not closed. Light(s) turn on (100% daytime or 1% nighttime), then turn off after 1 minute of inactivity. This is as far as I’ve got.
- Person enters bathroom, motion is detected, door gets closed. Light(s) turn on but should not turn off again until the person leaves the bathroom. This part I can’t figure out.
I thought of checking whether the door was opened after motion detected, but if my girlfriend was to walk in while I’m showering, then close the door again on her way out, that’d trigger the turn off sequence.
I think the best way is checking if new motion has been detected after door has been closed (i.e. door was closed from inside, not outside) but unsure how to do it, especially as the motion sensor is still showing as “motion” for 15 seconds or so after I’ve left the room.
3) What is happening/not happening?
Unsure on how to write part 2 above. Lines 29-49 and 59-67 are my solutions for part 1.
4) Post a Green Snapshot of the piston
5) Attach logs after turning logging level to Full
Thank you in advance!