SmartLights Turn Off after x minutes after presence is detected


#1

Hey All,

I need a little help with getting the smart lights app…I have it set to turn on a bunch of lights (front door light) when presence is detected…but I haven’t found a way to turn them off …say after X amount of minutes…any help would be greatly appreciated


(Colin) #2

you can go about it a couple ways. you can install the smart app ‘turn it off after awhile’ but that would turn that set of switches off after the set time, no matter how they got turned on.

you can also set up Rule Machine that would let you set it up all together, turning on X lights when motion detected, and then turn off X lights after Y minutes, as well. Along with many other possible things you can automate with the app.


#3

Hi Toasty,

Thanks for the feedback…I will check into this further. It just seems that this is a simple thing to do but appears complicated to setup. I am very new to SmartThings and I have a very strong technical background but quite honestly I find the system cumbersome and complicated to setup. I think what makes it a bit more difficult is the fact that there is no web UI that you can set rules for smart apps up from a computer. Any information that anyone can provide is helpful, before I decide to return all of my sensors and hub and try something different (wink or verde) . Thanks!


(Merlin Ross) #4

To be more specific: The “off timer” (minutes) is a bit hidden in a weird location within the SmartLights app.
Just create a new routine within the SmartLights app, select the switch you want to control, and then trigger based on “POWER ALLOWANCE.” (I think it’s the LAST choice, at the bottom of the screen/page?..)

Within POWER ALLOWANCE, you can actually set it to trigger based on “MINUTES” the device has been on/operating.

As mentioned above, this is somewhat of an “always” approach. e.g. ALWAYS turn off the front porch lights after they have been on for 10 minutes. Note: The minimum duration is ONE minute. (I wish they allowed fractions of a minute, so we could use .5 minutes to create a 30-second rule. But, it only supports whole numbers.)

So, if you want to CONDITIONALLY have this rule/routine run, then you need to create a second (virtual) switch via the IDE website interface (aka a “Simulated Switch.”) Then, you point your ALWAYS-OFF script at this “simulated switch” – instead of pointing it at the REAL/PRIMARY switch.

Example: You have four Phillips Hue bulbs in a ceiling fan in your dining room. You name the bulbs: CF1, CF2, CF3, CF4. You then create your PRIMARY simulated-switch named “dining room light” to control all four of these bulbs concurrently. So, when you turn ON the “dining room light” – all four of these bulbs come on together. (Ditto for turning them off as a “team,” too.)

Let’s say you want to create a routine that turns these lights ONE when you come home?

Typically: You would just create a routine that would see your presence-sensor-fob “arrive,” and therefore turn “on” the “dining room lights.” (Sounds straight-forward… but… wait for it…)

But, what if you then want these lights to automatically turn OFF 2 minutes later?

You would THINK that you would just create another routine, that would turn OFF these lights when POWER ALLOWANCE exceeds 2 minutes – right? (Sorry, that’s the wrong answer.)

Because when you sit down to eat dinner, and turn on the “dining room light” – it would then shut-off automatically 2 minutes later.

So, what you do INSTEAD is this:

After creating the primary switch, you then create a SECONDARY simulated-switch, too (and point it at the same four bulbs = CF1, CF2, CF3, CF4.) You now have TWO simulated-switches, that can control this team of lights.

Let’s name this SECONDARY switch “DR-Bulbs” (DR = Dining Room.)

You then create your presence-sensor routine to turn on the “DR-Bulbs” switch (instead of the switched named “dining room lights” switch.)

Similarly, you create your POWER ALLOWANCE “off” routine to point to DR-Bulbs switch, too.

Bingo!

So, if/when you control the lights via the “dining room lights” switch – they will remain on, until they are manually turned off.

Whereas, when you control the same lights via the switch named “DR-Bulbs” – they will always turn off 2 minutes after they are turned on.

