Announcement

Collapse
No announcement yet.

Executing Event only once

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

    Executing Event only once

    My Event in Run is looping!

    I have a main Event that Runs a sub Event. The sub Event has one condition (that a Flag be ON) I want that event to execute once. It is looping and repeating. How do I limit to one execution?

    Thanks.

    #2
    I assume your talking about a script so post the script and we'll have a look.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Rupp, it could be events.

      GG, what are the conditions of the events? You said the sub event only has one condition -- that a flag is on. Does either event turn the flag OFF? If not, it would execute continuously if the flag is on.

      If your events are executing continuously due to a logic error, fixing the error would of course be the best solution. But there is a check box that limits event execution to one time every x seconds if that would help you.

      Comment


        #4
        No, I'm not talking about a script. I am talking about an "Event" that I am calling to execute in the Run tab of my main Event. My sub Event is a straight Turn light ON with one condition, that a Flag be ON. It executes endlessly when called.

        My question is simple how do I get it to execute once and once only.

        Thanks.

        Comment


          #5
          THis may bee TOO simple, as I do not know all the logic involved:

          But when the event executes, how about setting the flag to off. Now that it is off it will not execute again. Then whenever it is that turned the flag "on" simply looks for this event. And when it is flagged "on" again, it will then execute.
          Visit My Home Seer Site at:
          www.JohnWPB.com
          Created with LCARS

          Comment


            #6
            GG, does your subordinate event even need a condition? Could you just make it a "manual only" event so that it only executes when it's called by the primary event?

            In fact, do you realize the subordinate event can execute on it's own if it has conditions that trigger it?

            Comment


              #7
              John, DC;

              Here's what I am doing: I have a group of lights turning on every night. However, under certain conditions, I may want an additional light to go on. I have a Flag that represents this condition. My main Event activates my normal group, and also executes my sub-event for the additional light. My sub-event contains a condition: it checks the status of the Flag. If flag ON, turn light ON; if flag OFF, do nothing. The problem is that if flag is ON sub-event never ceases. I would like to see an option checkbox for "Execute only once".

              I could of course have the sub-event turn off the flag but I am not too excited about that as I need this flag for other conditions.

              Any ideas?

              Comment


                #8
                GG,
                Why not move all your event processing to a script and this would solve the problem.
                Something like:
                <pre class="ip-ubbcode-code-pre">
                sub main()
                hs.ExecX10 "B16", "on", 0, 0
                hs.ExecX10 "B18", "on", 0, 0
                hs.ExecX10 "B10", "on", 0, 0
                hs.ExecX10 "B16", "on", 0, 0
                if hs.DeviceString "A16" = "on" then
                hs.ExecX10 "B13", "on", 0, 0
                end if
                end sub
                </pre>
                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                Comment


                  #9
                  GG,

                  Add a second condition to your sub-event -- "IF LIGHT IS OFF" (LIGHT being the additional light you are turning on). That way the first time the event executes, both conditions will be true (FLAG IS ON and LIGHT IS OFF). The event will turn the light on and then the conditions will not be true (because LIGHT IS ON).

                  The other option is to have the event turn the flag off so that makes the condition not true. But, you didn't specify how you turn the flag on and off so I don't know if that will work for you. But the first method will work.

                  What I don't understand is how your sub-event doesn't execute on its own. If it is a conditional event (ie, not a manual event), it will execute whenever those conditions are all true whether it gets called by another event or not.

                  Comment

                  Working...
                  X