Is it possible to modify the dimmer devices with custom functions/variables?

There are two things I would like to add to my dimmer devices that are created by the plugin I wrote for LiteTouch (modified from the RadioRA code).

  1. Logarithmic dimming. I use LED’s in most of my lights. 10% is nearly half brightness, but if I dim them manually with the buttons I can get a very dim glow on them. There are 250 dimming levels. I’m converting, rounding, and formatting the dimming levels from the slider using this and it works great:

local rawTarget rawTarget = (string.format( "%03d", (string.format("%." .. 0 .. "f", lul_settings.newLoadlevelTarget*2.5))))

Maybe I just need higher resolution on the dimmer slider? Is it possible to change this?

  1. Fade rate. LiteTouch supports adding an option to the command which will fade the lights over a period of 0-3600 seconds. Actually, this would be more useful in scenes, like fading the kitchen, hall, and stair lights off over 5 minutes after I arm the alarm at night to give me time to get upstairs to my room.
Maybe I just need higher resolution on the dimmer slider? Is it possible to change this?
In practice the Luup slider only works over the 0-100 range. This is also the range that other plugins will expect so it would be better to leave it that way. Using your scaling of 2.5 is a better approach. You could also make this a non-linear function if you thought it gave a better tracking of light vs slider.

local target = tonumber(lul_settings.newLoadlevelTarget) local newtarget = math.floor(((target/100)^2)*250)

Would give you more adjustment at the dim end where our visual system is more sensitive to changes in light level.

I may try this. However, one of the reasons I wanted it on each device was because not all of my lights are LEDs. Having it linear for incandescents works just fine. Also, some of my LED’s dim differently depending on the brand/model.

You could always have a device variable that selects linear or power control law for each device…