How would you create a randomized timer?

I'm thinking about a timer to turn on a cat toy at random intervals and I am not sure where to start. Is a random value something I can produce in the Rule Manager?

The algorithm would be something like "Between 9 AM and midnight, wait for 45-75 minutes, then activate the outlet for 5-10 minutes, then start waiting again."

Thank you, I'll start there!

2 Likes

If you want a delay between 45 and 75 minutes you could do the following.
REPEAT
delay for 30 minutes (random)
Wait 45 minutes
Turn On light
delay 5 minutes (random)
wait 5 minutes
Turn off
END-REP

Doing the above will give a random delay between 45 and 75 minutes
Outlet turns on
and then turns off at a random interval between 5 and 10 minutes.

2 Likes