Motion sensor items

Jason
First, I’m glad that you realized sending a state update every 30 seconds will kill battery powered devices. Second, let me ask a question. Are you using timers or the expire binding? The expire binding automatically resets the timer every time it receives any command other then OFF. I think timers can do the same thing but not without some fiddly coding.
With you sensors, I think starting the timer when ever motion stops is the way to go because when motion stops is when you really want to wait for a few more minutes and if no motion has occurred, turn off the lights. But with the expire binding, sending the switch (which is configured with expire binding) anything other then OFF resets the timer, even ones or zeros should restart it.

Rich has a Design Pattern somewhere made for this exact situation

And maybe you already know about the expire binding but if not go here