Basic Rule not completing with time restriction

Hubitat C-7 ver 2.2.7.126

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.

4 Likes

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

1 Like

I've upgraded to 2.2.7.128 and continue to see an error when set to use -40 before sunset as a time restriction.

app:1102021-06-27 08:39:00.214 pm errorjava.lang.NullPointerException: Cannot invoke method toInteger() on null object on line 1782 (beforeSunsetHandlerstart)

--- Loading Past Logs... ---

The fix is in 2.2.8. That 2.2.7.128 release was about something else.

2 Likes

After upgrading to 2.2.8, I'm no longer seeing the previous error and the rule is working with a 'Sunset -50' setting. Thanks for getting that fixed.

I do now have the following error with the same rule with showed up only after the upgrade. Note that the timestamp is correct and the time in the message is sunset the next day. Since this might be related to the fix, I'm going to leave this here. If I should open a new thread for this one let me know.

app:1832021-07-19 09:53:38.572 pm errorgroovy.lang.MissingMethodException: No signature of method: static org.apache.commons.lang3.time.DateUtils.addMinutes() is applicable for argument types: (java.util.Date, java.lang.Long) values: [Tue Jul 20 20:31:00 EDT 2021, -50]

Possible solutions: addMinutes(java.util.Date, int), addMonths(java.util.Date, int), setMinutes(java.util.Date, int) on line 1787 (basicHandler)
app:1832021-07-19 09:53:38.448 pm infoevt: Living Room Motion Sensor motion active

This bug has been found, and a fix will be in the next release.

3 Likes

This bug has been fixed in the latest release, 2.2.8.138.

3 Likes

Download the Hubitat app