Lights on and off randomly based on times

I’m looking for a smart app that will randomly turn on or off based on times programs.

Currently I have switch for my front porch light I bought from Home Depot. I have it programmed to come on at 7:30, and go off at 9:30. It randomly comes on and goes off 30 minutes before or after the programmed times. It never comes on or goes off at the exact time every night. I think this is a great security feature. I travel quite often, and this switch gives my house at more “someone is home” look to anyone who might be watching the house.

I’d also like to do this with a couple of inside lights. I did manage to piece together a couple of smart apps to build one that has certain lights or switches come on at certain times when I am “away”, and stay on for a set period of time. Unfortunately this is not random, it’s the exact time every night (only when I’m away), and stays on for a set amount of time I have programmed.

I’m not even sure this “random” feature would be possible, but would appreciate any feedback

Look in the Marketplace for an app called Vacation Lighting Director, under Lights & Switches section. I didn’t try it personally, but it sounds like it does exactly what you need.

Close, but that’s more like the app I have now. You have to specify the amount of time the lights are on. The key thing I am going for is “random”, if that’s even possible.

Thanks though, I didn’t know that app was out there

I believe that it randomly changes between lights but at a set interval. I bet it wouldn’t be too hard to vary the interval a bit too.

Have you found anything? I’m looking for the very same type of routine.

I have this set up for an upstairs Hall Light when I’m away.

IF
Here I have set up conditions that must be true.
In my case lux level, mode is away and between sunset and Sunrise.

THEN
Using upstairs Hall Light.
Turn on.
Wait 2 minutes.
Turn off.
Wait (random). In my case I have it set for 41 to 71 minutes.
Follow up with piston. Here i use this piston.

In this way the lights will turn on between sunset and Sunrise for 2 minutes every 41 to 71 minutes.

Works well for me.

This is somewhat closer to what I want, I just haven’t figured out the random thing yet. I’d love to see your code for this

I have used a ‘basic’ piston in CoRE.
Then set the conditions that the lights will turn on for in the IF.
Then set the light action and the THEN.

After stumbling around and figuring out how to use CoRE, here’s what I came up with for a simpler case. Perhaps someone can tell me what if it’s really doing what I think it is. (My main question is the randomness.) Objective is to turn on the porch light at a random time within 15 minutes of sunset, and then turn it off at 11pm.

IF
Time is around sunset +/- 15 minutes
THEN
Using Front Porch
Turn on
Wait for custom time 11:00 PM
Turn off

And then, I want to do a more complex one - turn on living room lights around sunset, but no later than 8:00 pm, and turn them off around 10:30 pm. Here’s what I’m trying:

IF
Time is around sunset +/- 15 minutes
OR
Time is around 8:00 PM +/- 15 minutes
THEN
Using Living Room Outlets
Turn on
Wait for custom time 10:20 PM
Wait (random) 1-20 minutes
Turn off

Do these appear correct?

I’ve been browsing all through the SmartThings community forum, and done numerous Google searches – is there ANY place that provides a tutorial, or samples of setting up conditions (basic, simple, AND-IF, LATCHED, etc.), use of system values and built-in functions, passing information between pistons, etc.?

To get a random effect I use a smartthings virtual switch.

After sunset I turn on the porch light if the switch is turned on.

I cycle the switch on 7 minutes and off 14 min so this limits the time to 21 minutes after sunset before the switch turns on.

Off after 7 on. On after 14 off

I have arlo cams whose motion sensors have a lot of nuisance triggers.

I use a nuisance trigger to reset the cycle once a day so this is random.

Today it is raining so the doorbell cam was in night vision before the light turned on.

With a bit of creativity and a virtual switch you can set up a random event to turn on in smartthings.

Last 5 days 844 pm to 902 pm

Also have a glass of milk cycle that turns on kitchen light for 10 minutes randomly during the night.