Case:
RL app is configured with "Means to Activate Lights" set to "switches that turn on" and "motion sensors that become active"
RL app is configured with Means to Turn off set to "motion sensors that all become and stay inactive for X minutes" inactive and with the light switch used in "Means to activate lights" used in the turning off option "Switches that determine all Lights are off".
If the motion sensor has been active and then becomes inactive, the offHandlerM is scheduled to turn off the app (as expected).
However, if the RL app is turned off by the switch before offHandlerM runs, the offHandlerM is never removed and continues being scheduled even when the app no longer is active. If the switch is used to activate the app again before offHandlerM has run, and without triggering motion, the old offHandlerM will turn off the lights based on the time from the previous "active" session. @bravenel I presume that this is not the intended behaviour and could be regarded as a bug?
@bravenel Looks like OffHandler is suffering from the same bug. If OffHandlerM or some other out of band method turns off the app before OffHandler, OffHandler is not removed from the scheduled jobs.