ZoneMinder Binding: Method 'refreshThing()' for Bridge failed for thing

Configured ZoneMinder the other day. Seems to work well, but I continuously get this error in my log files. Monitor 1 and 2 seem to work fine in OpenHAB2. Any thoughts on what this is complaining about?

2017-06-17 19:39:33.547 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-2' - Exception='java.lang.NullPointerException'
2017-06-17 19:39:35.627 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-1' - Exception='java.lang.NullPointerException'
2017-06-17 19:39:39.582 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-2' - Exception='java.lang.NullPointerException'
2017-06-17 19:39:43.696 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-1' - Exception='java.lang.NullPointerException'
2017-06-17 19:39:48.704 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-2' - Exception='java.lang.NullPointerException'
2017-06-17 19:39:50.785 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-1' - Exception='java.lang.NullPointerException'
2017-06-17 19:39:54.344 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-2' - Exception='java.lang.NullPointerException'
2017-06-17 19:39:56.438 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-1' - Exception='java.lang.NullPointerException'

I just started using this too and I get the same-ish error. I can set properties from OH, which is pretty much all I want to do, turn the camera to Record when someone is coming up the driveway or during a security breach, etc.

It would be nice if the state would update though, I’ve captured a debug log of the issue:

2017-06-17 20:40:16.233 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:3/daemon:zmf.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:16.258 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: Method 'refreshThing()' for Bridge zoneminder:server:1214133b failed for thing='zoneminder:monitor:1214133b:monitor-3' - Exception='null'
2017-06-17 20:40:16.258 [INFO ] [andler.ZoneMinderServerBridgeHandler] - BRIDGE [1214133b]: Calculated refresh inetrval to '30'
2017-06-17 20:40:16.258 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE [1214133b]: Starting ZoneMinder Bridge Monitor Task. Command='org.openhab.binding.zoneminder.handler.ZoneMinderServerBridgeHandler$2@1f6f0588'
2017-06-17 20:40:16.258 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE [1214133b]: Starting ZoneMinder Bridge Monitor Task. Command='org.openhab.binding.zoneminder.handler.ZoneMinderServerBridgeHandler$3@2654a2f5'
2017-06-17 20:40:16.274 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: URL='http://192.168.0.10:80/zm/api/host/getVersion.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:16.286 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: URL='http://192.168.0.10:80/zm/api/configs/view/ZM_OPT_USE_API.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:16.302 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: URL='http://192.168.0.10:80/zm/api/configs/view/ZM_OPT_USE_AUTH.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:16.316 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: URL='' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:16.316 [INFO ] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: Bridge 'zoneminder:server:1214133b' connected
2017-06-17 20:40:16.877 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]:    SourceType:         FFMPEG
2017-06-17 20:40:16.877 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]:    Format:             255
2017-06-17 20:40:16.877 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]:    AlarmFrameCount:    1
2017-06-17 20:40:16.877 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]:    AlarmMaxFPS:        0.00
2017-06-17 20:40:16.877 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]:    AnalysisFPS:        15.00
2017-06-17 20:40:16.877 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]:    Height x Width:     1080 x 1920
2017-06-17 20:40:16.877 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: Update Monitor Properties
2017-06-17 20:40:16.901 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: URL='http://192.168.0.10:80/zm/api/monitors/1.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:16.901 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: onConnected(): Bridge - zoneminder:server:1214133b, Thing - zoneminder:monitor:1214133b:monitor-1, Thing Handler - org.openhab.binding.zoneminder.handler.ZoneMinderThingMonitorHandler@a9cc700
2017-06-17 20:40:16.901 [INFO ] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: Bridge 'zoneminder:server:1214133b' connected
2017-06-17 20:40:17.462 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]:    SourceType:         FFMPEG
2017-06-17 20:40:17.462 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]:    Format:             255
2017-06-17 20:40:17.462 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]:    AlarmFrameCount:    1
2017-06-17 20:40:17.462 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]:    AlarmMaxFPS:        0.00
2017-06-17 20:40:17.462 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]:    AnalysisFPS:        15.00
2017-06-17 20:40:17.462 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]:    Height x Width:     720 x 1280
2017-06-17 20:40:17.462 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: Update Monitor Properties
2017-06-17 20:40:17.494 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: URL='http://192.168.0.10:80/zm/api/monitors/2.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:17.494 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: onConnected(): Bridge - zoneminder:server:1214133b, Thing - zoneminder:monitor:1214133b:monitor-2, Thing Handler - org.openhab.binding.zoneminder.handler.ZoneMinderThingMonitorHandler@2a16ce0d
2017-06-17 20:40:17.494 [INFO ] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]: Bridge 'zoneminder:server:1214133b' connected
2017-06-17 20:40:18.072 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]:    SourceType:         FFMPEG
2017-06-17 20:40:18.072 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]:    Format:             255
2017-06-17 20:40:18.072 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]:    AlarmFrameCount:    1
2017-06-17 20:40:18.073 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]:    AlarmMaxFPS:        0.00
2017-06-17 20:40:18.073 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]:    AnalysisFPS:        15.00
2017-06-17 20:40:18.073 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]:    Height x Width:     720 x 1280
2017-06-17 20:40:18.073 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]: Update Monitor Properties
2017-06-17 20:40:18.103 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]: URL='http://192.168.0.10:80/zm/api/monitors/3.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:18.103 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: onConnected(): Bridge - zoneminder:server:1214133b, Thing - zoneminder:monitor:1214133b:monitor-3, Thing Handler - org.openhab.binding.zoneminder.handler.ZoneMinderThingMonitorHandler@275ea088
2017-06-17 20:40:18.610 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: ThingAvailability: Thing 'zoneminder:monitor:1214133b:monitor-1' has Bridge 'null' defined (Check PASSED)
2017-06-17 20:40:18.610 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: ThingAvailability: Bridge 'null' is ONLINE (Check PASSED)
2017-06-17 20:40:18.611 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: ThingAvailability: Thing 'zoneminder:monitor:1214133b:monitor-1' has valid configuration (Check PASSED)
2017-06-17 20:40:18.611 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: ThingAvailability: ZoneMinder Id for Thing 'zoneminder:monitor:1214133b:monitor-1' defined (Check PASSED)
2017-06-17 20:40:46.259 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: Running Refresh data task count='1', freq='30', max='30', interval='30', intervalLow='0'
2017-06-17 20:40:46.259 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: 'refreshDataRunnable()': (diskUsage='false')
2017-06-17 20:40:46.259 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: 'refreshThing()': Thing='zoneminder:server:1214133b'!
2017-06-17 20:40:46.293 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: URL='http://192.168.0.10:80/zm/api/host/getLoad.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:46.295 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: BridgeHandler.updateChannel(): Updating channel 'cpu-load' to state='2.5'
2017-06-17 20:40:46.296 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: BridgeHandler.updateChannel(): Updating channel 'disk-usage' to state='UNDEF'
2017-06-17 20:40:46.298 [DEBUG] [r.handler.ZoneMinderBaseThingHandler] - [MONITOR-1]: Performing refresh
2017-06-17 20:40:46.298 [DEBUG] [r.handler.ZoneMinderBaseThingHandler] - [MONITOR-1]: refreshThing(): Bridge 'zoneminder:monitor:1214133b:monitor-1' Found for Thing 'zoneminder:monitor:1214133b:monitor-1'!
2017-06-17 20:40:46.346 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: URL='http://192.168.0.10:80/zm/api/monitors/1.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:46.478 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:1/daemon:zmc.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:46.621 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:1/daemon:zma.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:46.760 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:1/daemon:zmf.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:46.775 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: Method 'refreshThing()' for Bridge zoneminder:server:1214133b failed for thing='zoneminder:monitor:1214133b:monitor-1' - Exception='null'
2017-06-17 20:40:46.776 [DEBUG] [r.handler.ZoneMinderBaseThingHandler] - [MONITOR-2]: Performing refresh
2017-06-17 20:40:46.776 [DEBUG] [r.handler.ZoneMinderBaseThingHandler] - [MONITOR-2]: refreshThing(): Bridge 'zoneminder:monitor:1214133b:monitor-2' Found for Thing 'zoneminder:monitor:1214133b:monitor-2'!
2017-06-17 20:40:46.805 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: URL='http://192.168.0.10:80/zm/api/monitors/2.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:46.956 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:2/daemon:zmc.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:47.100 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:2/daemon:zma.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:47.281 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:2/daemon:zmf.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:47.300 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: Method 'refreshThing()' for Bridge zoneminder:server:1214133b failed for thing='zoneminder:monitor:1214133b:monitor-2' - Exception='null'
2017-06-17 20:40:47.300 [DEBUG] [r.handler.ZoneMinderBaseThingHandler] - [MONITOR-3]: Performing refresh
2017-06-17 20:40:47.300 [DEBUG] [r.handler.ZoneMinderBaseThingHandler] - [MONITOR-3]: refreshThing(): Bridge 'zoneminder:monitor:1214133b:monitor-3' Found for Thing 'zoneminder:monitor:1214133b:monitor-3'!
2017-06-17 20:40:47.338 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]: URL='http://192.168.0.10:80/zm/api/monitors/3.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:47.474 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:3/daemon:zmc.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:47.606 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:3/daemon:zma.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:47.739 [DEBUG] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-3]: URL='http://192.168.0.10:80/zm/api/monitors/daemonStatus/id:3/daemon:zmf.json' ResponseCode='200' ResponseMessage='OK'
2017-06-17 20:40:47.753 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1214133b)]: Method 'refreshThing()' for Bridge zoneminder:server:1214133b failed for thing='zoneminder:monitor:1214133b:monitor-3' - Exception='null'

