Announcement

Collapse
No announcement yet.

Event Condition for checking more than one device

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

  • Event Condition for checking more than one device

    I have a situation where I want to use the state of more than one device as a condition for a trigger action. When the event trigger occurs (in this case, I'm using an Aeotec Minimote button) I want to check to see if either of two devices is OFF and, if so, I want to turn them both ON. You might as why I wouldn't just turn them both on without the condition. Well, the button is actually a toggle. A second event triggers with the same button and needs to check if either device is NOT OFF and, if so, turn them both OFF.

    I could probably do this with a virtual device but that would involve even more events to turn the virtual device on and off every time either of the other two devices changed state.

    I know I could do this with a script but I'm trying to get out of scripting all of my logic so I can take advantage of the "Referencing Devices" filter in the UI.

    Thanks,
    Ken

  • #2
    Ken,

    Nothing virtual needed, just a extra trigger by adding a OR IF to the event...


    Wim
    Attached Files
    -- Wim

    Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
    650 devices ---- 336 events ----- 40 scripts

    Comment


    • #3
      Hi Wim,

      That's what I would have thought too but the OR IF condition is "had its value set to..." instead of "has a value equal to...".

      It's funny that I'm working on this for some Jowihue plugin devices. Off to do some testing.

      Thanks,
      Ken

      Comment


      • #4
        If you expect toggle, you have to use the trigger (first condition after IF or OR IF) for set to value on both....
        -- Wim

        Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
        650 devices ---- 336 events ----- 40 scripts

        Comment


        • #5
          How do you decide to toggle if one is off and one is on? Are they switches or dimmers? When you state that one is Not Off, does that mean On, some dim level or both? I am trying to understand your decision logic.

          A=On
          B=Off
          Randy Prade
          Aurora, CO
          Prades.net

          PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

          Comment


          • #6
            Thanks Wim and Randy.

            The devices are actually Philips Hue LightGroups created by the Jowihue plugin. I had to study Wim's screen shot for a little while before I understood the logic.

            In words, what I want to do is:

            If a button on a remote is pressed, check to see if A is anything but OFF or if B is anything but OFF. If True, turn both A and B OFF.

            The reason for "anything but OFF" is because even ON for a Philips Hue LightGroup is DIM 100% (i.e. 100), not 255.

            Second event:

            If the same button is pressed on a remote, check to see if A is OFF or if B is OFF. If True, turn both A and B ON, which appears to be ON LAST LEVEL for Philips Hue.

            I tested the events and got them working with virtual devices so my wife isn't too irritated by the lights going on and off.

            Click image for larger version  Name:	Screen Shot 2019-08-03 at 8.09.31 PM.png Views:	0 Size:	73.3 KB ID:	1319151

            It wasn't until I noticed the gap between the AND IF and the OR IF that I realized how the logic was working.


            Thanks,
            Ken

            Comment


            • #7
              If one light is off and one light is anything but off, both events will fire. I don't think you can do this with one press of one button.
              -Wade

              Comment


              • #8
                Originally posted by cc4005 View Post
                If one light is off and one light is anything but off, both events will fire. I don't think you can do this with one press of one button.
                hanks cc4005 . You are absolutely correct. Not sure how I didn't see that in my testing. For now I've set the ON trigger to short press (3) and the OFF trigger to long press (7). Basically, Scene 3 turns both devices ON and Scene 7 turns them both OFF.

                Thanks again,
                Ken

                Comment

                Working...
                X