Announcement

Collapse
No announcement yet.

On Last Level - usage?

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

  • On Last Level - usage?

    I have a porch motion event that when motion is detected (#if nighttime), then the lights go to 100%, after a preset time the lights should go back to the level that was present immediately before the event is triggered. If lights were off, the event should trigger lights to 100% then back to off OR if lights were on but at 60% it would go to 100% then back to 60%. Rather than hardcoding the logic was hoping i could take note of the level prior to the trigger and resort back to that level. Tried using last level but doesn't seem to work. Can someone explain how last level works with UPB and/or think of alternatives other than hardcoding logic? Thanks.

  • #2
    If your criteria is simply if it is off go back to off and if it's on go back to 60% that can be accomplished with 2 different events.

    IF motion, And IF device if off, then device on, wait x minutes, device off

    IF motion, And IF device has a value that is not equal to off, then device on, wait x minutes, device 60%

    I think that would work.. You wouldn't go back to last value though if the lights were at say 40% before the motion trigger. You'd set it to 60% if the lights were already on at any %.

    Comment


    • #3
      Thanks Denis. This is how its set up right now. Wish for it to be smarter. Not all times will it be at 60% and I want to use something similar for different devices. Hence a desire to turn it back to a level that was previously on before the event; be it zero, 40% or anything else. I would think that is what last level would accomplish but cannot find anything on that specific function.

      Comment


      • #4
        The way I've done something similar is to create a "shadow" virtual device and an event that updates the shadow device when the primary device changes.

        In your case, the motion event would not update the shadow device, but have a delayed action that would set the primary device to the dim level in the shadow device.

        You'd also need to create another event that would be triggered by a change to the dim level of the primary device, and update the shadow device to match. It would also need a condition to prevent it from updating when the motion trigger occurs.

        PS. My understanding of 'last level' is that it provides a way to have a light turn on to the same dim level it had when it was turned off.
        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.500

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

        Comment


        • #5
          Unc,
          Makes complete conceptual sense. However, can you provide me a bit more insight into passing values between devices? I think I can set up the events easy enough but not sure how to address the value passes between devices. Seems I would need a script which I've not used before.

          Comment


          • #6
            I guess conceptually you can create a dimmable virtual device. Check out This Post where I used Al's sync script to get the value from one switch and update another device.

            1. Create dimmable virtual device
            2. Install sync VB script from This Post.
            3. IF motion, get the dim value from the outside light switch and sync it to the virtual device
            4. Set the outside light switch to ON / 100%
            5. Wait X minutes
            6. call the sync script and sync the value back from the virtual dimmable device the outside light switich

            Should do the trick if the sync script works with virtual devices.

            Comment


            • #7
              Originally posted by acalbear View Post
              . . .can you provide me a bit more insight into passing values between devices?
              I use a script, but I think Spud's Easy Trigger plug-in has a way to do the first part. Use a device value change as a trigger, then use Easy Trigger to set the value of one device to the value of another device. That will make the virtual shadow device have the same value as the light. Using that value to reset the dim level of the light will be difficult without using a script, I think.
              Mike____________________________________________________________ __________________
              HS3 Pro Edition 3.0.0.500

              HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

              Comment


              • #8
                Originally posted by denisl View Post
                6. call the sync script and sync the value back from the virtual dimmable device the outside light switich

                Should do the trick if the sync script works with virtual devices.
                Just setting the device value of a light switch device does not normally result in the physical light changing its dim level. But the sync script uses CAPI to set the dim level, so it looks like that would work to set the light back to its previous level.

                I don't know what CAPI does with a virtual device, but it probably would do the first part too, although the Easy Trigger plug-in may be easier to use for that step.
                Mike____________________________________________________________ __________________
                HS3 Pro Edition 3.0.0.500

                HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

                Comment

                Working...
                X