Dimmers : how to preset light level according to time ?

Hi there,

I had a dream to set dimmer to set level about 30% or 40% when poweron it on the night (and only on night), seems there is some magic to be done, but it should be a good idea to set this on some special lights during the night to avoid being blind because of our eyes sensitivity when wake up in the middle of the night.

Do someone has an idea to achieve this ?


There should be some previous topics on this. Here’s one, and it links to an older one. There may be some newer topics also.

I think these scenarios typically rely on getting an instant update from the dimmer when you operate it manually, and then (quickly) overriding the target value.

So it depends on the actual dimmers you are using, how well this will work.

(I’m not aware of code / commands that will actually manipulate the preset inside the device.)


I am using the following setup

I have created a scene, which is triggered by switching on of the light

In the same scene under LUUP i created the following instruction;

[code]local my_device = 14 --<<< Change to your device number here
local t = os.date(‘*t’)
local current_time = t.hour * 3600 + t.min * 60 + t.sec
local begin_morning_time = 6 * 3600 – 06:00
local end_morning_time = 9 * 3600 – 09:00
local begin_evening_time = 19 * 3600 + 30 * 60 – 19:30
local end_evening_time = 22 * 3600 – 22:00

if ( current_time >= begin_morning_time ) and ( current_time <= end_morning_time ) then
luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{newLoadlevelTarget=“95” }, my_device)
return false

if ( current_time > end_morning_time ) and ( current_time < begin_evening_time ) then
return false

if ( current_time >= begin_evening_time ) and ( current_time <= end_evening_time ) then
luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{newLoadlevelTarget=“40” }, my_device)
return false

luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{newLoadlevelTarget=“35” }, my_device)
return false[/code]

it runs smoothly, and for each lamp you want to control you make a next scene

kind regards