Room Lighting Automation suddenly not accessible

My room lighting automation is suddenly no longer accessible. Clicking on the automation returns the following:

Unexpected Error

An unexpected error has occurred trying to load the app. Check Logs for more information.

Error: Cannot get property 'displayName' on null object

The only error I can find in the logs is:
java.lang.NullPointerException: Cannot get property 'displayName' on null object on line 1442 (method mainPage)

What does this mean and how do I fix it?

Strangely, the portion of the automation that always worked still works. I just can't get into it to edit it.

Searching around the forums indicates responses to some similar questions advise running the configure button for devices. There are four devices associated with this automation but only three have configure buttons, which I have clicked but that does not solve it.
One of the devices associated with the automation is a Bond Smart Fan. I had to delete and readd that today when I added a Bond Hub. I suspect this may have something to do with this but don't know how to fix it. I already clicked configure on this Bond device but that did not help.

It appears to me that this error is from you having deleted one of the devices used to determine off by this app. There is no easy way to recover from this -- you will have to remove the app instance (from gear icon App Status page), and recreate it.

I consider this to be a bug and will address it for the next release. It should be more graceful than just throwing an error.

2 Likes

Thank you. I really appreciate the response.
Good to have a definitive response on what I need to do. It's just one rule/app but I sure had a difficult time getting it to the point that it is. Hope I retained some of it.. I guess recreating it will be a learning experience. LOL.

ETA: I am very grateful you wrote "app instance" as this led me to believe I can solve this by removing this one "rule" not the entire room lighting app. I finally found the gear icon you reference - was first looking in the upper right, but now I see it is a tiny gear on the left of the entry for this "app instance". And I also see what looks to be the entire automation there, with absolutely no reference to the removed Bond Ceiling Fan...so I think maybe I can recreate the automation and check it against the non functional one before I delete the non functional one...

Do a local backup, revert to previous backup before the delete, copy rule, revert back to backup you just made. All assuming you know when it happened and you have a backup before then.

1 Like

There may be another way to rescue this app. Reply here and I'll let you know. I have to test first.

Appreciate that. I already recreated a new one and deleted the old one. Will learn tonight if it works - LOL.

I figured you would. This won't happen in the next release, it will be more graceful about it.

In case it is useful, the source of the issue seems to be in adding the Bond Hub.
I had already added the HE Bond integration to connect a Ceiling Fan that comes ready for the bond app and does not need a hub. I had that ceiling fan included in lights to turn off in the automation that became suddenly not accessible.

Yesterday I received my Bond Hub, but was having trouble setting it up in the app because the fan was already there. At some point in the process, either Bond or HE (and I think it was HE) gave me a cryptic message that I interpreted as due to the instance of the Ceiling Fan. So without thinking I just deleted the fan since I recalled how easy it was to link it to the app originally. Never occurred to me it would create other issues.

So the real fix to this particular issue may be to allow the Bond Hub to be added even if a ceiling fan was added first.

No, actually the fix is not to remove a device until you have removed it from every app it is used in. When you go to remove a device it warns you about it being in use. And on the device page it shows at the bottom the apps it is used in, with links to each one so you can deal with the device. Apps have no other way to recover from a device removal, so always take this step, or be prepared that those apps won't work after removal.

I did not receive any warning, thus that leads me to believe the message that caused me to delete it was in the Bond app, when I was pairing the Bond Bridge. I agree I should have remembered I included it in an automation, but it just did not occur to me at the time...

@bravenel would it be possible/feasible for the platform to call a method on the apps (similar to updated() but with the device as input parameter) when referenced devices are removed so they can have the opportunity to clean up?

This wouldn't really help in most cases. What's the app supposed to do if a device is being ripped out of some key element of the app? Apps don't have the human intelligence that needs to be applied.

Download the Hubitat app