Jump to content

Random number in Java code


BrianM

Recommended Posts

I have an ISY994i/IR running 4.3.26.
One of the main functions it provides is to give my house a lived in look
when I'm away. I'd like to be able to turn the outside lights on & off a random
number of minutes before & after sunrise & sunset.
I figured out how to create a random number and store it in a variable but I can't
incorporate the variable into the code of the program that controls the
outside lights.
Anyone know how to do this?
Thanks,
Brian

Link to comment

I'm uncertain why you want the variable?  I do a similar thing without...

Front Bedroom Light - [ID 0006][Parent 0001][Run At Startup]

If
        From    Sunset  -  1 hour 
        To      10:00:00PM (same day)
     Or From    Sunrise
        To      Sunrise +  2 hours  (same day)
 
Then
        Repeat 2 times
           Wait  50 minutes 
           Wait  20 minutes  (Random)
           Set 'Light Front Bedroom' On
           Wait  5 minutes  (Random)
           Set 'Light Front Bedroom' Off
           Wait  1 hour and 15 minutes 
           Wait  15 minutes  (Random)
           Set 'Light Front Bedroom' On
           Wait  7 minutes  (Random)
           Set 'Light Front Bedroom' Off
 
Else
        Set 'Light Front Bedroom' Off
 


Jon...

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...