This object is in archive! 

Random sunrise/sunset starting Time

Guest shared this question 8 years ago
Need Answer

Is it possible to create a rule that turn lights off at a random time around sunrise. Let's say +- 15 minutes?

Replies (3)

photo
1

I'm also curious what the experts will say.

photo
1

You might be able to use the number of seconds when the rule is run as a pseudo-random value. Use the Part... of variable block to extract the number of seconds from the current time (Now). Use the operator blocks to do a calculation to derive the number of minutes out of 15, but expressed in seconds. And then insert that into a "Wait" block (which takes seconds). After the Wait block, add the action to operate the lights. Might work!

photo
1

I haven't tried this myself, but maybe you could set up the scheduler with -15 as astro offset and use the random puzzle to generate a value between 0 and 30*60 and use that value in a wait puzzle?

photo
1

that sounds like it. well done marius.

photo
1

Never noticed the random puzzle piece. Nice.

photo
Leave a Comment
 
Attach a file