Simple automation rule generates NullPointerException errors

I run a set of rules that I've haven't touched in several years. My hub has been running for a long time. Starting about a week ago, one of my simple automation rules failed, generating NullPointException errors. I did some searching and saw that others had reported this within the last few years and there were comments that a bug was found and had been fixed. So it occurred to me that I really should update the hub, maybe it would fix the problem. Today I updated to, which was seamless... all my existing rules seemed to work fine. However, I still get this NPE error.

The error occurs when the code tries to turn off a Zigbee power outlet a few minutes after sunset. I can turn the outlet on/off manually without a problem so I don't think this is a Zigbee issue etc.

Attached are screen shots of the log file and the rule itself. Any help greatly appreciated.

In case thereโ€™s something corrupted about the rule, have you tried recreating it from scratch? That would be pretty simple to try.

I didn't try that because this is a cookie cutter rule. You just click the boxes in the template and fill in the delay values you want. I could try it of course, but this code has been working fine for years.

Anything can get corrupted on a power loss to the hub.

1 Like

OK I will try to recreate the rule. But my hub is on a UPS, never loses power.