Announcement

Collapse
No announcement yet.

Trigger an event ONLY if the light was previously on and was changed (dimmed)

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

    Trigger an event ONLY if the light was previously on and was changed (dimmed)

    The title pretty much says it. I want to trigger an event ONLY if a light level on a dimmer was changed and it's previous value was not Off.

    Is there a way of doing this? I may be missing it and if I am, I'm sorry

    #2
    Post a screenshot of your attempt, and I'll be happy to see where the issue lies.
    Will be something like if a device has changed AND IF it was previously greater than zero.

    Comment


      #3
      Originally posted by sirmeili View Post
      The title pretty much says it. I want to trigger an event ONLY if a light level on a dimmer was changed and it's previous value was not Off.

      Is there a way of doing this? I may be missing it and if I am, I'm sorry
      It could be done with a virtual device and three events. I can't think of any other way without a script. Event 1 and Event 2 control the virtual device. Event 3a would trigger if it was set to any level other than OFF, Event 3b would include any level including OFF.

      Event 1
      IF Light 1 was set and has a value greater than OFF
      THEN set Virtual Light 1 to ON

      Event 2
      IF Light 1 was set and has its value set to OFF
      THEN set Virtual Light 1 to OFF

      Event 3a
      IF Light 1 was set and has a value greater than OFF
      AND IF Virtual Light 1 has a value equal to ON

      THEN Action

      Event 3b
      IF Light 1 just had its value set or changed
      AND IF Virtual Light 1 has a value equal to ON

      THEN Action
      HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

      Comment


        #4
        Originally posted by 519zwave View Post
        Post a screenshot of your attempt, and I'll be happy to see where the issue lies.
        Will be something like if a device has changed AND IF it was previously greater than zero.
        There is not a condition "This device was previously greater than zero".
        Last edited by randy; May 20, 2015, 06:19 PM.
        HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

        Comment


          #5
          I'm having trouble with the logic of why this won't work Randy. Appreciate your insight as always!
          Attached Files

          Comment


            #6
            Originally posted by 519zwave View Post
            I'm having trouble with the logic of why this won't work Randy. Appreciate your insight as always!
            That would be true any time the light is set to any value other than off, it would be true no matter what value it was before the event triggers. Once the trigger has been met, the new value that the condition looks at is already set, it does not represent the value before you changed it.

            Your event would behave the same as:

            IF The device was set and has a value greater than OFF

            Your original request was
            I want to trigger an event ONLY if a light level on a dimmer was changed and it's previous value was not Off.
            HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              Thanks. I understand that now. Glad to have you around Randy

              Comment


                #8
                It could be done with a timer too. That would have the added benefit of allowing you to have the changing light level only trigger the action if it's been NOT OFF for less than or greater than a certain amount of time.

                Event 1
                IF Light 1 was set and has a value greater than OFF
                THEN Start Light 1 timer

                Event 2
                IF Light 1 was set and has its value set to OFF
                THEN Reset Light 1 timer

                Event 3a
                IF Light 1 was set and has a value greater than OFF
                AND IF Light 1 timer is greater than 1 Second

                THEN Action

                Event 3b
                IF Light 1 just had its value set or changed
                AND IF Light 1 timer is greater than 1 Second

                THEN Action

                You could then have an event like:

                IF Light 1 was set and has a value greater than OFF
                AND IF Light 1 timer is greater than 10 Minutes

                Then Action
                Originally posted by rprade
                There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

                Comment


                  #9
                  Originally posted by S-F View Post
                  It could be done with a timer too. That would have the added benefit of allowing you to have the changing light level only trigger the action if it's been NOT OFF for less than or greater than a certain amount of time.

                  Event 1
                  IF Light 1 was set and has a value greater than OFF
                  THEN Start Light 1 timer

                  Event 2
                  IF Light 1 was set and has its value set to OFF
                  THEN Reset Light 1 timer

                  Event 3a
                  IF Light 1 was set and has a value greater than OFF
                  AND IF Light 1 timer is greater than 1 Second

                  THEN Action

                  Event 3b
                  IF Light 1 just had its value set or changed
                  AND IF Light 1 timer is greater than 1 Second

                  THEN Action

                  You could then have an event like:

                  IF Light 1 was set and has a value greater than OFF
                  AND IF Light 1 timer is greater than 10 Minutes

                  Then Action
                  That is also a good solution. You could also use a counter for that matter. Set it to 0 when the light is off, increment it when it is on, then use the counter as a condition. Both your solution and the counter would have the advantage of not creating new devices in the Device Manager. I just hide them to cut down clutter.
                  HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                  Comment


                    #10
                    Yeah. I was thinking about mentioning counters here also. So you could do things like not run the event if the trigger has been happening too frequently.
                    Originally posted by rprade
                    There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

                    Comment

                    Working...
                    X