[quote=“rigpapa, post:100, topic:198651”]If I understand correctly, your goal is to have different light levels for controlled loads at different times of day; a typical use case is full brightness during the day, reduced brightness at night. I do this myself in several bathrooms in my house–e.g. motion sensors turn on “main” lighting when motion is first detected, full bright during the day on two lights, and 30% on a single light at night. When no motion is detected for a period, all lights are extinguished.
I use an “on” scene with scene actions to set up the “daytime” scene: vanity lights and recessed fixtures set to 100% on. Then I add scene Lua code like this for the night exception:
if luup.is_night() then
luup.call_action( "urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", { newLoadlevelTarget=30 }, 66 ) -- undercabinet LED strips
return false
end
return true
So, if the night test in the Lua code fails, the scene Lua returns true, so Luup runs the scene actions normally. If the night test succeeds, the scene Lua directly sets just the toe-kick LEDs to 30%, and then returns [tt]false[/tt]. The scene actions are not run by Luup when scene Lua returns [tt]false[/tt] (so the vanity and ceiling lights are not turned on).
The second part of this is setting up the DelayLightTimer instance so that the “off list” contains all of the lights in the bathroom (shower, vanity, recessed, and WC–you don’t need an “off” scene, just list the devices explicitly in DelayLight’s config). This ensures that when the DelayLight timer expires, all lights in the room are turned off (including any additional lights turned on manually). In addition, the automatic and manual timing intervals should be set to the same value (I use 3600 = 1 hour).[/quote]
Thx Patrick
That could work, but it’s going to require me to set up approximately 14 additional scenes… and then maintain the “exceptions” in each of those… Not something I think will be an improvement on the current mechanics. I appreciate the advice though! I might tinker with your plugin code for my own use if you don’t mind.
T