Announcement

Collapse
No announcement yet.

Complex And/Or in Events

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

    Complex And/Or in Events

    Hi all, I'm fairly new to Homeseer after moving from an ISY994. I'm have only one thing left I'm trying to do that I once did with the ISY. I've already received great help from the group and I'm sure someone here will have the answer I'm looking for.

    I'd like to create an event (or events) that will turn on a device during set hours but only if one of several other devices is also already on. Basically I want to create a:

    IF '1' is on AND ('2' is on OR '3' is on) THEN turn '4' On

    In this example '1' is a virtual device created that turns on at a start time and turns off at the end time. Items '2' and '3' are the other devices, only one of them must be on in order for the 'THEN' commands to be sent.

    The problem is that when I create the event, it seems to follow this:

    IF ('1' is on AND '2' is on) OR '3' is on THEN turn '4' On

    Is there a way to group the 'ORs' together? Maybe scripts are the way to go. If so, I'll have to learn how to use them. :-)

    Thanks in advance,
    Eric

    #2
    hope this helps

    not sure if this would work or if you tried this out yet


    IF (device 1) just had its value set or changed.
    AND IF (device 1) has a value equal to On
    AND IF (device 2) has been On for at least 1s
    OR IF (device 3) has been On for at least 1s
    Then turn on (device 4)

    Comment


      #3
      Originally posted by csullivan2005 View Post
      not sure if this would work or if you tried this out yet


      IF (device 1) just had its value set or changed.
      AND IF (device 1) has a value equal to On
      AND IF (device 2) has been On for at least 1s
      OR IF (device 3) has been On for at least 1s
      Then turn on (device 4)
      That's more or less what I've tried except that in that order it seems to require that 1 and 2 are on or 3 is on by itself. What I really want to do is that 1 must be on and either 2 or 3 are on, then it will turn on 4. Thanks for trying though.

      Eric

      Comment


        #4
        IF (device 1) changes and becomes On
        AND IF (device 2) has a value equal to On
        OR IF (device 1) changes and becomes On
        AND IF (device 3) has a value equal to On
        Then turn on (device 4)
        HS 3.0.0.548: 1990 Devices 1172 Events
        Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

        Comment


          #5
          so I have never done anything with this suggestion but just thinking it may work
          and not sure if you tried it out
          create a new event group and do something with group settings and then create an event and those group settings will apply to that event

          Comment


            #6
            sparkman

            smart thinking. that should work

            Comment


              #7
              Originally posted by sparkman View Post
              IF (device 1) changes and becomes On
              AND IF (device 2) has a value equal to On
              OR IF (device 1) changes and becomes On
              AND IF (device 3) has a value equal to On
              Then turn on (device 4)
              That's a lot closer but I'd like device 4 to turn on if the condition of any of devices 1-3 change. It looks to me that if 2 or 3 change and turn on, device 4 will stay off.

              This is one of those 'nice to have' features, not a 'need to have'. It was kind of a geeky thing I did before. It was super easy on the ISY. I like the Homeseer better for just about everything, but it seems writing event programs was easier on the ISY. :-( I'm still learning though, I may change my mind on that later.

              Thanks,
              Eric

              Comment


                #8
                You would have to add more Or Ifs coupled with And Ifs:

                IF (device 1) changes and becomes On
                AND IF (device 2) has a value equal to On
                OR IF (device 1) changes and becomes On
                AND IF (device 3) has a value equal to On
                OR IF (device 2) changes and becomes On
                AND IF (device 1) has a value equal to On
                OR IF (device 2) changes and becomes On
                AND IF (device 3) has a value equal to On
                OR IF (device 3) changes and becomes On
                AND IF (device 1) has a value equal to On
                OR IF (device 3) changes and becomes On
                AND IF (device 2) has a value equal to On
                Then turn on (device 4)

                With more devices, this becomes easier in a script.

                Cheers
                Al
                HS 3.0.0.548: 1990 Devices 1172 Events
                Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                Comment


                  #9
                  Another thought.
                  You could also create a virtual device that keeps track of the state of the predicate devices.
                  1. turn on the virtual device when any of the predicate devices is turned on.
                  2. Create a recurring event that checks if all the predicate devices are off and if the virtual device is on, then turns the virtual device off. Recurring period depends on how quickly you need to know if they are all off.
                  3. The event that turns on '4' will have a trigger something like:
                  If '1' changes and becomes on
                  And If virtual device is on
                  Or If '2' changes and becomes on
                  And If virtual device is on
                  Or If '3' changes and becomes on
                  And If virtual device is on
                  . . .
                  Then Turn device '4' on
                  This approach becomes more convenient the more predicate devices you have.
                  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


                    #10
                    Mike,

                    Thanks for the suggestion. I got it working and did basically what you suggested. I created a virtual device and created a couple events to control it. I used the Group Conditions section to create a series of "OR" conditions where the devices are 'Device xx has a value greater than Off'. In the events section I created an event that goes like this...

                    IF 'Device 1' just had its value set or changed.
                    AND Group Conditions are 'True'

                    OR 'Device 2' just had its value set or changed.
                    AND Group Conditions are 'True'

                    OR 'Device 3' just had its value set or changed.
                    AND Group Conditions are 'True'

                    THEN Set Virtual Device 'On'

                    There is another event that is the opposite. (if group conditions are false then turn virtual device off).

                    There's another virtual device that is the timer turned on and off with two other events.

                    Finally, theres another couple events that turn the device of interest on if both of the virtual devices are on and off if either one turns off.

                    It may not be the most straight forward way of getting there but it's working as I want. None of the events are reoccurring, they are all triggered by change of status on the controlling devices. Scripts may have been an easier route to go but I don't know how to write them yet. Until I get a chance to play with them, this will work. Thanks again for everybody's advice and ideas.

                    Eric

                    Comment


                      #11
                      Originally posted by ffhoov View Post
                      It may not be the most straight forward way of getting there but it's working as I want. None of the events are reoccurring, they are all triggered by change of status on the controlling devices. Scripts may have been an easier route to go but I don't know how to write them yet. Until I get a chance to play with them, this will work. Thanks again for everybody's advice and ideas.
                      Eric,
                      One of the most intriguing characteristics of HS is the variety of approaches that can be taken to solve a problem. Not only does it provide flexibility to handle subtly different circumstances, but it also lets people use techniques that make the most sense to them. Glad you got it working.
                      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