Announcement

Collapse
No announcement yet.

Timer less than another timer?

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

    Timer less than another timer?

    Does anyone know how I can compare two timers in an Event?

    Example: consider the following:
    Firstly, set up two timers and trigger as follows:

    1) When motion detected in Hall start "timer hall"
    2) When motion detected in Study start "timer study"

    Then
    If the
    Study door closes
    AND
    motion in study
    AND
    "timer hall" is greater than "timer study"
    AND
    Difference between "timer hall" and "timer study" is less than 5 seconds
    THEN
    Set a virtual device "entered study" to True

    ??

    It is the last few lines I need help on..

    Thanks in advance
    /Marcus



    #2
    Easy Trigger plugin might do what you need.

    Comment


      #3
      Thats a good shout and I can certainly do the first bit with EasyTrigger (one time greater than another). But I can't see a way to determine a "difference" between them being 5 seconds.


      Any ideas?

      Comment


        #4
        Another possibility you could try is node-red, it is more function based and would definitely do what you want. It is outside of Homeseer but node-red has some interface nodes for Homeseer that would do the trick.

        Comment


          #5
          Originally posted by metkhoo View Post
          Thats a good shout and I can certainly do the first bit with EasyTrigger (one time greater than another). But I can't see a way to determine a "difference" between them being 5 seconds.


          Any ideas?
          You could do this with a script.

          If the
          Study door closes
          AND
          motion in study
          THEN​
          Call a script

          The script could do the timer comparisons and set the virtual device. HS timers are a VB.NET TimeSpan class.

          Comment


            #6
            Originally posted by metkhoo View Post
            Thats a good shout and I can certainly do the first bit with EasyTrigger (one time greater than another). But I can't see a way to determine a "difference" between them being 5 seconds.


            Any ideas?
            ET comparison of 2 devices condition should work, I believe.
            -Wade

            Comment


              #7
              So, just thought I'd give you an update as to how it was solved:

              1) I enable "Create devices for timers"
              2) I create a timer for "motion" for every motion sensor and have a rule that resets the corresponding motion sensor timer
              3) BTW: I also create a scond "no motion" timer that is reset when the motion timer gets to four seconds so I get a consistent "no motion" timer that I can work with in other events
              4) I can use Easy Trigger to determine whether one timer is greater than another
              3) I can then simply determine if my entry motion timer (timer hall) is below a number - this gives me the ability to check a "recent" motion outside the room I am concerned with.

              This works for me. Thanks for all you suggestions!
              /Marcus

              Comment

              Working...
              X