Announcement

Collapse
No announcement yet.

Having events trigger other events serially

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

  • Having events trigger other events serially

    So I have events that, when triggered, will do stuff that includes also triggering multiple other events. The problem is that some of these events take time to do their thing (anywhere from 2-60 seconds, in some cases doing script work. However, it appears that when an event fires off another event, it spawns a thread rather than doing it serially.

    So what ends up happing is i have a list of, say, 3 events that need to run, one after another (and are sequenced that way in the triggering event), but they all get fired off immediately and clobber on each other. I need them to run sequentially, not in parallel.

    Any generalistic suggestions on if that can be made to happen? I can provide more details if desired, but basically the general thrust of it is what i've stated here, for various different types of events I need to deal with.....

    Many thanks!

    Paul

  • #2
    You can put a wait delay between them with a one liner script : hs.WaitSecs(0.1) with the option wait before the script end

    Comment


    • #3
      You are correct. Event actions occur in parallel, not in sequence. There are ways to accomplish the sequencing of event actions, but I don't know of a general solution. A few that come to mind:
      • If you know how long each of the events requires, you could specify an appropriate delay time in the event actions of the initializing event.
      • If you are comfortable with scripts, and it sounds like you are, you could control the event timing by running them from a master script rather than as event actions.
      • You could create triggers in each event that will start the follow-on events at the right time.
      Unfortunately, the best way to do it in your case will depend on the details of your situation.
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

      Comment


      • #4
        Another option would be to have the second event trigger on the last change of the initial event or using a virtual device setting as the last item in the initial event. The second event would have one or more OR triggers depending on how many events currently call it.
        Karl S
        HS3Pro on Windows 10
        96 Devices
        54 Z-Wave Nodes
        37 Events
        HSTouch Clients: 3 Android, 1 iOS
        Google Home: 3 Mini units

        Comment

        Working...
        X