SmartThings Community

Using Motion Detector to keep lights on?


(John Miller) #1

Hello… New user to smart home tech… I have question about my first real project… We have a room in our home that my two children use for schoolwork. There are 3 lights in this room, one floor lamp, and two wall mounted lamps. My goal is to set up the three lights on 2 appliance module’s then add a motion detector so that when they are in the room, the lights stay on, and not when they aren’t… I’m specifically looking at the Ecolink Zwave motion detector on Amazon. My question is this: Will a setup like this see motion and turn the lights on and keep them on until there is no motion, or will it turn the lights on for the programed ‘reset’ time, then turn them off until there is another ‘motion event’… I don’t want them having to wave arms around during school to turn lights back on all day? Hopefully this makes sense… Thanks in advance…


(Brian Salyer) #2

I used CoRE to do something similar for my kids playroom. What this does is it turns on the light with motion and turns the lights off if there is no motion for a few minutes. In addition though, if your kids are studying there may not be much motion, so I have a variable that will keep the lights on, even without motion, if the switch was manually turned on. Then if they leave, the light would turn off when they turn off the switch or if I see it on I use Alexa to turn it off.


#3

Welcome! :sunglasses: (I’ve moved this to projects so you can get individualized responses based on your own setup.)

The short answer is that you can set it up however you think it will work best for your family. But it is true that the motion sensor is going to send a report when it detects motion and then send another report when whatever its reporting period is up and it has not detected motion. But what the system does when it receives those reports depends on the rules that you set up.

It’s quite difficult to have a single motion sensor cover an entire room. So the first thing to be aware of is that many people will put two or three motion sensors in a room and combine them into a zone so that activity in any zone will count as activity for the purposes of something like turning the lights on.

Next, it’s completely up to you whether you have the lights go off based on the motion sensor or not. You might decide to have them go off based on something else, even just time of day.

Speaking of time of day, you could have different rules for different times. For example, on school days, say Monday through Friday, You might want to have the lights come on when someone enters the room, but have a longer period of inactivity before they go off, maybe 45 minutes. Just to pick up all of those fairly quiet times.

Then in the evening when you’re not expecting people to be in the school room unless they’re going in there to get stuff, you might change it so that the lights will go off after 10 minutes of inactivity. Again, it’s your choice how you set up the rules.

You could also combine the motion sensor with other kinds of sensors, like a sensor on the chairs or a sound sensor. Of course, that means paying for more devices, which might not be worth it to you. Different people will have different interests and requirements.

So the short answer is that you were absolutely right to think about what will be needed to keep the lights on. But as long as you’re willing to invest in a couple of extra devices per room, it’s quite likely that you can set it up pretty much the way you want. :sunglasses:

You will particularly find core useful, as it lets you do stacked conditionals, which is usually what you need for this kind of situation:

Also, an interesting thread on office chairs that might give you some more ideas:


(John Miller) #4

Ok, awesome… Thank you both… I really appreciate the suggestions… I’ll take a look at CoRE and see if I can get a handle on it… Looks really interesting…

In terms of room size, It’s a pretty small room, probably 12x12… I’ll pick up a few motion sensors and see how it pans out…

So just to be clear on the “Logic” behind how a motion sensor would function… When a motion sensor sees motion, and turns on the lights… Does it then start a timer for whatever time interval you’ve set up, and then at the conclusion of the time, turn the lights off and wait for motion? Or, alternatively, does it turn lights on, then each time it sees motion within it’s “Motion on timeframe” does it reset the timeframe? Put another way, if it’s set to high sensitivity, and there is always some level of motion going on in the room, will the lights go out?

I did think about adding a switch to give another level of control as discussed above (Thank you Brian) but I don’t want the switch over riding the “Lights off with no motion” as thats my primary reason behind doing this room… (Rug rats can’t remember to turn those dang lights off!)…

Cheers, and thanks again, looking forward to learning so much more!


(Brian Diehl) #5

If you don’t mind a motion sensor mounted on the ceiling in the middle of the room, I highly recommend the enerwave model. It has 360 degree view.

