Announcement

Collapse
No announcement yet.

Best way to trigger event on multiple conditions based on a change, not state?

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

  • Best way to trigger event on multiple conditions based on a change, not state?

    I would like to trigger an event when one of our four garage doors has opened (or stopped when partially open), and then another event when all four garage doors have closed. The purpose is to provide a visual indicator anytime any of the garage doors are open.

    I first thought I could do this using an AND IF condition on the trigger, but those are all state conditions, so the closed event, for instance, would only fire when one particular garage door has become closed if the other garage doors are already closed, but not at the time of closure of one of the other garage doors. Basically I need the logic to be something like "If ANY of the garage doors changes and becomes Closed AND all the garage doors are closed", and then the other event logic to be something like "If ANY of the garage doors changes and becomes open or stopped".

    I'm sorry this is a pretty basic question but I'm new to events so this simple logic is beyond my ability at this point. Here's the event setup that I need, but it's only for one single garage door:
    Click image for larger version

Name:	Capture.JPG
Views:	189
Size:	114.1 KB
ID:	1342775

  • #2
    Here is one way that should work.

    Closed Event -

    IF The event will automatically trigger every 15 seconds
    AND IF (door 1) has a value equal to Closed
    ...
    AND IF (door 4) has a value equal to Closed
    THEN <action>

    Open Event -

    IF The event will automatically trigger every 15 seconds
    AND IF (door 1) has a value that is not equal to Closed
    ...
    AND IF (door 4) has a value that is not equal to Closed
    THEN <action>

    Vary the automatic trigger time to taste.

    Comment


    • #3
      Another option...Easytrigger plugin lets you create device groups and configure triggers and conditions exactly as you described it.
      I need the logic to be something like "If ANY of the garage doors changes and becomes Closed AND all the garage doors are closed", and then the other event logic to be something like "If ANY of the garage doors changes and becomes open or stopped
      -Wade

      Comment


      • #4
        Thanks for the responses! Sorry about the slow reply, I took some time away from the computer for the holiday. zwolfpack, that makes perfect sense and should solve my problem. Since it's just for an indicator light a don't mind a delay of several seconds. I'll take this route and post if it doesn't work for some reason.
        cc4005 I took a loot at EasyTrigger and it appears to be super useful. I'll save the $30 for now, but I think in the long run it'll do me a lot of good to purchase it. I'll probably hold out a couple months to see if a version comes out with HS4, or if HS4 has these trigger features built into it. Thanks!

        Comment


        • #5
          Have you tried using a series of Or If conditions to test for a change on each of the doors? For each door you have an Or If with a series of And If statements for each of the other doors. It would be similar to the image. You create the first door’s condition of If door 1 becomes closed And If door 2 is closed And If door 3 is closed And If door 4 is closed. Then create an Or If which will start a new "group" and switch door 1 and 2 above. Repeat for doors 3 and 4.
          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


          • #6
            Originally posted by patterrr View Post
            Thanks for the responses! Sorry about the slow reply, I took some time away from the computer for the holiday. zwolfpack, that makes perfect sense and should solve my problem. Since it's just for an indicator light a don't mind a delay of several seconds. I'll take this route and post if it doesn't work for some reason.
            cc4005 I took a loot at EasyTrigger and it appears to be super useful. I'll save the $30 for now, but I think in the long run it'll do me a lot of good to purchase it. I'll probably hold out a couple months to see if a version comes out with HS4, or if HS4 has these trigger features built into it. Thanks!
            The solutions that zwolfpack suggested will work, but will run once every 15 seconds once all the conditions are met. You can stop that with a Virtual Device or limit it with "Cannot ReRun for:" set in the advanced options for the Event. The suggestion that ksum offered is very straightforward and will work fine:

            It is a little tedious to build, but it will work.

            Click image for larger version  Name:	capture.png Views:	0 Size:	431.5 KB ID:	1344046

            With the Easy Trigger plugin it is very easy. Just create a group for all your doors and use the group in each event. You would use the HomeSeer values as opposed to the status.

            Click image for larger version  Name:	capture1.png Views:	0 Size:	50.0 KB ID:	1344047

            Just a shameless plug for Easy Trigger. It is the single most useful plug-in you can purchase. The number of things it can do and how easy it makes many Events makes it the first plugin I would recommend to any user.
            Randy Prade
            Aurora, CO
            Prades.net

            PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

            Comment


            • #7
              Actually Randy's last post got me thinking. You could do this by putting the Event in its own Group. Create the event to trigger:
              • If door 1 changes to closed
              • Or If door 2 changes to closed
              • Or If door 3 changes to closed
              • Or If door 4 changes to closed.
              Then set a Group Condition so that it only runs:
              • If door 1 is closed
              • And If door 2 is closed
              • And If door 3 is closed
              • And If door 4 is closed.
              So 4 Event conditions and 4 Group conditions and you are done.

              The image below uses light switches instead of doors for the sample as I don't have any for sensors (yet).

              Click image for larger version

