Announcement

Collapse
No announcement yet.

Conditions in specific sequence order

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

    Conditions in specific sequence order

    Hi all

    First post from ex Vera user so be gentle with me! I am used to building up quite complex sequence events using PLEG in Vera. This relies on things happening in a very specific order - for example detecting that the house is empty checks motion and virtual device triggers in a very specific sequence with door and driveway motion to assume everyone has left the house. I am not clear on how to fire an event only if things happen in a specific order in HS3? Is it even possible?

    Thanks

    #2
    Welcome to Homeseer. I moved from Vera and at first was puzzled by sequencing events in a proper order. I had relied upon PLEG to do everything. I learned to use counters to identify that certain events have happened. Homeseer is an extremely solid platform that you will learn has many advantages over Vera.

    Good luck

    Comment


      #3
      Originally posted by borat View Post
      I am not clear on how to fire an event only if things happen in a specific order in HS3? Is it even possible?
      Welcome to the HS Board.

      The easy answer to your question is, "Yes", but the way you choose to do it will be partly based on personal preference and partly based the details of the input you want to analyze.

      If you post more details about the specific things you want to detect and why the order in which they occur is significant, that may help people provide more useful input.

      Just as a simple example, if you want some action to occur when A happens, but only if B happens first, you could create an event that is triggered when A becomes off, but with the condition that B has been off for at least n seconds.

      You could also check multiple conditions and set the value of a virtual device to indicate that all of them are in the required state. Then you could use the value of the virtual device as a condition on another event, to confirm that those states had already been checked and meet your criteria.
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #4
        Hi all thanks for the replies. I will explain the scenario I am trying to achieve.
        Basically in my old Vera life, I used motion sequences to determine with pretty good reliability whether the house was occupied. I tried many different methods of doing this - geolocation, pings, etc - but there are always "outliers" with that approach - eg a babysitter being at the house, phones being left at home or off, etc.
        The motion approach, combined with some of these methods seems to give the best reliability and can be used for other purposes. For example I was able to detect when everyone has gone to bed, by the sequence of motion between rooms. I could also detect when the kids got up by movement in a certain order in a certain time period. Sometimes I would combine triggers into an event and then use the event in a sequence - for example - ANY motion upstairs would be an event (upstairsmotion) I could check in sequence with others. I think I can probably achieve most of this with timers, but I cant quite get my head around how, as would still need to look at the sequence of when they expired. My main use case for this is home occupancy. The logic would have been something like this:

        IF UpstairsMotion is FALSE AND (!UpstairsMotion; HallwayMotion; FrontDoorOpen; FrontDoorClosed; DrivewayMotion)
        THEN
        Assume house is empty and do stuff

        I cant quite convert this to any of the approaches recommended above, so any help would be appreciated. What you propose makes sense Mike, but can I do this based on an Event rather than a trigger - eg - Event B is true only if Trigger is true AND Event A was true within last X seconds?

        Thanks

        Comment


          #5
          Originally posted by borat View Post
          The logic would have been something like this:
          IF UpstairsMotion is FALSE AND (!UpstairsMotion; HallwayMotion; FrontDoorOpen; FrontDoorClosed; DrivewayMotion)
          THEN
          Assume house is empty and do stuff
          Translating the scheme that works with Vera to one that will work with HS is going to be a challenge, but you can look at it as a 'learning experience'.
          I cant quite convert this to any of the approaches recommended above, so any help would be appreciated. What you propose makes sense Mike, but can I do this based on an Event rather than a trigger - eg - Event B is true only if Trigger is true AND Event A was true within last X seconds?
          To do this the way you describe will be fairly straightforward with a script, I think, but as you've noted, you can use timers. My preference would be a script where you have explicit access to the time of each device's last change. Timers will get messy for sequences.

          Conceptually, I envision an event that has a trigger of motion detected in the driveway, with the condition that UpstairsMotion is off. (There could be other conditions as well, like DownstairsMotion is off as well.) The event action would be to run a script that would retrieve the last change time for the items you listed. (You'd need a new device to capture door open time, if you really need it. I would think door closed time would be sufficient, though.)

          The script would then compare the device states and times of each of the relevant devices and if they are in the proper order, change your occupancy state to house empty.

          The way I do this is a bit different in concept. I have an event that checks key motion detectors around the house as well as floor occupancy device similar to your UpstairsMotion. If they all have been off for specified time periods, then the house is empty. (To determine if we are not home, rather than just outside, I require that the alarm be set in away mode.)
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548, NUC i3

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

          Comment


            #6
            Thanks Mike. I will try and find a way without scripting. I am still getting used to having simple access (and reliability!) to device states, timers, counters etc so I suspect some of the mechanisms I used in Vera just are not necessary here. I had a lot of logic that was really built just to account for Vera's woeful reliability!

            One other question I have that is linked - is there any pro / con to using the "Device has been for at least" condition, vs setting a timer and using that? This was something you just couldnt do in Vera without setting a timer. I have tested it and seems it does work on its own in terms of actions when a room has been motionless for a while, but I wasnt sure if there were any issues I should be aware of with this approach?

            Is there a way of checking if "Event has been true within the last X minutes", in a similar way to above? I cant see anything obvious.

            Thanks

            Colin

            Comment


              #7
              Originally posted by borat View Post
              Thanks Mike. I will try and find a way without scripting. I am still getting used to having simple access (and reliability!) to device states, timers, counters etc so I suspect some of the mechanisms I used in Vera just are not necessary here.
              I agree. I think you will find a variety of ways that will work. Choosing the one you want will be based mostly on the one you discover first.
              One other question I have that is linked - is there any pro / con to using the "Device has been for at least" condition, vs setting a timer and using that? . . .I have tested it and seems it does work on its own in terms of actions when a room has been motionless for a while, but I wasnt sure if there were any issues I should be aware of with this approach?
              I think the device time is the way to go in most cases. Timers are a bit more flexible, so they have their place, but they are much more cumbersome and require extra effort to manage them. In my experience device time works very well. I use it extensively for exactly this type of situation.
              Is there a way of checking if "Event has been true within the last X minutes", in a similar way to above? I cant see anything obvious.
              I don't think there is any way other than with a script. (Maybe Spud will add it to his EasyTrigger plug-in, but I'm not aware of any built-in way to do it.) A way that may work, though, just occurred to me: You can create a virtual device and turn it on whenever your device of interest becomes on, with a delayed event to turn it off again after the required time interval. Then you can check to see if that virtual device is on. If it is, then the actual device became on within the specified interval. (It's stuff like this that is not at all obvious, but easily done in HS that will only occur to someone like me when confronted with a question like yours. )
              Mike____________________________________________________________ __________________
              HS3 Pro Edition 3.0.0.548, NUC i3

              HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

              Comment

              Working...
              X