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.
Announcement
Collapse
No announcement yet.
On Last Level - usage?
Collapse
X
-
GuestTags: None
-
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 %.
-
Guest
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
-
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.548, NUC i3
HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti
Comment
-
Guest
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
-
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
-
Originally posted by acalbear View Post. . .can you provide me a bit more insight into passing values between devices?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
-
Originally posted by denisl View Post6. 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.
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.548, NUC i3
HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti
Comment
Comment