Announcement

Collapse
No announcement yet.

randomization of an event?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    randomization of an event?

    Is there a way to make Homeseer randomly execute an event?

    I am familiar with the security option but would like to go a bit more random.

    Thank you,
    Jim

    #2
    Randomly run differant events, or random options in same event. In either case I would have to say yes.

    Comment


      #3
      Should I mention the ROC Randomizer plug-in?

      You can check it out at this link or download a trial from the updater.

      Comment


        #4
        Thanks for the replies.

        All I actually need to do is randomly turn on a couple of lights.

        The ROC Randomizer appears to be overkill for what I need and the trial code from the updater refuses to work -- will have to figure that one out after work.

        Thanks again,
        Jim

        Comment


          #5
          Here's what I use for a random phrase generator for when asking time. Code from skibum

          <pre class="ip-ubbcode-code-pre"> sub Main()

          dim phrase(9), name, choice, choices, say

          name = ", Bill."

          choices = Ubound(phrase) - 1

          phrase(1) = "Time to let me go back to sleep. $time"
          phrase(2) = "Did you loose track of time and space? $time"
          phrase(3) = "It is now $time"
          phrase(4) = "$time "
          phrase(5) = "Time to leave me alone "
          phrase(6) = "Time to go boating, $time"
          phrase(7) = "The time is $time "
          phrase(8) = "5 minutes after the last time you asked, $time"

          Randomize

          choice = Int((choices * Rnd)) + 1

          say = phrase(choice)

          IF Int((5 * Rnd) + 1) = 1 THEN
          say = say + name
          END IF

          system.speak say

          End Sub

          </pre>

          Comment


            #6
            OK. I modified the above script a little.<pre class="ip-ubbcode-code-pre">sub Main()

            dim light(9), choice, choices, device



            choices = Ubound(light) - 1

            light(1) = "B1"
            light(2) = "B2"
            light(3) = "C1"
            light(4) = "B6"
            light(5) = "L2"
            light(6) = "B4"
            light(7) = "B7"


            Randomize

            choice = Int((choices * Rnd)) + 1

            device = light(choice)

            if hs.IsOn (device) then
            hs.execx10 device, "off"
            else
            hs.execx10 device, "on"
            end if
            End Sub </pre>

            Now create an event. Type Recurring whatever minutes you wish. Have the event run the above script.

            You will of course need to change the device codes to be for the light you want to control. I wrote this VERY QUICKLY. It will randomly turn on specified lights, and if they are already on will turn them off.

            I will play with this script later on to give it greater conditional control. It's turning out to be a nice day and wife is bugging me to go down to marina.

            But this should give you someplace to start. Have fun.

            Comment


              #7
              Sorry. I just realized this thread was under new users. If you need any help setting up this event, don't be afraid to ask. Everyone is exceptionally helpful and friendly here!

              Comment

              Working...
              X