Light Timers

Hi there,

I read the best practices for better light timers and I must admit that I´m confused about the whole discussion.
I´m aware that there is no “THIS is the one and only possible solution”, but can anybody give me a solution that really works. I mean … REALLY works ? :slight_smile:

Thanks alot and greetings,

Julian

@Wurzelseppi, I am probably not the best one to delve too deep in this, but right now, you have given no clue what you actually want to achieve (Do you want to switch on lights at a given hour? Switch off after a certain period? A combination of both? Should user interaction prolong the interval the lights are on/off?, etc etc). Keep in mind that there is likely not one solution for all, but there may be one that fits your needs.
Maybe if you write up your use-case (that is what you actually want to have happen in plain language), with what devices (just in case there are some limitations) and on what system, it may help getting the discussion going.

I worked this up as away to tell a light to stay on for a certain amount of time in response to motion/contact/other events. I do wish there was a built in way to do this like 'item.sendCommandWithTimer(command, timeout, command) that will send the second command after the timeout.

Hi there,

ok, sorry … wasn´t very clear on this.
I want to fire of an timer when somebody switches on a light and have it switched off automatically by that timer after a certain period of time …
Maybe dimming it first to 50 %, if it is a dimmer, wouldl be cool :slight_smile:

You can use the expire binding for that.

For this you would likely need to write a rule doing that…

rule "my auto off rule"
when
    Item someSwitch changed
then
      myLight.sendCommand(ON)
      createTimer(now.plusMinutes(20) [ |
            myLight.sendCommand(OFF)
        ]
end

That’s easy enough, but I bet you really want more than that. What do you want to happen if somebody works the switch again before time is up? Could be OFF, could be start timing again?
If you implement the dimmer, what would you want to happen if switched during dimmed period?