Away Mode Lights Routine

I am trying to create a rule that simulates actions I might take at home. In this short example the person 'home' would be walking through the house to the kitchen, maybe having a midnight snack for 20 minutes, and returning back up with the lights turning off behind them.

Some things I'm struggling with (I know I have a lot of this wrong).

I want this to run only when it is after dark, and the mode is away (no one home).
I want the rule and all actions to immediately cancel if the time runs out (closer to sunrise) OR someone comes home.
I want sets of actions to start randomly within a certain time frame (ie the routine in this example starts at a random time within 1 hour of the rule activating)
I want the timing of the steps within the broad action (going to the kitchen etc.) to be randomized within their window, but not overlap each other.
To summarize the above - the 'leave the bedroom and go to the kitchen' routine will begin randomly, then each action within the routine will have slightly random timing, but they will not overlap or occur out of order.
I plan to have several nested routines throughout the evening/night/early morning.
I would also like to have a virtual trigger switch to cancel this rule should my presence detection not work (wife will murder me if I can't quickly kill this should it run while we are sleeping).
If the rule re-triggers (we leave, comeback, and leave again) it should still run reliably.

This is turning out to be more complicated than I had anticipated. I know there are vacation apps that will randomize lights, etc. but I want to create something more unique to my home. Looking for some guidance on how to simplify and execute this.

Not sure you'd want it to cancel "near sunrise" but only after it gets light enough that a person walking through the house would naturally not use the lights. And I think you'd want it to complete, in case it cancelled with a light still on, which would look suspicious. Definitely emulate bathroom visits too

Both very good points. I have several motion sensors with luminance that I could use for this.

I just don't know how to actual construct that.

Hmm well maybe split into two rules, one that handles a typical getting the house ready for bed routine, and the other that handles some typical in-the-night wandering. So if you usually go to bed between 11pm and midnight, try to randomise the going to bed emulation (lights being turned off etc) between those times. Then switch mode to Away and Fake In Bed or something, and have that as well as before sunrise as the required expression for the nocturnal wandering simulation rule. If the rule begins just let it complete. I guess sunrise in practical terms is a watershed for not needing lights on. At a typical getting up time switch mode back to just Away. I don't think you need the luminance sensing. Oh and of course you also have to handle the settings for "normal evening simulation", which is between sunset and bedtime, and I think I'd have that as a seperate rule too. So it's like "Do evening" "Do bedtime" and "Do nocturnal bathroom break" - the latter possibly a loop...

I have come up with this which I think is pretty slick. It every hour it will randomly run one of five different routines. The routines themselves aren't very complex yet, I'm just making sure the logic works..I think this should be good enough for now...provided it works the way I think it should.

I am still undecided on using luminance as a while condition. It probably makes sense to do so.

Here is a piston I have that mimics somebody going to the downstairs loo when we are away and the downstairs lounge light is on. (The lounge light turns on and off to a schedule if lux is below a certain level).
Should be easy to replicate in RM.


I also have other pistons to replicate other areas.

What in tarnation is a piston?

webCoRE piston = RM rule.

If you have something happening every hour won't it look a bit fake?

You could say that, yep. I may modify my durations and frequency however it is currently based on the fact that I want people to see lights on when they drive by and therefore at least one light should be on most of the time, and also that I don't expect people to be monitoring our house long enough to determine it is fake.

Well, it's fortunate I am honest, and that I don't have tenants or guests who are not, and that none of the houses near me have either. Because there is a house opposite where you can easily tell when they are away. Cos there is always one or another light on at night, while there almost never is while they are at home. We can always say "Oh I see old **** is away again" lol. You might not have a random person standing in the street monitoring, but there are plenty of people who can see from the comfort of their own homes or the drug dealers' cars parked around the nearby streets.

That's a good point. I think I will reduce the overall frequency of the loop, and modify each routine suitably.

We do live in a very safe neighborhood and know all our neighbors. We are on a small side street with virtually zero outside traffic. There are a couple of renter's on the block however, and the neighbors dirt bag brother lives in his basement, and those things are worth special consideration.

Just try to make it look as much like your typical use as possible. If you would like to have a light on when away for most of the night for, as you say, the passer-by, then begin leaving a corridor or hallway light on at nights while you are at home, so that the actual neighbors who can learn your habits won't think a night time light is a sign of your absence

@justin.rodko Why not just use Vacation Lighting Director from HPM?