Rule machine Error: Cannot invoke method format() on null object

Good morning. I am a noob and am going to put my ignorance on display here.

I am trying set up my first rule to simply turn on my landscape lights in the evening, but I get stopped dead in my tracks right out of the gate. After naming the new rule, when trying to select a trigger event of specific time (sunset) I get this error "Error: Cannot invoke method format() on null object". Could it be my hub is not setup correctly? The only issue that I can see is that the setting in my hub (near where I select my timezone) shows that sunrise is at 9:49pm and sunset is at 9:56am?

So What am I missing? Thanks in advance!


I’ve created a lot of Rule Machine rules and never noticed that - very odd… I wonder if one of the devices drivers has an issue maybe? Is there an associated log entry?

Have you tried using Basic Rules? For an automation simple like the one you are describing, that is what I would use.

Welcome to the community.

Is your location setting correct (or even set)?

Settings, Postal code, Latitude, Longitude

May need to reboot your hub after changing these.

1 Like

Thanks to you both for the quick responses. So it turned out that I had entered (and rebooted) my latitude and longitude. Adding that info fixed it!

The other thing that has got me stuck is I have included a zooz dry contact relay and a zooz zen34 remote switch into my hubitat. Both have been included successfully but I am not able to figure out how to control the relay using the remote switch, I have added the dry contact relay DNI into the device association in the remote switch preferences, but it isn't working so perhaps I am entering the DNI in the wrong place?

1 Like

I suggest you start another thread for this Zooz issue, which is unrelated to your sunrise/sunset issue. That would attract responses by those familiar with the Zen34 remote switch.

1 Like

Yep...will do. Thanks again for the help!