Zoneminder binding

Can yopu check your log to see if you have a line like this:

[MONITOR]: Configuration for Thing 'zoneminder:monitor:xxxxxx:monitor-1' is not loaded correctly.

The ‘xxxxxx’ should be changed toi the same id as your bridge?
I am quite sure that this is somethineg that appears when something isn’t started correctly. Somehow it seems like things can happend in a order so that it doesn’t work.

Nope, I really believe that your connection is stable. It is something in the binding that falsely indicates an unstable connection. If you take a look at the debug log all http calls is logged with returd code. I bet all of them returns 200 (=not wrong with your connection).I see somewhat the same problem, so I guess it is related to initialisation.

not seeing that in the log, I did notice this line though:

[MONITOR-1]: refreshThing(): Bridge 'zoneminder:monitor:756ae518:monitor-1' Found for Thing 'zoneminder:monitor:756ae518:monitor-1'!

is that a bad log message or does monitor-1 have itself as its own bridge?

Seems to be an error in the logmessage, if it isn’t an error message, you shouyldn’t worry :slight_smile:

This is really strange, My openHAB build i #929, I am having somewhat the same problems. I have now build a addon from sources and when running in debug env. there is no problems, when running the same addon in #929 I see problemjs. I will try to update to latest openHAB build. Hopefully that solves the problem.

I’m hesitant to update to the latest as a there seems to be a breaking change in the latest snapshot:

Thanks for notifying, would be a problem for me too,a s I am using Z-Wave :slight_smile:

I have updated to latest build and now it starts to connect (consistently) as expected. The strange thing though is that in console it is still reporting Build #929, so I am uncertain if the upgrade is done completely. Also Zwave seems to work, but haven’t testet in details…

The breaking change only impacts the development version of ZWave at this time, and hopefully in 30 minutes or so I’ll compile up a new one anyway…

I don’t restart openHAB very often, but when I do, the zoneminder binding often fails, giving me a series of messages like this:

2017-06-26 09:08:12.862 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [MONITOR]: Method 'refreshThing()' for Bridge failed for thing='zoneminder:monitor:zm:monitor-5' - Exception='java.lang.ClassCastException: org.openhab.binding.zoneminder.handler.ZoneMinderThingMonitorHandler cannot be cast to org.openhab.binding.zoneminder.handler.ZoneMinderBaseThingHandler'

The only solution I’ve found that works is to manually delete all the cameras and zoneminder server Things, restart openHAB, and then re-add them.

Anyone else seeing this?

Dan

1 Like

I’ve recently updated to the 7/1 snapshot and 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.

These refreshThing errors seem to happen any time the camera changes state on its own to. If the monitor is set to mocord, the errors start if a recording is triggered from zoneminder due to motion. Then the log is filled with these errors every 2 seconds

Thanks a lot for you observations, I haven’t had time to look at them due to vacation :-). I will try to find som time to look at the code with your observations in mind.

Hey Rich,
I was wondering about zoneminder / motion as well. This is what I ended up doing.

I have a VM running motioneye as my central box. Then I use a raspberry pi to be my remote camera.

I have motioneye do the motion detection even on the remote cameras and fires off motion detect scrips to openhab.

I am currently working on a newer version of the camera using a raspberry pi zero / POE / IR cut filter and IR leds.

1 Like

Hi @mr_eskildsen,

i’ve also got this wierd problem after upgrading to oh 2.2.0 build 1014 (online). Zoneminder Version is 1.30.4

I’ve set the main zm language to en_gb and also the language for the user to en_gb:


Username	Language	Enabled	Stream	Events	Control	Monitors	Groups	System	Bandwidth	
openhab	    en_gb	    Yes	    View	Edit	Edit	Edit	    Edit	Edit	High	 	

Reinstalled the binding multiple times, also restarted everything (oh and zm):

