Simulated Motion Sensors and light timing

HI all, I am new to smart things but finding it very interesting. I am trying to find a way to turn a set of lights off after a set amount of time (5 min). I have a routine that runs when I arrive to turn lights on (for when I arrive late at night). I would like to find a way to get those lights to turn off automatically. I have set up a second routine to run with a simulated motion sensor. After 5 minutes of inactivity it is supposed to turn off the lights but it is not working. Can I use these simulated sensors in this way? Any help would be great.

There’s a how to article in the community created wiki on setting up a virtual timer that should do just what you want: :sunglasses:

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

1 Like

This solution works with two Routines requires either motion sensors or contact switches to work. It does not require any virtual switches.

How it works:
The first Routine will trigger the light to turn on. The second Routine will trigger the light, after a set length of time. to turn off. Don’t forget to add the extra time it takes for the sensor to time out. In my example, I’m using a Smartthings Multi Motion Sensor with a timeout of about 15 seconds. In my example, the light will time out in 1 minute (plus 15 seconds for the motion sensor time-out).

Requires:
1 motion sensor or contact switch
X number of lights or switches

  1. From within the Smartthings app, ‘Add a Routine’
    -name it ‘Arrival’
    -Select the lights you wish to turn on under: ‘Turn on these lights or switches’. Optionally set the dimmer levels.
    -Under ‘Additional settings’, select what the trigger is. In this example I use ‘Things start happening’ and select my motion sensor.
    -While selecting the sensor, set the time you wish this to happen between under ‘During this time window’.

  2. From within the Smartthings app, ‘Add a Routine’
    -name it ‘PostArrival’
    -Select the lights you wish to turn off under: ‘Turn off these lights or switches’
    -Under ‘Additional settings’, select what the trigger is. In this example I use ‘Things quiet down’ and select my motion sensor.
    -In this example, I set the ‘For this amount of time’ to 1 minute. You set your timeout length of the light here.
    -Set the ‘During this time window’ again between the hours you wish this to happen.

Give this a try.

P.S. I should also mention it is very helpful to debug your Routines when you turn on ‘Push notification’. You can turn this on/off at the bottom of the ‘Addition settings’ pages.

The OP is using a simulated sensor, not a physical one.

Since a simulated sensor doesn’t actually have any way to measure activity and consequently no way to measure inactivity ( since inactivity is a period of not detecting activity), I don’t think it can work for this use case. It’s just never going to trigger.

You can force a simulated sensor to trigger, which, for example, is how zone manager works, but you can’t use one on its own in a routine.

If the OP wants to add a real device, then they can use the inactivity trigger. But otherwise the how to article in the community – created wiki should work fine because it substitutes a virtual switch for a virtual sensor, and the virtual switch can be controlled By the power allowance feature.

You could also do this with CoRE. Here’s an example of what I have setup for my light.

IF
◩ Time is between 7:00 PM CST and midnight
● Master Bedroom Light switch changes to on
THEN

Using Master Bedroom Light

â–ș Turn off after 30000ms

So anytime this light gets turned on (physically or otherwise), a timer starts (30 seconds in this case), and then automatically turns the light back off.

The Routines I gave were for the audience of our newest community member. If correct, I believe they may not be ready to jump into programing. I could be mistaken and drawing my own conclusions.

I did also find this other thread that may add to this discussion. > Triggering routines from other routines

That works well as long as you want the light to always turn off after the same set period.

The advantage of the virtual timer method detailed in the how to article is that you can set the conditions on the virtual timer, not on the physical lights. That way you can use other rules to control the lights if they are triggered for other reasons.

This is particularly popular for “I’m back” type use cases where you want to have a porch light come on for five minutes and then turn off again automatically when you arrive – – but if, say, your dog gets out late at night and you want to go out into the yard to get him, you don’t have to worry about the porch lights turning themselves off after five minutes just because it’s after 11 PM or whatever.

So different things work for different situations. :sunglasses:

1 Like

Hi @J_B_1.
Just a note and you are probably aware but here goes anyway, I find it easier to do a
Wait 30 seconds
Turn off.

I just find it easier to tweak and you can use seconds, minutes or hours.
As I said just a note in case you were unaware.

1 Like

Hi all thank you so much for your input and very helpful suggestions. @alanrosesf thank you fo.r your suggestions. I am trying to get this to work without using physical switches but if I do add those sensors I will follow your directions.

I think I am going to read through the wiki article first to see if I can get that to work. I am comfortable adding virtual devices I just have not yet graduated to the CoRe interface yet.

Again, thank you so much for all your thoughtful remarks


1 Like

yep, usually more than one way to solve the problem. Thanks.

2 Likes