Looks just like mine, I just haven’t caught a debug of it!

Using the 7/1 snapshot I’m seeing better performance until this happens:

06:26:08.892 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'
06:26:10.328 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'
06:26:11.761 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'
06:26:13.237 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'
06:26:14.674 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'
06:26:16.409 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'
06:26:17.862 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'
06:26:19.291 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'
06:26:20.763 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:756ae518:monitor-1' - Exception='java.lang.NullPointerException'

Which seems to trigger sometimes when a command is sent to the Thing to change its state to Movies or Nodect (the only thing my rules do when someone comes up the driveway). The logs get full of this every two seconds and stopping/starting the bundle in karaf is the only way to fix it.

I am running the latest snapshot of OH2, and continue to get this error in the logs after the service runs for a few hours or a day:

2017-08-24 10:28:47.040 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:79ef0f49:monitor-1' - Exception='{}'
java.lang.NullPointerException: null
        at name.eskildsen.zoneminder.internal.ZoneMinderMonitorProxy.getMonitorDetailedStatus(ZoneMinderMonitorProxy.java:280) [217:org.openhab.binding.zoneminder:2.2.0.201708221733]
        at org.openhab.binding.zoneminder.handler.ZoneMinderThingMonitorHandler.onFetchData(ZoneMinderThingMonitorHandler.java:790) [217:org.openhab.binding.zoneminder:2.2.0.201708221733]
        at org.openhab.binding.zoneminder.handler.ZoneMinderBaseThingHandler.refreshThing(ZoneMinderBaseThingHandler.java:186) [217:org.openhab.binding.zoneminder:2.2.0.201708221733]
        at org.openhab.binding.zoneminder.handler.ZoneMinderServerBridgeHandler$3.run(ZoneMinderServerBridgeHandler.java:208) [217:org.openhab.binding.zoneminder:2.2.0.201708221733]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
        at java.lang.Thread.run(Thread.java:745) [?:?]

Any ideas on how to resolve this?

Honestly I just gave up on this binding. I’ll try it again if it gets fixed, for now I’ve just set zm to modect and just sort through the false positives

At this point, I’ve given up on this binding as well. Too bad too, because it could be powerful.

I switched to ispy when I switched to windows, works well with a simple http command