Motion and Mode Lighting App Broke After 2.3.1.142 Upgrade

I've been using the Motion and Mode Lighting App for quite a long time, using it to turn on and off scenes based on motion and the current mode. It has been working great, no issues until today when I upgraded from 2.3.1.133 to 2.3.1.142.

Once I upgraded, Motion and Mode Lighting App started crashing when it tried to run off the lights (scene). I'd get one of two error messages in the logs:

java.lang.NullPointerException: Cannot invoke method off() on null object on line 1481 (method turnOff)
java.lang.NullPointerException: Cannot invoke method size() on null object on line 1480 (method turnOff)

I've got three modes defined in my hub (Home, Night, and Away). And I've got scenes for Day and Night modes. I tried opening each app and resaving it, but that didn't fix the issue.

I eventually reverted back to 2.3.1.133, but the problem has followed me back! Now in .133 when the app tries to turn off the scene, it crashes again, this time with:

groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.toInteger() is applicable for argument types: () values: []
Possible solutions: toUnique(), toUnique() on line 1480 (method turnOff)

I again went into all the Motion and Mode Lighting apps and verified the settings and resaved them. I've also tried rebooting the hub, doesn't seem to help. And I tried resaving the scenes.

Appreciate any suggestions on how to fix this bug with the Motion and Mode Lighting app.

The thing that followed you back was your database, which, unrelated to the update, I believe could be corrupted.

I would suggest you back up and download a backup, do a soft reset, then restore an earlier backup from when things were good. It could even be a restore of an automatic morning backup stored on your hub.

2 Likes

I agree with this recommendation. :point_up_2: I have .142 on my C4 hub and motion/lighting apps are working fine.

2 Likes

I have since restored my backup, as I too suspected the database carried the issue back to .133. And yup, that did "fix" the problem. But my backup was from just before the .142 upgrade today, so the problem definitely occurred either during the upgrade or because of .142. I did review the logs before the upgrade, and there was no problem with this app,

I'm not aware of anyway to debug the Motion and Mode Lighting app, so I'm hoping one of the Hubitat developers can look at those error messages and have some insight as to what the issue is/was.

Just an update...

I tried the upgrade again, this time from 2.3.1.133 to 2.3.2.128. Before I did the upgrade, I rebooted the hub. A problem still exists in 2.3.2.128 with the same Motion and Mode Lighting Apps:
2022-06-21 05:05:17.055 pm errorjava.lang.NullPointerException: Cannot invoke method on() on null object on line 1446 (method motionActive)
However, this release I was able to 'resolve' the problem by going into each of the Motion and Mode Lighting Apps, checking all the settings, and then resaving them.