Scenes break when devices are excluded

I had a power failure that caused a z-wave switch to lose z-wave connectivity. To bring it back I excluded and re-added the switch. Excluding a device that was part of an existing Scene caused a nullref error on the Scene edit page:

2021-07-11 08:50:43.712 [error](http://192.168.1.139/installedapp/configure/14)java.lang.NullPointerException: Cannot get property 'currentSwitch' on null object on line 594 (mainPage)

Because the scene was now un-editable, the issue was impossible to fix without deleting all scenes and starting over completely. Quite a waste of time.

Do you mean deleting all scenes that reference that device?

I will investigate if there is a way to avoid this throwing a fatal error in this circumstance.

Not sure, but it may be in a case like this that you can use Replace Device from the Z-Wave info page, which would prevent this sort of problem.

I do think the error can be prevented, and show instead that there is a bad device in the Scene. That fix will be in the next release (sorry its too late for your problem, but I'm not aware of this ever being reported before).

Ah, I meant: to update/delete a scene you need the Scene edit page, but this was broken. All I could do to clean it up was "Remove Groups and Scenes" on the app page (then re-add the app, and reconfigure everything).

Thanks for taking a look! I didn't realize there was a Replace Device gesture. Probably removing the device from its Scenes ahead of time would also do the trick.

Yes, but you can't anticipate something like what happened to you.

With Respect to having to remove all Scenes due to a broken one, I would suggest not to do this, but rather to bring the issue to our attention, as you did. Often, a new release will fix a problem like this, as in this case it will. Scenes that don't include the bad device would continue to function, and you should have been able to create new Scenes without having to throw all away. Sometimes, even the affected Scene would continue to function, but if not, any app can be removed individually by opening its App Status page (gear icon to left of the app on the Apps page). On that page you can remove a broken app.

1 Like

any app can be removed individually by opening its App Status page (gear icon to left of the app on the Apps page)

Great to know, thanks for the tip!

Download the Hubitat app