Two step lightcontrol with motion sensor

To do two different things at two different times with expire based timing, you’d need two dummy Items. You would give both a kick at each motion trigger.

If you’re going with the rule-based timer (I would do it that way) this is a fairly key point.

The trick is to use a global variable to hold a handle to your timer. This survives in between runs of rules or different rules, so you can “do stuff” to an existing timer after you first create it.
You’ll find lots of timer examples using this technique. The main elements are creating a var outside of any rule (that is what makes it “global”) and then instead of an anonymous createTimer(), you assign it to that variable.

The general idea is shown under “Simple Example: Timers Version” here

I think I would have it cancel an existing timer at each motion trigger (because you don’t know which of the two steps it might currently be in) and create anew. (and of course set full brightness)

You can still use your previous reschedule idea for the two-stage timing - if it is full bright at execution time, set part bright and reschedule. If it is part bright, set off and finish.

1 Like