Announcement

Collapse
No announcement yet.

I need a way if multiple things are all true, then run this event

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

    I need a way if multiple things are all true, then run this event

    I have several events the turn LEDs on and off on the WD200 switches. What's happening is as soon as the last status LED is turned off (let's say garage door closed, so top LED is no longer Red but off), then the switches return to all white LEDs indicating the light is on and at full brightness.

    Currently each LED on and each LED off is an event.

    Is there some way I can track with a variable or a virtual device??? (no idea, just talking out-loud) that if all 7 LEDs are set to off, then manually run my event as follows (which turns them all off)...

    Then HS-WX200/HS-FC200 LED Action: Set ALL Status Mode LED's To Off on All devices
    Then HS-WX200/HS-FC200 LED Action: Set Device Mode to Status on All devices

    #2
    Why couldn't you make an event with each condition that you want? There's an "And" option in the event engine

    If Device A is STATUS HERE
    AND
    If Device B is STATUS HERE
    AND
    If Device C is STATUS HERE
    AND
    If Device D is STATUS HERE
    AND
    If Device D is STATUS HERE
    ect

    Then Send Command (Turn all the LEDs off)
    You could also run the event from here too



    The AND and the OR options have really helped out with events.
    Maybe I don't understand your question
    Dan-O
    HomeSeer contributor since summer 1999, yes 1999!

    Comment


      #3
      If Device A is STATUS HERE
      AND
      If Device B is STATUS HERE
      AND
      If Device C is STATUS HERE
      AND
      If Device D is STATUS HERE
      AND
      If Device D is STATUS HERE
      As far as I know, the suggested condition will trigger only if Device A changes status, and B,C,D are already in the correct status, but if A was in the correct status (was not modified), and any of B,C,D changes, then the event will not trigger.

      the easiest way to do it is using easy trigger plugin, which can trigger if ANY device in the group is changing status. but easy trigger group items must be a device, it cannot trigger on LED status that is changed via a z-wave parameter.

      another way is to use a counter that holds the state - number of LED lit, bit manipulations, etc, and manage the state variable in the events that actually trigger the LED color/status changes.

      Comment


        #4
        "IF" is a trigger. "AND IF" is a condition. In my personal experience (and I'm not a coder, by a long shot), your best bet is the Easy Trigger Plugin and or scripting.

        PS
        You could probably do what you want with the event engine if you don't mind a morass of convoluted events.
        HomeSeer Version: HS4 Pro Edition 4.2.19.0 (Windows - Running as a Service)
        Home Assistant 2024.3
        Operating System: Microsoft Windows 11 Pro - Desktop
        Z-Wave Devices via two Z-Net G3s
        Zigbee Devices via RaspBee on RPi 3b+
        WiFi Devices via Internal Router.

        Enabled Plug-Ins
        AK GoogleCalendar 4.0.4.16,AK HomeAssistant 4.0.1.23,AK SmartDevice 4.0.5.1,AK Weather 4.0.5.181,AmbientWeather 3.0.1.9,Big6 3.44.0.0,BLBackup 2.0.64.0,BLGData 3.0.55.0,BLLock 3.0.39.0,BLUPS 2.0.26.0,Device History 4.5.1.1,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,HSBuddy 4.51.303.0,JowiHue 4.1.4.0,LG ThinQ 4.0.26.0,ONVIF Events 1.0.0.5,SDJ-Health 3.1.1.9,TPLinkSmartHome4 2022.12.30.0,UltraCID3 3.0.6681.34300,Z-Wave 4.1.3.0

        Comment


          #5
          Originally posted by ewkearns View Post
          "IF" is a trigger. "AND IF" is a condition. In my personal experience (and I'm not a coder, by a long shot), your best bet is the Easy Trigger Plugin and or scripting.

          PS
          You could probably do what you want with the event engine if you don't mind a morass of convoluted events.
          I agree with the EasyTrigger suggestion.

          IF any device in [ET Group] is set to OFF
          AND IF all devices in [ET Group] are OFF
          THEN...
          -Wade

          Comment


            #6
            Originally posted by Dan-O View Post
            Why couldn't you make an event with each condition that you want?
            I agree. This looks like a straightforward trigger with conditions example.

            My preference would be to use a recurring trigger:
            If this event is triggered every __ seconds

            I would also run the event when all the LEDs are white, if that is possible. (I don't have this switch so am not familiar with what it reports.)

            And If LED1 is white
            And If LED2 is white
            And If LED3 is white
            And If LED4 is white
            .
            .
            .
            And If LED7 is white

            Then Run Event "Turn off LEDs"

            The most common objection to recurring triggers like this is the mistaken concern that they consume lots of resources. The truth is that they do not actually run unless all the conditions are true, so they consume no more resources than any other event that is waiting for its trigger and conditions to be true.

            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


              #7
              jpm,

              I can write you a script to do this.

              Roger D

              Comment


                #8
                Originally posted by eyaniv View Post
                As far as I know, the suggested condition will trigger only if Device A changes status, and B,C,D are already in the correct status, but if A was in the correct status (was not modified), and any of B,C,D changes, then the event will not trigger.

                the easiest way to do it is using easy trigger plugin, which can trigger if ANY device in the group is changing status. but easy trigger group items must be a device, it cannot trigger on LED status that is changed via a z-wave parameter.

                another way is to use a counter that holds the state - number of LED lit, bit manipulations, etc, and manage the state variable in the events that actually trigger the LED color/status changes.
                My suggestion was a starter to get the OP going.
                There can be multiple triggers that each are dependent on a different LED changing.

                That's what I enjoy about HS.
                Although some think their way is the only way, there are so many different ways to do this.
                A plug-in, a script, an event with elaborate conditions - they all work.

                I run a similar event with the HS Multi-Sensor.
                I have a bunch of Ifs & ANDs in one event. I used to have to run 8 different events that all had a similar action, with Ifs & ANDs one event does it all.
                Dan-O
                HomeSeer contributor since summer 1999, yes 1999!

                Comment


                  #9
                  I have created virtual devices that track the status of the LED's. The LED icons are animated so if the LED on the Wall Control blinks then the icons blink too. About he only thing I have left to do is to make them follow the LED's if they are not in status mode although that would have to be simulated as there is no parameter or value that follows the LED's when they are not in the status mode.

                  This is all done with a script that interrogates the Dimmer, Fan or Switch on demand and then it updates the virtual devices. The one script works with all my devices. I just pass the parameters needed to the script for each device.

                  After I get it finished, I'll post it for everyone to use.

                  Roger D

                  Click image for larger version

Name:	LED Status.png
Views:	216
Size:	91.8 KB
ID:	1518446

                  Comment


                    #10
                    Originally posted by Uncle Michael View Post
                    I agree. This looks like a straightforward trigger with conditions example.

                    My preference would be to use a recurring trigger:
                    If this event is triggered every __ seconds

                    I would also run the event when all the LEDs are white, if that is possible. (I don't have this switch so am not familiar with what it reports.)

                    And If LED1 is white
                    And If LED2 is white
                    And If LED3 is white
                    And If LED4 is white
                    .
                    .
                    .
                    And If LED7 is white

                    Then Run Event "Turn off LEDs"

                    The most common objection to recurring triggers like this is the mistaken concern that they consume lots of resources. The truth is that they do not actually run unless all the conditions are true, so they consume no more resources than any other event that is waiting for its trigger and conditions to be true.
                    This is how I would do it. Have a recurring trigger happen every 1 second, then conditional statements (and if) checking the status of each LED.

                    I do alot of events like this, and it works great.

                    Comment


                      #11
                      Thanks everyone for the suggestions.

                      Rather than doing a re-occurring event - I created 7 events, each one having a trigger of 1 of the status LEDs going off, and then checking if each of the other 6 were off too, and if all are off setting the switch mode to status (thus the dimmer LEDs turn off).

                      I lamented inputting all that, but it didn't take that long, and its working. Still would be simpler if there was a z-wave parameter on the switches to just disable the dimmer LEDs from going on with the load entirely.

                      Comment


                        #12
                        I typically do this with two events.

                        Event A is the trigger(s) components. Event B, which is manually triggered, contains the common conditions and the actions - in this case if the 7 LEDs = off. Event A's action runs event B with the "Check conditions on target event" enabled.

                        Event A would contain 7 if / OR if's LEDs was turned off.
                        Event B would contain if manually triggered with 7 ANDs checking if all 7 lights are also off,
                        then turn off all 7 LEDs.

                        Len


                        HomeSeer Version: HS3 Pro Edition 3.0.0.435
                        Linux version: Linux homeseer Ubuntu 16.04 x86_64
                        Number of Devices: 633
                        Number of Events: 773

                        Enabled Plug-Ins
                        2.0.54.0: BLBackup
                        2.0.40.0: BLLAN
                        3.0.0.48: EasyTrigger
                        30.0.0.36: RFXCOM
                        3.0.6.2: SDJ-Health
                        3.0.0.87: weatherXML
                        3.0.1.190: Z-Wave

                        Comment


                          #13
                          Originally posted by jpm View Post
                          than doing a re-occurring event - I created 7 events, each one having a trigger of 1 of the status LEDs going off, and then checking if each of the other 6 were off too, and if all are off setting the switch mode to status (thus the dimmer LEDs turn off).

                          Originally posted by lveatch View Post
                          I typically do this with two events.

                          Event A is the trigger(s) components. Event B, which is manually triggered, contains the common conditions and the actions - in this case if the 7 LEDs = off. Event A's action runs event B with the "Check conditions on target event" enabled.

                          Event A would contain 7 if / OR if's LEDs was turned off.
                          Event B would contain if manually triggered with 7 ANDs checking if all 7 lights are also off,
                          then turn off all 7 LEDs.
                          Whilst I would normally use Easy Trigger for this, if I was doing it without then I would do it similar to iveatch, although with only a single event using group conditions.
                          The group conditions would be the 7 conditions checking all lights were off.
                          The event would have the 7 Triggers (IF, OR IFs) with each one having a condition:
                          AND IF All the group conditions are true.

                          Not better, just differentšŸ˜Š. There are many different ways to achieve the same thing in HS.

                          Steve

                          Comment

                          Working...
                          X