[Code] RampDown: a device for ramping down a set of lights slowly

I apologize this took so long. This code is in response to the request from RastusB2 for an equivalent RampDown device that works like the WakeupRamp device I published a year ago.

The attached files implement a binary device that I call RampDown. You can use it to slowly ramp down a set of lights from a maxLevel to a minLevel over a period of time.

Warning: this is for UI4, as I haven’t upgraded yet myself.

To use, upload both of the attached files via the UI and then create a device using:

device type : urn:schemas-upnp-org:device:BinaryLight:1
device file : D_RampDown.xml
impl file : I_RampDown.xml

Once you created the device you might have to refresh the settings to see the Advanced Device variables.

To configure, go to the advanced settings tab in the newly created device and scroll to the bottom:

Devices : this is a list of device id’s for the lights you want to ramp down
RampTimeSecs : this is the ramp time in seconds (default 1800 = 30 minutes)
MaxLevel : this is the start level of brightness (typically 100)
MinLevel : this is the minimum brightness level when the ramping stops (typically 0)
InhibitingDevices : this is a list of device id’s that inhibit the ramping. I use this with virtual devices that specify if you are on vacation or similar reasons for not ramping. (you can leave that blank)

Now, create a scene that will turn this rampdown ramp device on at the time you want the lights to start to go down.

The code sends target levels to all devices in the list every 30 seconds or so, based on your ramp time and MaxLevel. You can set the MinInterval to something larger or smaller than 30 seconds.

The device will turn off automatically when the final light level is reached.

Note: I know you will probably want the feature that starts the ramping from the light level the light currently has. This is difficult to do as the reading of the level Vera provides me is often wrong and not the same as the actual light level. So I doubt I can get that to work.

Enjoy, and let me know if you have problems.

-ZMaF

ZMaF;
Thanks for such a speedy response in regards to my request.
I have been using two of your ramp up devices for some time now and I am greatlful for them.
I have studied your code and I must say, while I don’t understand the structure of it,
I do admire your abilities to understand all of what it takes to write it :slight_smile:
I see Vera as one of those items that if you know HOW to ask it, she will give it,
and obviously, you know how to ask !!

I have downloaded the files and will be in touch to let you know how it goes.

UPDATE:
Works as advertised!! - Ramp up & Ramp Down Device (s):
I was able to set the details in the advance tab (s) of the device (s).
I am able to control the length of ramp up/down and the incremential steps in each device.
This gives me alot of control about when to start the device and when it will shut off.
As noted, I tried to set the device to start at a certain level but Vera doesn’t play that way. :slight_smile:
Many thanks for a well written device (s).

I can’t get the below to show up in the “advanced settings” tab for the device. Any idea why? I’ve uploaded the two files, and created the device as outlined. I refresh Vera, and the device shows up, but I can’t turn it on/off, and the below variables aren’t showing. I deleted and re-tried to create the device once, but they’re still not showing.

Devices : this is a list of device id’s for the lights you want to ramp down
RampTimeSecs : this is the ramp time in seconds (default 1800 = 30 minutes)
MaxLevel : this is the start level of brightness (typically 100)
MinLevel : this is the minimum brightness level when the ramping stops (typically 0)
InhibitingDevices : this is a list of device id’s that inhibit the ramping. I use this with virtual devices that specify if you are on vacation or similar reasons for not ramping. (you can leave that blank)

I can’t figure this one out…I’ve added it and deleted it several times hoping it would work, but no luck. After about the 3rd time, Vera didn’t like what I did, and completely cleared out all information for my devices. Names, room assignments, etc. were all gone. God bless auto-back-up. I don’t think it was this device that did it, but I still can’t get it to work. Anybody have any tips? Have others other than the above poster gotten it to work? I can’t figure out why I’d be atypical, and I’ve gotten virtual switches, the Ademco Alarm plug-in, and several other devices to work in the past.

Floor61, not sure what’s going wrong for you. Are you using UI4 ? The code only works for that. I’ve tested it and at least one other user was able to run it on UI4.

ZMaF,

Yes, using UI4. I just saw your combined plug-in, so I will try and install that one and see if I have more luck. I’ll keep you posted.

Thanks for your efforts on the plug-ins.

I’m completely baffled. The new plug in did the same thing…these don’t show up…Instead it’s just some generic fields. I’ve done it 2-3x with now luck.

Devices : this is a list of device id’s for the lights you want to ramp down
RampTimeSecs : this is the ramp time in seconds (default 1800 = 30 minutes)
MaxLevel : this is the start level of brightness (typically 100)
MinLevel : this is the minimum brightness level when the ramping stops (typically 0)
InhibitingDevices : this is a list of device id’s that inhibit the ramping. I use this with virtual devices that specify if you are on vacation or similar reasons for not ramping. (you can leave that blank)

Can you confirm the fields below are correct. Its sounds like there an error in what is entered. Ensure there are no space after the after the name as they will not work correctly as you are explaining. If they appear correct delete the impl_file details. Save, modify re-insert impl_file details and save again

device_type = urn:schemas-upnp-org:device:BinaryLight:1
device_file = D_RampUpDown.xml
impl_file = I_RampUpDown.xml

Any status update on a UI5 compatible version of this plugin??