I leverage these same “secondary switches” and delays for all kinds of other events. e.g. spoken “welcome home” events with my Samsung speakers. If you trigger based on the presence sensor, then the “welcome home” message plays too early (as you are still approaching your front door.) By adding a 1-minute delay/pause routine, the speaker says “welcome home” once I am indeed inside the house.

I hope this level of detail helps. Again, it’s a little hidden in the POWER ALLOWANCE field. Within it, you will find the option for “minutes.”

Peace.


(Peter Major) #5

I have my hallway lights turn on with motion (only when between sunset and sunrise) and turn off a few minutes later.

I achieved this with the built in Smart Lighting app. This rule actually turns on a z-wave switch

However, the other night I was working in the hallway and light kept going on and off as I moved around. I kept waving my arms around to keep the light on.

I started browsing through the list of smart apps for something better and came across the app Smart Light Timer, X minutes unless already on

This app does the same as described earlier, but if the light is already on when motion is first detected it does not shut off light on a count down timer.

Also if the switch is cycled off and on again while count down timer is running, the turn off is cancelled. So in the case where I’m working in the hallway I can easily override the turn off after x minutes by just double tapping the switch.

Very neat app - thanks to whoever wrote it! I just had to do a small mod to only turn on the light with motion if it’s between sunset and sunrise.


(Khai Vu) #6

I wanted to do the same thing and the wife didn’t want the lights to be on automatically when we are not at home. So I set for the lights to be turned on from 5p -10p base on motion trigger and off after 120minutes of no activity. So far that’s being working well for us with no sudden lights off as 120minutes is plenty for us to create movement for the sensor to pick up.


#7

This is all great ideas, so far I’ve tried to power allowance method, but again to my previous point SmartThings appears to be rather cumbersome to work with. I’d expect a product backed by Samsung and sold in big box stores to be way more user friendly. I feel as if to simply turn something off on a timer, I had to reach out to the community for guidance on something that should be relatively straight forward. I could never expect someone with little technical background to even have a clue how to get this thing going…perhaps I did miss the basics any my expectation were skewed (e.g. take it out of the box connect some sensors and within a few hours everything is up and going, at this rate…this seems to be a constant work in progress and not something that is a set-it and forget it product.


(Kevin Jones) #8

@peter.major, I’m looking to do the same thing but I’m not sure how to modify the smart app to include the Sunrise/Sunset functionality. Can you share your code?


(Mike Maxwell) #9

Just use Rule Machine, It can do all of this and more…


(Peter Major) #10

The one thing that this app does that rule machine doesn’t do is cancel the timer and leave the light alone if you cycle it while the rule is running.

Sure the code is here:


(Kris) #11

Hey, this is great, thanks for this updated smartapp. One question, any chance you can add dimmer capabilities? What about colour options? (I currently have my lights set to turn on 100% white during the evening, but after bedtime I have them turning on, but only 50% and orange.)


(Bob) #12

You need to investigate CoRE.
You can do most things with it.
Definitely what you have mentioned above.
Do a search for CoRE.


(Kris) #13

CoRE? I haven’t heard of that yet. I’ve been using Rule Machine for some of my triggers, but feel like more specific apps are faster.

But I’ll take a look at CoRE… from what I’m reading it has replaced Rule Machine? I didn’t realize Rule Machine wasn’t being developed anymore… I haven’t been on these forums for a bit.

Please confirm, it looks like this is the project you are referring to?

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


(Kris) #14

So… I used CoRE… can’t believe I dind’t know it excited… it’s pretty slick. (Slow, but slick).

Anyways, I got it to turn the lights on, wait 3 minutes and then turn them off. I also got it to not run if the light was already on… so I’m almost there. However, I can’t seem to find a way to make it not turn off if the motion sensor is still active (still sees motion) so if I am doing something in the room, it turns the light on, and off 3 minutes later even if I’m still moving around in the room.

What did I do wrong?

Uploading… Uploading… Uploading…


(Kris) #15

Hello @peter.major. Any chance you’ve been able to update your smart app to include light brightness?