Another option you can consider, depending on the layout of your house, is to have a motion sensor in their room turn on a virtual switch for the room (we’ll call it occupancy_switch for this discussion) as well as the lights.
Add a motion sensor outside of their room (hallway leading away from their room or similar) that will turn off the occupancy_switch if there is no motion detected in their room in the next few minutes (whatever time interval you want to set). Once that occupancy_switch is turned off, it would turn off the lights in their room. If there is motion detected in their room (maybe only 1 kid left the room, or it was a parent coming to check on the kids, etc), it would leave the lights and occupancy_switch on.
All of that could be done in CoRE.


#6

The motion sensor itself doesn’t actually do anything to control the lights. All it does is send its “motion detected” Report (checking on the interval you have it configured for) and then it sends its “inactivity detected” report based again on an interval you have configured it for.

You will then set up various rules in SmartThings for handling those two reports. This is what allows you to have different rules for different times of day or whatever.

So you can pretty much make the rule however you want it to be. Particularly if you use core. You could have it do any of the examples you gave in your post, it’s just up to you what will work better for you.

If you want to have a timer that keeps resetting, you could have that.

If you don’t want to have the timer reset, you could create a rule that is just based on the first Report of motion.

Many people use core to create a manual override so that ordinarily the system will turn the light off after a specific period of inactivity on the motion sensor, but if someone hits the manual switch on the wall, then the light will stay on until that switch is turned off.

Pretty much anyway that you can conceive it you can write a rule using core to implement that logic.

If you want to verify any specific concept, just ask in the core peer Assistance thread and the core experts there will be glad to tell you if it is possible.

But one of the best things about SmartThings is that you don’t actually define the logic in terms of the device. The hub collects the reports from the devices, but then you manage the logic in the rules (in the case of core, a rule is called a “piston”)

For example, there is a motion sensor in the bedroom at my house. During the day, if the motion sensor sends an activity report, the system ignores it. Nothing happens.

In the evening, if the motion sensor sends an activity report, the system turns on the overhead light in that room.

Then at night, when I am ready to go to bed, I change the “mode” on the system to “asleep.” Once the system mode is “asleep”, if the motion sensor sends an activity report, the system does not turn on the overhead light in that room. Instead, it turns on a soft night light on the wall.

Every morning at 7 AM, the system mode is automatically changed back to “daytime” and then the motion sensor activity reports will be ignored again.

So you see, the behavior is not tied to the specific motion sensor device. Instead, I have created rules in the system which determine how the motion sensor report will be handled when they come in based on other context. :sunglasses:


(Dima) #7

You dont need CoRE for this. This is a simple function within ST and can be set up on mobile app.


(Jason "The Enabler" as deemed so by @Smart) #8

I’m not sure of your geographical location, but if you are US or Canada, I highly recommend the 2nd generation iris motion sensors from Lowe’s, also available on Amazon.

They are cheap, small, very fast, and they are able to run local, and they are very sensitive.

I have one on my wife’s vanity mirror that keeps the lights on for her. The others in the room were too far away to puck her small movements while fixing her makeup. The one in the mirror is no more than 2 ft away. I have found that when that close they will detect very slight movements.

So, if your kids door at desks, you could have it underneath punting down. Kids are already fidgeting their feet and legs, so if they are at the desk, they will be detected.

With the 30.00 price tag allows you to put these everywhere! I have three in each bathroom! Lol


(John Miller) #9

Hey all…

Wanted to say thank you and update on my second “automation project”… Lots of complex stuff on the forum, so thanks to you guys for answering questions from a complete noob…

I decided to go with “simple is better” for this, and see how it worked out… Went with 2 Linear appliance modules for lights, and the Lowes “Iris” motion detector… Only needed one sensor due to the size of the room… So far in 2 days of schooling, the lights have only kicked off once when I wouldn’t have chosen them to… Mostly because only one of my kids was in the room taking a test… With 2 kids, and their Mom in the room, It’s working beautifully… All programming via smart things app…

I’m interested in getting into the CoRE thing, but all of my research has come up empty… was hoping to find a “beginners guide” or some sort of step by step instructions on it… I’ll continue looking…

On to the next project… Basement overhead lights and dimmers!

Cheers!


(Jason "The Enabler" as deemed so by @Smart) #10

Take a look here… a ton of great information…

http://thingsthataresmart.wiki/index.php?title=ThingsThatAreSmart_Wiki