Slowly Ramp Up Light - Wake Up!

Hey Friends -

I have a new one… I tried searching but there are a million different ways to word this…

I would like to slow wake someone at a certain time of the day by slowly ramping up lights over (say) a five-minute period.

I could do this with several schedules “Phase 1 Wakeup” “Phase 2 Wakeup”, etc.

However, I was wondering if someone has come up with a more elegant approach. Further, you’d need a way to interrupt the phases. For instance, “Phase 1” worked, they woke up and put the lights to 100% but then “Phase 2” kicks in and dims them back down.

Thoughts?

http://apps.mios.com/plugin.php?id=2268

Oh Z-Waver… Here I thought we would get in to some crazy PLEG or Luup code. :slight_smile:

Have an applaud. (Still not sure where my -1 came from)

Seriously, thanks. I’m ashamed.

Here is your crazy luup. If light is on, drp to 70% level and ramp down. If off, set to 10% level and ramp up.

local device=40
local delay=10

local switchOnOff = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”, “Status”, device)
local lightLevel =luup.variable_get(“urn:upnp-org:serviceId:Dimming1”, “LoadLevelTarget”, device)

if (switchOnOff == “1”) then
lightLevel=70
– Switch is on
while (lightLevel >=0) do
luup.call_delay( luup.call_action(“urn:upnp-org:serviceId:Dimming1”, “SetLoadLevelTarget”, {newLoadlevelTarget = lightLevel}, device) ,delay)
lightLevel =lightLevel-1
end

  else 
 lightLevel=10

        while   (lightLevel <100)  do
             luup.call_delay( luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = lightLevel}, device)     ,delay)                      
             lightLevel =lightLevel+1
        end
     
end

You will be able to do this in NextGen PLEG …
Actions can call them selves … (say after a ramp delay) and you just need to add a luup return false to determine when to exit the loop (i.e. your at target value)

And like other things in PLEG , if Vera reboots, it will continue where it left off.

[quote=“RichardTSchaefer, post:5, topic:192330”]You will be able to do this in NextGen PLEG …
Actions can call them selves … (say after a ramp delay) and you just need to add a luup return false to determine when to exit the loop (i.e. your at target value)

And like other things in PLEG , if Vera reboots, it will continue where it left off.[/quote]

Sounds cool. My problem is I’ve had to disable updates (per your request) because I’m not ready (ok - I’m AFRAID) to move from UI5. :slight_smile: