# Newbee Question: restricting motion sensor alerts to a specific time period?

**URL:** <https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696>\
**Category:** Automation Ideas\
**Created:** [February 28, 2016, 8:10pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696 "2016-02-28T20:10:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jemanner](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jemanner](https://community.smartthings.com/u/jemanner)\
**Post date:** [February 28, 2016, 8:10pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/1 "2016-02-28T20:10:54Z")

</div>

I apologize for such a basic question, but can a motion detector be programmed to only provide an alert during certain hours, i.e. for instance 10:00 PM to 6:00 AM?

---

<div class="post-metadata">

**Author:** ![Belgarion](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/belgarion/32/21663_2.png) [@Belgarion](https://community.smartthings.com/u/Belgarion)\
**Post date:** [February 28, 2016, 8:27pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/2 "2016-02-28T20:27:03Z")

</div>

Hi Jim,

> [@jemanner](#):
>
> can a motion detector be programmed to only provide an alert during certain hours

The motion detector itself is just a device, but what I think you want to do is have something happen between certain hours?

If that is the case, you can use a SmartApp called “Rule Machine” (commonly referred to as “RM”) to easily have something happen (like turn on lights) if a particular trigger (like motion detected) during certain hours of the day.

Here are a few links to get you started:

> [@Rule Machine Version 1.7 Released](https://community.smartthings.com/t/rule-machine-version-1-7-released/37355):
>
> Rule Machine Version 1.7.0 released This update is primarily to add thermostat operating state functionality and to fix bugs related to thermostats. It is now possible to use thermostat operating state as a trigger or condition, in addition to thermostat mode. Certain bugs were identified in the previous versions with respect to thermostat modes and fan operation. These have been fixed. Due to limitations of my setup, I am not able to fully test these features. Feedback is greatly appreciated, and I shall respond to any bugs reported promptly. Rule github: [https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule.src/rule.groovy](https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule.src/rule.groovy). Save and Publish for me.

> [@Rule Machine - Get peer assistance here with setting up rules](https://community.smartthings.com/t/rule-machine-get-peer-assistance-here-with-setting-up-rules/29577/1):
>
> I’m creating this thread as a place to find assistance in programming the logic of the Rule Machine App. @bravenel - I see you doing a lot of updates every day and posting them in the [Release] thread, I figure this will help to keep it clean and not get hijacked… as much… I’ll start! I’ve set up some rules for my front porch lights. I haven’t figured out how to do with any less than “4” separate rules. I’d like to simplify this as much as possible. What I want: Lights come on 20 minutes prior to sunset, go off at 11 pm, and be set to 30% When either my wife or I come home between sunset and 11pm, even if the other is already there, the lights go from 30% to 99% for 10 minutes. After 10 minutes they go back to 30%. If it is after 11 pm and before sunrise, I want the lights t…

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [February 28, 2016, 8:28pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/3 "2016-02-28T20:28:54Z")

</div>

> [@jemanner](#):
>
> I apologize for such a basic question, but can a motion detector be programmed to only provide an alert during certain hours, i.e. for instance 10:00 PM to 6:00 AM?

Yes, but if you’re doing it with smart home monitor, you have to do it with a “custom rule” not under “security.”

I don’t know if that means it will work with scout alarm or not.

 ![](https://global.discourse-cdn.com/smartthings/original/3X/e/4/e4ec773e226c79062358dcfeb68c51399c7478a4.png)

Note: as @Belgarion mentioned, you’re not actually programming the motion sensor itself, you’re setting up a rule which tells SmartThings what to do when the motion sensor triggers. In this case, you would be telling it to ignore the motion sensor for the purposes of the security notification except during a specific time period.

---

<div class="post-metadata">

**Author:** ![vtminhvt](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/vtminhvt/32/187030_2.png) [@vtminhvt](https://community.smartthings.com/u/vtminhvt)\
**Post date:** [June 20, 2016, 9:06am UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/4 "2016-06-20T09:06:56Z")

</div>

I have semilar problem.

> [@Have problem: The Alarm devices is strope when motionSensor active in period time](https://community.smartthings.com/t/have-problem-the-alarm-devices-is-strope-when-motionsensor-active-in-period-time/50871):
>
> #You read code, help me! Definition( name: “Alarm when motion active in Period time”, namespace: “KichBan”, author: “Võ Thanh Minh”, description: “cenario-based device driver habits, preferences and orders”, category: “Safety & Security”, iconUrl: “[https://s3.amazonaws.com/vtmsmartthings/vtms60.png](https://s3.amazonaws.com/vtmsmartthings/vtms60.png)”, iconX2Url: “[https://s3.amazonaws.com/vtmsmartthings/vtms120.png](https://s3.amazonaws.com/vtmsmartthings/vtms120.png)”, iconX3Url: “[https://s3.amazonaws.com/vtmsmartthings/vtms120.png](https://s3.amazonaws.com/vtmsmartthings/vtms120.png)”) preferences { section("Enable or Disable this action ") { input name:“sel”,type:“enum”, title:“Select [on/off]”, options: [“on”,“off”], defaulValue:“off” } section(“Select period time this action”) { input name: “timeB”, type: “time”, title: "Set time start" input name: “timeE”, type: “time”, title: “Set time end” } section(“Alarm”) { input(“…

---

<div class="post-metadata">

**Author:** ![mpking](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/mpking/32/145501_2.png) [@mpking](https://community.smartthings.com/u/mpking)\
**Post date:** [July 17, 2017, 11:38pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/5 "2017-07-17T23:38:19Z")

</div>

I’m just checking in. @JDRoberts, does SmartHome Monitor have to be “armed” for the custom rule to fire?

I’m looking to set a motion sensor to send a notification when my daughter gets out of bed, but I’m not looking for the siren to go off… 🙂

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [July 17, 2017, 11:44pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/6 "2017-07-17T23:44:31Z")

</div>

> [@mpking](#):
>
> I’m just checking in. @JDRoberts, does SmartHome Monitor have to be “armed” for the custom rule to fire?
> 
> I’m looking to set a motion sensor to send a notification when my daughter gets out of bed, but I’m not looking for the siren to go off… 🙂

No, custom Alerts can be set to go off regardless of armed state. So you’re ok there. 🕶

---

<div class="post-metadata">

**Author:** ![Humancell](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/humancell/32/21563_2.png) [@Humancell](https://community.smartthings.com/u/Humancell)\
**Post date:** [February 19, 2018, 4:24pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/7 "2018-02-19T16:24:59Z")

</div>

I’m confused about where you found that screen shot that you posted? I"m also trying to do the same thing.

I have some outdoor floodlights, and they are working fine on a timer right now. I’m about to add a motion sensor, and I only want the motion sensor to turn the floodlights on between 10pm and 6am (middle of the night) … but have not been able to locate where I can add this time constraint to the motion sensor …

The screen you posted seems to provide this … but I can’t find where that is?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [February 19, 2018, 4:29pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/8 "2018-02-19T16:29:09Z")

</div>

> [@JDRoberts](#):
>
> Yes, but if you’re doing it with smart home monitor, you have to do it with a “custom rule” not under “security.”

I can no longer use the SmartThings mobile app because they broke VoiceOver functionality about six months ago, but at the time that I posted the screenshot it was as described. Choose smart home monitor, edit the rules ( usually by tapping a small gear icon somewhere on the screen), then create a custom rule and the time restrictions will be under “more options” or something like that.

[https://support.smartthings.com/hc/en-us/articles/205380154-Smart-Home-Monitor#Configure\_Custom](https://support.smartthings.com/hc/en-us/articles/205380154-Smart-Home-Monitor#Configure_Custom)

I have no idea what it looks like now, hopefully someone else can help.

---

<div class="post-metadata">

**Author:** ![WB70](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/wb70/32/95668_2.png) [@WB70](https://community.smartthings.com/u/WB70)\
**Post date:** [February 19, 2018, 5:01pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/9 "2018-02-19T17:01:22Z")

</div>

> [@Humancell](#):
>
> I have some outdoor floodlights, and they are working fine on a timer right now. I’m about to add a motion sensor, and I only want the motion sensor to turn the floodlights on between 10pm and 6am (middle of the night) … but have not been able to locate where I can add this time constraint to the motion sensor …
> 
> The screen you posted seems to provide this … but I can’t find where that is?

If you are doing this within SHM, then you need to configure a new Custom / Monitoring rule under SHM:

 ![Screenshot_20180219-085601](https://global.discourse-cdn.com/smartthings/original/3X/2/9/295436d596befd2fbaa618f9e90ef25532778a21.png)

 ![Screenshot_20180219-085609](https://global.discourse-cdn.com/smartthings/original/3X/5/7/57fd34c5266beca50b8c672087466695001bd0ee.png)

 ![Screenshot_20180219-085615](https://global.discourse-cdn.com/smartthings/original/3X/b/4/b43a6dd6d4d01d5306fe6dc08e78a8541637b0b3.png)

 ![Screenshot_20180219-085726](https://global.discourse-cdn.com/smartthings/original/3X/9/e/9ec804124fb725fb8132707d03210b59d711e202.png)

 ![Screenshot_20180219-085741](https://global.discourse-cdn.com/smartthings/original/3X/b/c/bc33e05517a24f476ec1dba13a812f2f71342248.png)

Then press + More options (this is your time constraints)

 ![Screenshot_20180219-085748](https://global.discourse-cdn.com/smartthings/original/3X/6/d/6dfa7f2976b228e1612ef27d2c3e44398c278b6f.png)

 ![Screenshot_20180219-090236](https://global.discourse-cdn.com/smartthings/original/3X/4/b/4b704835325810f6ae37e9a5574df3c4578b6376.png)

 ![Screenshot_20180219-085314](https://global.discourse-cdn.com/smartthings/original/3X/2/d/2dcbf0c6ad65a36d492ada3bf8efdbebe243ec49.png)

 ![Screenshot_20180219-085323](https://global.discourse-cdn.com/smartthings/original/3X/7/e/7e04906b51003daf0fe3e70ac59db392fa713de5.png)

---

<div class="post-metadata">

**Author:** ![Humancell](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/humancell/32/21563_2.png) [@Humancell](https://community.smartthings.com/u/Humancell)\
**Post date:** [March 19, 2018, 11:40pm UTC](https://community.smartthings.com/t/newbee-question-restricting-motion-sensor-alerts-to-a-specific-time-period/40696/10 "2018-03-19T23:40:45Z")

</div>

Well … I ended up going about it a slightly different way. 🙂

I wanted to learn about writing a SmartApp … and so I did. You can check it out here …

> <https://github.com/Wovyn/SmartThings/blob/master/SmartApps/motion_notifications_with_time_range.groovy>

If you install and test it … let me know if you find any problems!
