Announcement

Collapse
No announcement yet.

How Does HS3 Evaluate Boolean Operators?

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

    How Does HS3 Evaluate Boolean Operators?

    Hi, Folks.

    I want my system to trigger my siren/strobe when the "alarm" mode is set to on and when motion is detected. I have set up my system as follows:



    The problem is the strobe lights up even if the alarm mode is not set to on. Thanks in advance for your help.

    #2
    Originally posted by hkfanatic View Post
    Hi, Folks.

    I want my system to trigger my siren/strobe when the "alarm" mode is set to on and when motion is detected. I have set up my system as follows:



    The problem is the strobe lights up even if the alarm mode is not set to on. Thanks in advance for your help.
    Because each "OR IF" is a separate trigger. The AND IF Condition is only applied to the first Trigger. The event will run if either of the OR IF triggers are true.

    Read this thread for clarification.
    https://forums.homeseer.com/showthread.php?t=173196

    Another problem you may run in to is that you are using the device being "set" as a trigger. In most cases you want to trigger on a device being changed, rather than set. A device that is already on will trigger if its value is set to on. Normally you would want to trigger if the device changes and becomes on.

    The exception is remotes and scene control devices where you want an event to trigger, even if the status does not change.
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      2 ways to fix it

      There are 2 ways to fix this:
      1. Add your IF statement to each of the OR IF statements
      Example: IF Alarm Virtual Device is ON
      AND IF other devices are on
      OR IF Alarm Virtual Device is ON
      AND If other devices are on
      OR IF Alarm Virtual Device is ON
      AND If other devices are on

      2. A bit more sophisticated approach. Consider moving all your events that trigger when [Alarm Virtual Device is ON] to a event group by themselves and use a single GROUP CONDITION that must be TRUE before the event triggers. That way you only have to validate one time IF Alarm Virtual Device is ON in the Group Condition.

      Comment


        #4
        Originally posted by rprade View Post
        Because each "OR IF" is a separate trigger. The AND IF Condition is only applied to the first Trigger. The event will run if either of the OR IF triggers are true.

        Read this thread for clarification.
        https://forums.homeseer.com/showthread.php?t=173196
        Thank you very much, Randy. This confirms my suspicion that HomeSeer's engine does not evaluate my boolean as:

        If Alarm is on and (if motion #1 is detected or if motion #2 is detected or if motion #3 is detected) then...

        Originally posted by rprade View Post
        Another problem you may run in to is that you are using the device being "set" as a trigger. In most cases you want to trigger on a device being changed, rather than set. A device that is already on will trigger if its value is set to on. Normally you would want to trigger if the device changes and becomes on.

        The exception is remotes and scene control devices where you want an event to trigger, even if the status does not change.
        Duly noted, sir. I recently started using "when a device changes and becomes" as a trigger. However, I discovered that if my virtual device FANS (that is supposed to control 2 physical fan devices) is already set to on and I ask Alexa to turn FANS on (perhaps because one of the fans isn't on yet), it won't run the event anymore because FANS was already on in the first place and its value has not "changed." That is why I switched back to using "when a device has a value set to..."

        Thanks again for your helpful input.

        Comment


          #5
          Originally posted by ybanerd View Post
          There are 2 ways to fix this:
          1. Add your IF statement to each of the OR IF statements
          Example: IF Alarm Virtual Device is ON
          AND IF other devices are on
          OR IF Alarm Virtual Device is ON
          AND If other devices are on
          OR IF Alarm Virtual Device is ON
          AND If other devices are on

          2. A bit more sophisticated approach. Consider moving all your events that trigger when [Alarm Virtual Device is ON] to a event group by themselves and use a single GROUP CONDITION that must be TRUE before the event triggers. That way you only have to validate one time IF Alarm Virtual Device is ON in the Group Condition.
          Great idea! I'll give it a try. Thanks!

          Comment

          Working...
          X