Basic Rule not completing with time restriction

Hubitat C-7 ver

I have a simple Basic Rule set up that used to work. The rule turns the light on at the first motion event after sunset -40. It should turn off after motion has stopped for 1 minute. However, now the light then stays on until it is turned off via a virtual button in Hubitat.

After an update (unsure which one) it stopped working. I thought it might be a glitch so I paused the original rule and recreated it with the same results.

The rule is:

When Living Room Motion Sensor activates ...
Turn on Livingroom Lights
Wait until Living Room Motion Sensor motion stays inactive for 1 minute, then ...
Turn off Livingroom Lights

That rule is restricted to run at sunset -40 through 11:15pm.

The logs for the active rule show the following, repeated every 5-10 minutes during its allowed window starting at sunset -40:

app:1832021-05-20 09:52:14.857 pm errorjava.lang.NullPointerException: Cannot invoke method toInteger() on null object on line 1782 (basicHandler)
app:1832021-05-20 09:52:14.800 pm infoevt: Living Room Motion Sensor motion active

The original, currently paused rule, shows the following error at the time of sunset. The rule is also set to start at sunset -40 :

app:1102021-05-20 08:19:00.155 pm errorjava.lang.NullPointerException: Cannot invoke method toInteger() on null object on line 1782 (beforeSunsetHandlerstart)

I'm adding the error from the paused rule since the errors occur on the same line with different messages.

I have other Basic Rules that trigger off of the same model motion sensors and lights without this issue. The difference is there is no time restriction on those rules.

It was mentioned elsewhere that if I tagged @bobbyD this might get some response. If not, I appologize for disturbing you.

Would you be so kind as to post a screenshot of the rule's App Status page (gear icon).

Let me know if you need more of the page.

Yes, please, I need the Settings portion, at the top of the page.

There you go.

OK, that bug has been found, and the fix will be in the next release. In the meantime, you can't use offsets from sunrise/sunset in Restrictions -- that's what is broken.


Thanks for taking a look and getting the fix in there for the next release.

1 Like

Download the Hubitat app