[SOLVED] Error and switch no longer works after OH system upgrade

  • Platform information:
    • Hardware: RaspBerri Pi 4 Model B Rev 1.2
    • OS: Linux 4.19.75-v7l+
    • Java Runtime Environment: ??
    • openHAB version: 2.5.1-2
  • Issue: My zwave ZW132 switch stopped working after performing ‘system upgrade’ action from openhabian-config app. I also have a motion detector that still works but the switch remains dead.
    It is ‘Online’ in the Things listing but every time I toggle it, I get the following error:
java.lang.NullPointerException: null
        at org.openhab.binding.zwave.handler.ZWaveThingHandler.handleCommand(ZWaveThingHandler.java:1159) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
        at com.sun.proxy.$Proxy1356.handleCommand(Unknown Source) [?:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
        at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
  • Here’s my items-configuration (which worked fine until the upgrade):
Group Huis
Group Rondom
// per Locatie
Group gGarage (Rondom)
Group gOprit (Rondom)
Group gTuin (Rondom)
// Functioneel
Group gSensors (Rondom)
Group gSchakelaar (Rondom)
Switch Gar_Sch_Licht "Licht Garage" <light> (gGarage, gSchakelaar) {channel="zwave:device:c5a04344:node3:switch_binary1"}
Switch Gar_Sens_Beweging "Beweging?" <motion> (gGarage, gSchakelaar, gSensors) {channel="zwave:device:c5a04344:node2:alarm_motion"}
Switch Gar_Sens_Alarm "Alarm" <shield> (gGarage, gSchakelaar, gSensors) {channel="zwave:device:c5a04344:node2:alarm_tamper"}
Number Gar_Sw_Licht_W "Vermogen [%.0f W]" <energy> (gGarage, gSensors) {channel="zwave:device:c5a04344:node3:meter_watts1"}
Number Gar_Sens_Helderheid "Helderheid" <sun_clouds> (gGarage, gSensors) {channel="zwave:device:c5a04344:node2:sensor_luminance"}
Number Gar_Sens_UV  "UV-waarde" <sun_clouds> (gGarage, gSensors) {channel="zwave:device:c5a04344:node2:sensor_ultraviolet"}
Number Gar_Sens_Temp "Temperatuur" <temperature> (gGarage, gSensors) {channel="zwave:device:c5a04344:node2:sensor_temperature"}
Number Gar_Sens_Batt "Batterij" <battery> (gGarage, gSensors) {channel="zwave:device:c5a04344:node2:battery-level"}
Switch Oprit_Sch_Licht "Licht Oprit" <light> (gOprit, gSchakelaar) {channel="zwave:device:c5a04344:node3:switch_binary2"}
Number Oprit_Sch_Licht_W "Vermogen [%.0f W]" <energy> (gOprit, gSensors) {channel="zwave:device:c5a04344:node3:meter_watts2"}
String Date "Datum" <calendar> {channel="ntp:ntp:local:string"}

Any help is appreciated. Thanks already

Have you tried removing and re-adding the switch in PaperUI? I believe that you need to re-add items after a system upgrade to ensure they’re using the latest definitions. It’s possible that your switch was on a definition that changed significantly between upgrades, while the sensor’s definition hasn’t changed much or at all.

1 Like

Try restarting OpenHAB too. I had to restart once before everything was loaded properly. Some say 3 times is needed.

Hello Russel & Bruce. Thank for replying.

As it seems Russel, you were almost right. Even though my items list remained untouched (it was edited by hand), removing the thing and adding that back in solved my problem.
No restart needed (this time).
as a sidenote: It would have surprised me that removing text only to add back in later would change a thing.
Earlier I had verified the thing’s list of items in paperUI and my items were marked as mapped. If something would have needed a change in the items list, I would have expected that to reflect in this screen.
Anyway, thank you both once more for your tips. Much appreciated.

Steven.

Removing a Z-Wave Thing and re-adding it gets it rediscovered by the updated binding. Otherwise the old discovery information is used.