Rule for motion detector

Ah yes, if you set expire on the light, it will turn off even when you wanted to turn it on longer by manually turning it on (e.g. a switch on the wall).

This is a case I specifically handled in my Motion Trigger DSL.

Specifically:

  • Pre-action can be specified for each light, e.g. to adjust dimmer level
  • When the relevant light(s) were turned on manually (not by the motion sensor), or by another unrelated rule, specify a longer duration (I call it manual_duration for the lack of a better name) to turn it off. The default is 1 hour but it’s configurable, or disabled, on a case-by-case basis. This avoids the annoying premature darkness when working in the room whilst being still. This ensures that lights will eventually turn off even when manually turned on and forgotten.
  • Debounce feature, to prevent immediate re-triggering after the light was turned off manually.
  • Other (and multiple) sensors or events can trigger the same light if desired, e.g. motion, door opening, arrival/departure, camera, basically any Switch or Contact item.