Looking for input on adding more control to an existing routine for random light control when away

Hi all,

Somewhat involved question (that probably has a straightforward answer) as I’m getting lost trying to update an existing rule. I am on 2.3.6.146 (I’ve followed the basic tenet “if it’s working, no need to take risks with upgrades, and I have had upgrades make some things not work).

Basics: I have a couple of rules for random on/off for lights when we’re away. Right now, they look something like this, and they work:

I have a couple more plug devices and want to add a few more. I also want to add a little more control by having the onTimes for the various lights be season-dependent (maybe based on DST). I can make a Hub variable for Season and set to Winter/Summer in a rule (question about this below). No issues there. However, if I think about trying to set the onTime and offTime in the rule based on this, it seems that I have lost my Trigger. I can trigger on Season (Winter/Summer) and use that to set onTime and offTime. But it seems I can’t also trigger on Time of Day = a variable. So, I don’t think that this will work to actually Trigger at these variable times.

Since I will want different OnTime/offTime for the different lights, I can’t just set onTime and offTime by season. I could have them all in one app and simply have an IF statement that triggers on the earliest onTime and then add delays…if the delays were non-blocking, which I’m sure they’re not. Since they likely block, it would stay in the IF clause until all lights turned on, which would prevent any lights turning off before the last light turned on.

I could also set the earliest onTime by season, have all of the apps trigger on this and then just put individual delays in each app for that light, and they would be independent.

I’m looking for thoughts on how best and most elegantly to make this happen. Maybe it’s easier than this and I’m just overthinking/missing something obvious 

Second question: For setting the Season (or base time) based on DST changes, is it sufficient to just sent once with logic for second Sunday in March and first Sunday in November, rather than setting for each day in the range? Any chance that setting once risks losing the value at some point (we have solar and battery backup, so power outage to the unit is unlikely).

Finally, if I have 4 or 5 apps for this, is there any way to slave all of these to a master rule (sort of like subroutines) to turn then all to Pause/Resume as a group, rather than individually?

Thanks for thoughts on this.

Cheers.

Well you wouldn't trigger on a season unless you only wanted the rule to fire when the season actually changed. You could just do an IF statement for a given season or split the rule into two with the required expression for one set being SEASON=X and the other set being SEASON=Y and then set your trigger times as you see fit. Or did I misunderstand what you are going for?

I feel like a guy who just asked a group of folks how to use the sharp end of an axe to drive a nail, without damaging the nail, and one of the folks says "ya know...you do have a hammer..." D'oh.

Worst part is that I have several subset-based rules that I use for holiday lighting with offsets. So this is clearly the way to go by using sunset, adding offsets to each light and then putting a random distribution on top of that.

Using RL sounds interesting as a way to group things, but I really do like adding even a bit more randomness. I was hoping for One Rule to Rule Them All...

One question about using the variable offset in the trigger (rather than a fixed offset there and a random delay in the Action. I want to make sure that the light stays on for a reasonable amount of time, so I have Sunset+120 and 11:00PM. Then I add a Random to that in the Actions.

If I put Random delays in the trigger, it could be possible to have the off timing happen before on. Also, if I do that, how would I set up the statements in the Actions to trigger the On and Off since I wouldn't know the time values for the IF statement.

While we were away on vacation, our camera caught a guy with a flashlight looking in a back room window. Let's just say it's made me paranoid :slight_smile:

Cheers.

Do you have an automation to turn on the lights normally when someone is present? My lights act the same regardless if I'm home or not. It's only the turning off a night that is different and that is on its own separate rule based on presence. If I'm home, it's either Goodnight rule (based on a virtual switch turning on) or 11:15pm whichever comes first will switch the house into Overnight mode. If I'm away, 9:30pm is my trigger. My first action is turning on the virtual switch in the Goodnight rule but having a delay of 1:45 hours that is random. This way, the house will transition sometime between 9:30pm and 11:15pm just like if I'm at home.

1 Like

Really good ideas, thanks.

With regard to "sunset + <"large value">", if I did it as a random, it could still be very short within that interval. But I get the idea that thinking outside the box can help.

As for the flows, I don't expect that someone will be watching the house for a long enough period of time to notice this as there's nowhere for someone to hang out for that long in the area we live. So, individual random would likely serve just as well for this purpose, with front-of-house lighting toward the earlier part of evening, and back-of-house later.

I had thought about sounds as well (dogs are a good idea). We don't have a voice assistant, so that won't help for this, but it is a good idea for those who do.

Thanks forthe ideas.

Cheers.

1 Like

We don't. We don't have the internal lights on automation and just use this for vacation, and we do have some automations for holiday lighting. We do things pretty randomly when we're home, so there's really no natural way to do this. I used to have automation on a number of lights back when we were X10. And we really just never used it, so I removed that back to manual switches and never carried it to ZWave.

Cheers.

Look for my port of vacation lighting director app in package manager for an alternate solution.

1 Like

Thanks. This does look interesting. I'm not sure it does all that I want, but it is definitely worth experimenting with, and a very compact solution.