Announcement

Collapse
No announcement yet.

How are event conditions/triggers evaluated?

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

    How are event conditions/triggers evaluated?

    I have a question about event conditions/triggers. It probably seems really simple, but I just want to make sure so that I am not creating a lot of unnecessary extra work for myself.

    If I have an event and I want it to fire based on the status of 2 devices, do I need to do an or? For instance, Do I need to do:

    Code:
    If Light changes and becomes ON
    And if Motion Sensor has a value of no motion
    Or do I need to do 2 sets with an "or" between them?

    Code:
    If Light Changes and becomes ON
    And If Motion Sensor has a value of no motion
    
    OR If Motion sensor changes and becomes no motion
    And If Light has a value of ON
    My first assumption, based on the verbiage of the conditions is that I need to do that latter, but you never know, so I am asking.

    #2
    The first is a trigger -after AND is condition

    If Light Changes and becomes ON
    And If Motion Sensor has a value of no motion

    The above won't fire if your light is on when Motion Sensor changes to no motion. Your below event solves that and makes your assumption correct.

    OR If Motion sensor changes and becomes no motion
    And If Light has a value of ON

    Comment


      #3
      Originally posted by sirmeili View Post
      I have a question about event conditions/triggers. It probably seems really simple, but I just want to make sure so that I am not creating a lot of unnecessary extra work for myself.

      If I have an event and I want it to fire based on the status of 2 devices, do I need to do an or? For instance, Do I need to do:

      Code:
      If Light changes and becomes ON
      And if Motion Sensor has a value of no motion
      Or do I need to do 2 sets with an "or" between them?

      Code:
      If Light Changes and becomes ON
      And If Motion Sensor has a value of no motion
      
      OR If Motion sensor changes and becomes no motion
      And If Light has a value of ON
      My first assumption, based on the verbiage of the conditions is that I need to do that latter, but you never know, so I am asking.
      It depends on what the goals of your event are. The trigger is almost always based upon the instant a device changes value and a condition is based on the value of a device at the time of the trigger. Your first example would be true if there was no motion at the time the light was turned on. The second set would be true either if there was no motion at the moment the light is turned on or if the light is on at the same moment as your motion detector changes to no motion.

      For a thorough explanation of how to use IF/OR IF/AND IF look at this post and others in the Event Clinic forum. More information is continually added to the forum as shown in the Table of Contents post.
      HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

      Comment


        #4
        Thanks for the information @519zwave!

        At first I thought it was a bunch of "extra work", but now that I think of it, it is better that way. When I was on Vera and using a Plugin called PLEG (Program Logic Event Generator), it had a concept of "Sequences". That is that things happen in a certain order. This style of building triggers/conditions helps me duplicate a lot of my logic easily since i had a lot of things that depended on those sequences.

        Comment


          #5
          Originally posted by rprade View Post
          For a thorough explanation of how to use IF/OR IF/AND IF look at this post and others in the Event Clinic forum. More information is continually added to the forum as shown in the Table of Contents post.
          Sorry about that, I looked for an "events" forum but it appears I missed it! A mod is welcome to move this thread there and I will most certainly read up on it. I tried the help in HS itself, but it was severely lacking in actual information.

          Comment

          Working...
          X