2017-08-16 21:55:23.849 [DEBUG] [er.internal.ZoneMinderHandlerFactory] - [FACTORY]: creating handler for bridge thing 'org.eclipse.smarthome.core.thing.internal.BridgeImpl@50184d2c'
2017-08-16 21:55:23.854 [INFO ] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1b289f14)]: Starting ZoneMinder Server Bridge Handler (Bridge='null')
2017-08-16 21:55:23.858 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE]: About to initialize bridge server
2017-08-16 21:55:23.860 [INFO ] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: ZoneMinder Server Bridge Handler Initialized
2017-08-16 21:55:23.863 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    HostName:           172.18.0.1
2017-08-16 21:55:23.864 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    Protocol:           http
2017-08-16 21:55:23.865 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    Port HTTP(S)        80
2017-08-16 21:55:23.866 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    Port Telnet         6802
2017-08-16 21:55:23.867 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    Server Path         /zm
2017-08-16 21:55:23.868 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    User:               openhab
2017-08-16 21:55:23.870 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    Refresh interval:   10
2017-08-16 21:55:23.871 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    Low  prio. refresh: 0
2017-08-16 21:55:23.872 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE:    Autodiscovery:      true
2017-08-16 21:55:23.873 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1b289f14)]: closeConnection(): Closed HTTP Connection!
2017-08-16 21:55:23.881 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE [1b289f14]: Starting ZoneMinder Bridge Monitor Task. Command='org.openhab.binding.zoneminder.handler.ZoneMinderServerBridgeHandler$1@611f9787
2017-08-16 21:55:26.001 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1b289f14)]: Exception occurred in updateAvailabilityStatus Exception='null'
2017-08-16 21:55:26.002 [INFO ] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1b289f14)]: Bridge status changed from 'OFFLINE' to 'OFFLINE'
2017-08-16 21:55:42.579 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1b289f14)]: Exception occurred in updateAvailabilityStatus Exception='null'
2017-08-16 21:55:59.163 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (1b289f14)]: Exception occurred in updateAvailabilityStatus Exception='null'

User could logon to Zoneminder without a problem:

Date/Time                  Component	PID	    Level	Message	                            File	                  Line
2017-08-16 22:00:55.928966	web_php		17895	INF	    Login successful for user "openhab"	/usr/share/zoneminder/www/includes/functions.php	53
2017-08-16 22:00:55.189667	web_php		17895	INF	    Login successful for user "openhab"	/usr/share/zoneminder/www/includes/functions.php	53

greetings,

W.G.

Thanks for your logs, seems like I have to do some debugging. Unfortunately I have been quite busy with other things lately, first of all a broken disk in my fileserver - ended with a large cleanup project…

Unfortunately, my ZM server goes from Running state to Stopped state if i do an Operating mode change from Modect to Monitor. I have to then login into ZM webserver, and change the ZM state from Stopped to ‘Start’.

Is it possible to change the ‘state’ of the ZM server in rule?

Here is a short log

2017-08-16 19:01:57.077 [ItemCommandEvent          ] - Item 'ZoneMinderMonitorLiving1_OperatingMode' received command Monitor
2017-08-16 19:01:57.080 [ItemStateChangedEvent     ] - ZoneMinderMonitorLiving1_OperatingMode changed from Modect to Monitor
2017-08-16 19:02:35.977 [hingStatusInfoChangedEvent] - 'zoneminder:server:daced488' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): ZoneMinder Server Daemon not running
2017-08-16 19:02:35.980 [hingStatusInfoChangedEvent] - 'zoneminder:monitor:daced488:monitor-2' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-08-16 19:02:35.987 [hingStatusInfoChangedEvent] - 'zoneminder:monitor:daced488:monitor-3' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-08-16 19:02:35.988 [hingStatusInfoChangedEvent] - 'zoneminder:monitor:daced488:monitor-1' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-08-16 19:02:53.202 [hingStatusInfoChangedEvent] - 'zoneminder:server:daced488' changed from OFFLINE (COMMUNICATION_ERROR): ZoneMinder Server Daemon not running to OFFLINE (CONFIGURATION_ERROR): ZoneMinder Server Daemon not running

Hi! Did you check the ZM log? Also the message log?

@mr_eskildsen: oh, doesn’t sound fun… hopefully you didn’t lost any important data! So good luck with fixing your server!

@whopperg, yes the logs do show that zmc has stopped working. It is some sort of race condition which cause zm to shutdown. Here are the details of it.