wait for event and timeout

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • pbj
    Automated Home Sr Member
    • Jul 2004
    • 57

    wait for event and timeout

    Hi guys,

    I've got a macro which turns the outside lights on when a car comes down the drive. The macro starts when one inductive loop is trigged and then waits for a second loop to trigger before turning on the rest of the lights. It works well, however... Occasionally a car will trigger the first loop, but then not carry on down the drive meaning the macro waits forever for the second loop to be triggered. I'm trying to find an elegant way of achieving "wait for 2 minutes then reset the macro". I've currently got another macro which is triggered at the same time which waits for a couple of minutes and then enables and disables the macro if it is still running - this has downsides as there are a few scenarios when the original macro might still be running for a valid reason.

    Any better ideas?

    Peter.
  • chris_j_hunter
    Automated Home Legend
    • Dec 2007
    • 1713

    #2
    how about picking-up on the fact (?) that the second trigger could, in such cases, be of the first loop, rather than the second ?
    Our self-build - going further with HA...

    Comment

    • Viv
      Automated Home Ninja
      • Dec 2004
      • 284

      #3
      Peter,

      Cortex version 26.4.1 will introduce an optional time-out for the "Wait for event" item in a Macro. If it times out it then proceeds to the next item as if the condition was satisfied. However a new output connection is offered by the Macro which is 'Wait for event timeout'. This may be tested by the Macro using the IF, ELSE, ENDIF statements so it can decide what happens on Time-out or condition satisfied.

      Viv

      Comment

      • pbj
        Automated Home Sr Member
        • Jul 2004
        • 57

        #4
        Thanks Viv, that'll be much better than my lash up!

        Comment

        Working...
        X