Lights on w/ door sensor, off after no motion


#1

Wondering if anyone has set anything up like this.

I have a light that turns on when a door is open. I have a motion detector in the room, so the light should stay on for as long as there’s motion in the room, even if the door has been closed. If there’s no motion after 5 minutes, the light can turn off.

I’ve tried this via Smart Lighting, but it gets stuck if the light turns on at the wrong time during the motion update.


#2

Wait wait hang on, I think I got it:

IF
Any of Garage Entrance or Garage/Basement Entrance contact changes to open
XOR
Garage Motion Detector changes to active
THEN
Turn on Garage Light

BUT IF…
Garage Motion Detector stays inactive for 3 minutes
THEN
Turn off Garage Light

Seems to work like a charm…


(Realy Living Dream) #3

I have my front hall light set up with SmartLighting exactly as you describe and it works fine.

SL 1 If door opens turn on light

SL 2 If motion in hall turn on light, if no motion after 5 minutes turn off light.

I’m not sure I understand.

The light on if door opens is actually not needed, since if door opens it will trigger the motion sensor anyways.


(Chris) #4

What’s the reason for the XOR instead of a regular OR?

Also, does your But If section evaluate when the contact triggers the light without triggering motion?


#5

XOR is “and/or”, right? If the light goes off while I’m in the room because I was hidden under the car for 3 minutes, I want it to turn back on if I trigger motion.


(Chris) #6

My understanding is that XOR means “one or the other but not both” (XOR = Exclusive Or). And/Or is inherent in the standard OR, meaning either or both can be true.


(Alan) #7

If I follow your logic, you enter a room, light goes on. Stays on 5 minutes. You leave room. Within those 5 minutes, you re-enter the room. Should the lights a) reset for another 5 minutes or b) continue counting down the original 5 minutes?


(Alan) #8

Check out: http://whatis.techtarget.com/definition/logic-gate-AND-OR-XOR-NOT-NAND-NOR-and-XNOR


(Alan) #9

If you refer to ‘a)’ where the lights reset for another 5 minutes when motion is detected, then you can use a version of my piston NightlightPro. You will need to know how to code some in CoRE, but pretty easy.

Before starting piston, set CoRE for expert mode: Settings->ExpertFeatures turn ON Expert Mode

Here are two views of the same piston.


#10

Hey, thanks. Is there a reason why I see a lot of people skipping the “THEN” part, and just doing a “when true, when false” subroutine?


(Alan) #11

Programing preference, more power/options, more control.