RM Example: Away. Turn Lights On and Off at random intervals

I like to have various lights turn on and off at random intervals when we are away to simulate somebody moving round the house.
This is what I have come up with. Can this be done easier? Probably. This is what I came up with though and it works for me.
I have used 3 separate rules.
Rule 1.
Runs actions in rule 2 after a delay.
image
Rule 2.
Turns the lights ON after a random delay.
image
Rule 3.
Turns the light off after a set delay.
image

As an aside, I also us this to turn on another light so it looks like I have moved from the downstairs hall to the downstairs cloakroom.
Here as those rules.
image
image

2 Likes

I don't understand how you're actually getting the delay timing to be random though. I'm seeing an action called Random, which i'm assume is the action of another RM rule. Can you give more detail?

If you look at my post you will see that there are 3 rules to implement this.

In rule one, when the conditions are true it waits 65 minutes and then runs rule 2.
This then delays turning the light on for a random time between 0 and 45 minutes.
This means that the light will turn on at a random time between 65 and 110 minutes.
The reason I have had to do it this way is you cannot specify a random time between 65 and 110 minutes. This is the only way I could think of for doing this.
Then when the light turns on, it turns back off again after 90 seconds with rule 3.

Hope that makes sense. :wink:

No, that's not what I meant. What I meant was, how are you getting the random part. I didn't realize that in order for the toggle for Random to be available, you have to first enter a value in the number of minutes. It's hidden until you do that. That's what was screwing me up. Thanks!

Ah I see. Sorry. I take it your good now you have found it OK.

Yeah. I have to say, I kept thinking to myself, "what is this guy smoking?!? How is that making it random?" I looked at the page in RM...no random. I was really starting to go nuts over here trying to find it! Of course, now I feel like a total moron. :stuck_out_tongue:

1 Like

Ha, equally as stupid moment. I was trying to figure out why you had two delays with the lights on.

  • One delay in the first rule: Random Delay. On.
  • Second delay in the actions piston: Delay by 45 minutes.

Then I realised it was the name of the piston! Derr.

Since RM 3.0 has been introduced the 5 rules I have been using for randomly turning on lights when away to simulate someone moving around can be condensed into 1.
Here it is.


4 Likes