OffHandlerM not removed when RL app turned off by other means than motion

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).

image

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?

I will investigate... Sounds like a bug to me.

@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.

Please show the app in question. And logs would be nice too.

@bravenel Certainly.

App:

Logs:

Scheduled Jobs between 15:34:27 and 15:35:46

Scheduled Jobs between 15:35:46 and 15:36:46

And even though OffHandlerM turned off the app at 15:36:46, the OffHandler scheduled job remains:

Thanks for the details. I will take a look at this. That second turn-off should indeed be cancelled when the first one happens.

2 Likes

Download the Hubitat app