No problem, I am pretty sure I have found something. I am testing right now, hopefully I have something that I can share soon.
I have found a couple of things that at least solves the problem that a monitor couldnāt come ONLINE before it had at least one event. Since the code change handles soem general issues when changing from offline to online it might (hopefully) also solve other problems.
https://github.com/openhab/openhab2-addons/files/794746/org.openhab.binding.zoneminder-2.1.0-SNAPSHOT.zip
Remember to uninstall the previous binding from karaf console and also restart openHAB afterwards
ah - that would explain why at one point I constantly had problems with one of my four cameras, identical in setup to the others. That camera at that time had zero eventsā¦
Iām sorry but itās not working on my side ,
i correctly uninstalled the previous binding , things, restart OH2 , install the new one, restart again OH2. and i have the same issue :
However , iām using an offline version and in karaf console i have after restart :
before restarting openhab i only have 1 binding which is the one i download from your link.;
openhab> bundle:list | grep ZoneMinder
225 | Active | 80 | 2.1.0.201702222036 | ZoneMinder Binding
227 | Installed | 80 | 2.1.0.201702202246 | ZoneMinder Binding
The right one is the first which is active.
could it be a problem?
2017-02-23 09:13:05.739 [INFO ] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (c858972e)]: Stopping refresh data task
2017-02-23 09:13:05.753 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE]: About to initialize bridge server
2017-02-23 09:13:05.755 [INFO ] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: ZoneMinder Server Bridge Handler Initialized
2017-02-23 09:13:05.757 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: HostName: 192.168.88.4
2017-02-23 09:13:05.758 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: Protocol: http
2017-02-23 09:13:05.759 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: Port HTTP(S) 80
2017-02-23 09:13:05.762 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: Port Telnet 6802
2017-02-23 09:13:05.763 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: Server Path /zm
2017-02-23 09:13:05.765 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: User: openhab
2017-02-23 09:13:05.767 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: Refresh interval: 10
2017-02-23 09:13:05.769 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: Low prio. refresh: 0
2017-02-23 09:13:05.772 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: Autodiscovery: true
2017-02-23 09:13:05.774 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (c858972e)]: closeConnection(): Closed HTTP Connection!
2017-02-23 09:13:05.788 [DEBUG] [andler.ZoneMinderServerBridgeHandler] - BRIDGE [c858972e]: Starting ZoneMinder Bridge Monitor Task. Command='org.openhab.binding.zoneminder.handler.ZoneMinderServerBridgeHandler$1@1c8921eā
2017-02-23 09:13:09.509 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (c858972e)]: Exception occurred in updateAvailabilityStatus Exception='nullā
2017-02-23 09:13:09.510 [INFO ] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (c858972e)]: Bridge status changed from āOFFLINEā to 'OFFLINEā
2017-02-23 09:13:28.309 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (c858972e)]: Exception occurred in updateAvailabilityStatus Exception='nullā
2017-02-23 09:13:47.097 [ERROR] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (c858972e)]: Exception occurred in updateAvailabilityStatus Exception=ānullā
That is the problem. the build date seems to be later in the last, which also gives sense accordingly to the binding Id (higher id = installed later)
You have to uninstall the oldest and restart openHAB
It is something like:
bundle:uninstall 225
what i donāt understand is ,
I have the offline snapshot to its latest version.
I uninstalled binding through Karaf console.
I put your jar in my addons folder.
Restart OH2
Then i had these 2 bindings.
I thought the timestamp was the one of the jar buildā¦
Now i just removed ALL Zoneminder Bindings.
Did a grep and no ZoneMinder listed,
Added the jar in addons folder
Did a new grep and the result was :
openhab> bundle:list | grep ZoneMinder
openhab> bundle:list | grep ZoneMinder
230 | Active | 80 | 2.1.0.201702222036 | ZoneMinder Binding
openhab> Connection to localhost closed by remote host.
Connection to localhost closed.
Now i restarted OH2 then i have now only :
openhab> bundle:list | grep ZoneMinder
230 | Resolved | 80 | 2.1.0.201702222036 | ZoneMinder Binding
i started it :
openhab> bundle:start 230
openhab> bundle:list | grep ZoneMinder
230 | Active | 80 | 2.1.0.201702222036 | ZoneMinder Binding
created a bridge with a .thing file which content is :
Bridge zoneminder:server:ZoneMinderSample [ hostname=ā192.168.88.4ā, user=āopenhabā, password=āopenhabā, telnet_port=6802, refresh_interval_disk_usage=1 ]
{
Thing monitor monitor_2 [ monitorId=2, monitorTriggerTimeout=120, monitorEventText=āTrigger activated from OpenHABā ]
}
but i still have the problem
I have seen similar strange behaviour, especially if the uninstall of the previous binding is unsuccessfull. to me it looks like openHAB has a effective cache. You should be sure that the zoneminder binding is not mentioned in your service config file (I guess it is updated automatically when installing).
I suggest that you:
- Stop openHAB
- Delete cache folder in userdata
- Make sure ZoneMinder Binding is in Addon folder
- Start openHAB
- Wait while other stuff is loaded from remote repo
- Verify that only one instance of the binding is installed
I have had success with that approach previously, though it takes a litle while to reload things.
I just did it without any success, I will try tomorrow on a VM to do a fresh install and put my config to see if itās the same problem or not.
Iāve tested the precise scenario you mention, and it is repeatable:
-
system works fine
-
put zoneminder offline (e.g. because I reboot the zoneminder PC)
-
Any camera with zero events will then fail with errors like:
[ERROR] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (zm)]: Method ārefreshThing()ā for Bridge zoneminder:server:zm failed for thing=āzoneminder:monitor:zm:monitor-3ā - Exception=ānullā -
If I trigger an event for monitor-3 then the errors stop, and all works perfectly once more
Dan
The latest build published in the github thread does fix this issue. I havenāt done the PR yet. I am trying to bundle things. But since I havnāt heard about new issues the last two weeks, I will prioritize the PR.
Cool
working perfectly for me tooā¦
I have created a pull request with the changes, so that they eventually wil end in the distribution
Thanks again for a fantastic binding
One quick point on the ZM binding included with the latest OH snapshot. I get repeated log messages that the bridge status has changed from āonlineā to āonlineā.
Otherwise working perfectly!
Dan
I just installed this binding a couple of days ago and am liking it, I can now trigger my cameras to āRecordā without scripts etc. I am seeing a problem in reading properties from ZM. I turned debugging on and get the following in my log:
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'
Iāve got the online, enabled and function channels linked to items but as you can see they never get updated
What build of openHAB are you using?
What version of ZoneMinder are you using?
Does the monitor appear Online or Offline in PaperUI?
Is it all monitor channels that isnāt updated?
I just checked the code, and as far as I can see, there isnāt send any particular log message when changing a value. But every change of value should be ādocumentedā in the event log file. That is done automatically from the framework. Please check that file as well, to see whatever comes from zoneminder.
Iām using snapshot build #947 of OH2,
Zoneminder is on version 1.29.0.
All 3 monitors show as Online in PaperUI
It looks like all monitor channels are not-updated
Hmmmmmm, weird. I am having some issues as well. I am not sure what it is exactly.I have (unfortunately) changed a lot in my setup (network components, zoneminder updated to newest version (1.30.4) and some other things. I am trying to debug things, but canāt really figure out what is going on (eg. canāt reproduce my problems in debug)