Name:	Screenshot_20191202-202325.png
Views:	117
Size:	280.7 KB
ID:	1344065
              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


              • #8
                Sounds like my next purchase is going to be the Easy Trigger plugin. In the meantime, I favored the approach of setting the automatic trigger every 15 seconds because it was the simplest approach to implement and I don't care about the delay since it's just for an indicator to make sure the doors are closed before I head to bed at night. However, there are two problems with this approach:
                1) It triggers every 15 seconds, which does put more traffic on the Z-Wave network (negligible) but also dominates the logs.
                2) The garage door open event doesn't work, and given that Home Seer doesn't have the ability to set operator precedence, I don't think it's possible to make it work. Here's the event:
                Click image for larger version

Name:	Capture.JPG
Views:	103
Size:	88.4 KB
ID:	1344123
                Instead, I need operator precedence it to look like this in order to work (those red things are supposed to be parentheses):
                Click image for larger version

Name:	Capture.JPG
Views:	94
Size:	88.9 KB
ID:	1344124
                Is it possible to make that happen (as discussed below the automatic trigger isn't needed so these can all be or'd, but wondering about this for future reference)?

                The solution that ksum and rprade suggested was my original plan, but for the closed event each condition takes so many clicks to setup that it would have taken forever to setup all the conditions for four garage doors. rprade you did it in your example, do you have a trick to make it less tedious? Or do you manually click through each of the three combo boxes (I have so many devices that one of them takes a bit to find the correct device each time). Maybe I'm just being a whiner and need to suck it up and go through the clicks, but always wondering if there's an easier way. For the open event, you gave this simple example:
                Click image for larger version

Name:	Capture.JPG
Views:	93
Size:	46.9 KB
ID:	1344125
                This will work, except that I want to also know if the garage door was stopped partially open or in any other state besides closed. Is there a way to trigger on the device changing and being not equal to closed? I don't see a way to NOT the condition when the device changes and becomes, only when a device had its value set and is not equal to. That said, the latter works just fine, so I'm not sure what the difference is between "This device had its value set..." and "This device changes and becomes..."

                Thanks for the help. I'm new to events that aren't super trivial but am learning a lot!

                Comment


                • #9
                  Re the log spamming ... under the event action(s), expand Options. There's an option 'Do Not Log This Event'.

                  Looks like I got the logic wrong on the Open Event suggestion. As you found, you need 'OR IF' rather than 'AND IF'. But these two are quite different, in that 'OR IF' is actually a completely independent trigger, while 'AND IF' is a condition. You'll need to repeat the automatic trigger clause for each door

                  IF The event will automatically trigger every 15 seconds
                  AND IF (door 1) has a value that is not equal to Closed

                  OR IF The event will automatically trigger every 15 seconds
                  AND IF (door 2) has a value that is not equal to Closed

                  OR IF The event will automatically trigger every 15 seconds
                  AND IF (door 3) has a value that is not equal to Closed

                  OR IF The event will automatically trigger every 15 seconds
                  AND IF (door 4) has a value that is not equal to Closed
                  THEN <action>

                  This action will be run whenever any door is not closed (open, partially opened, etc.)

                  Comment


                  • #10
                    Another suggestion that might be better if it works...

                    IF demo door1 changes and becomes Any State
                    AND demo door1 has a value that is not equal to Closed

                    OR IF (repeat for door2 ... etc).

                    Comment


                    • #11
                      zwolfpack Thanks for the tip on not logging events and also explaining the precedence of OR operators. Both super helpful tidbits of information. I think I'm all set now. Thanks to everybody who helped.

                      Comment


                      • #12
                        Originally posted by patterrr View Post
                        rprade you did it in your example, do you have a trick to make it less tedious? Or do you manually click through each of the three combo boxes (I have so many devices that one of them takes a bit to find the correct device each time). Maybe I'm just being a whiner and need to suck it up and go through the clicks, but always wondering if there's an easier way. For the open event, you gave this simple example:
                        I missed this question when you first posted it. If you are using a computer with a keyboard to create Events, type the first letter or few letters of the device’s location2 and the list will jump to that location. With the naming conventions I use I can type “pow” and it will jump to Power devices or “lig” will jump to Lighting. In this event I typed “ho”. This is where careful thought into naming and use of Location1 and Location2 will really pay off. Even with several thousand Devices, I can quickly jump to any group of Devices then a specific a Device when creating an Event. Using this technique it is possible to build very complex Events in short order.
                        Randy Prade
                        Aurora, CO
                        Prades.net

                        PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

                        Comment


                        • #13
                          Late to the party, but the way I do it for my garage closing is:

                          Event GarageClosed:

                          If Garage1 changes to Closed
                          OrIf Garage2 changes to closed
                          OrIf Garage3 changes to closed
                          Then
                          If conditions are true, run event AllClosed

                          Event AllClosed:

                          If Manually Triggered
                          AndIf Garage1 is closed
                          AndIf Garage2 is Closed
                          AndIf Garage3 is closed
                          Then
                          <do all closed stuff>

                          Comment

                          Working...
                          X