Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zoneminder] Motion detection is slow #3730

Closed
TheChrissi1 opened this issue Jul 12, 2018 · 5 comments
Closed

[zoneminder] Motion detection is slow #3730

TheChrissi1 opened this issue Jul 12, 2018 · 5 comments
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@TheChrissi1
Copy link

Hey,

I’ve installed Zoneminder on my Debian-System and got the Zoneminder Binding working in openHAB 2.3.

The problem that i have is that the EventState takes too long to change from OFF to ON.

My Camera is above my front door. So if I close the door (time 16:13:34.861) the system recognizes a motion about 6 seconds later Received forceAlarm (16:13:40.713). This would be fine, but the state of the EventState changes 18 seconds after I’ve closed the door (16:13:52.607). This works too slow for my project, because I created a rule that checks if a motion gets detected in case the lock on the door changes from OPEN to CLOSED.
I don’t want to wait for 18 seconds after I closed the door to lock my house. 6 Seconds would be totally fine.

So is there a way that the system sets the EventState faster? Or can I check the Received forceAlarm from Zoneminder? The motion gets detected fast enough from Zoneminder and technically also from openHAB.

16:12:43.312 [INFO ] [smarthome.event.ItemStateChangedEvent] - zmServer_CpuLoad changed from 3.12 to 3.11
16:13:30.891 [INFO ] [smarthome.event.ItemStateChangedEvent] - HAUSTUERREEDCONTACT changed from CLOSED to OPEN
16:13:34.861 [INFO ] [smarthome.event.ItemStateChangedEvent] - HAUSTUERREEDCONTACT changed from OPEN to CLOSED
16:13:40.713 [INFO ] [handler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: Received forceAlarm for monitor 2
16:13:40.721 [INFO ] [er.handler.ZoneMinderBaseThingHandler] - [MONITOR-2]: Starting High Priority Refresh
16:13:40.734 [INFO ] [handler.ZoneMinderThingMonitorHandler] - [MONITOR-2]: Received forceAlarm for monitor 2
16:13:40.748 [INFO ] [er.handler.ZoneMinderBaseThingHandler] - [MONITOR-2]: Starting High Priority Refresh
16:13:45.247 [INFO ] [smarthome.event.ItemStateChangedEvent] - zmServer_CpuLoad changed from 3.11 to 3.12
16:13:52.607 [INFO ] [smarthome.event.ItemStateChangedEvent] - zmMonitor1_EventState changed from OFF to ON
16:13:52.642 [INFO ] [arthome.model.script.zoneminder.rules] - Motion detected

zoneminder.things

Bridge zoneminder:server:ZoneMinder [ hostname="192.168.0.15", user="*****", password="*****", telnet_port=6802, refresh_interval_disk_usage=1 ]
{
	Thing monitor Eingang [ monitorId=2, monitorTriggerTimeout=120, monitorEventText="Trigger activated from openHAB" ]
}

zoneminder.items

Switch zmServer_Online 			"Zoneminder Online [%s]"			<switch>	{ channel="zoneminder:server:ZoneMinder:online" }
Number zmServer_CpuLoad 		"ZoneMinder Server Load [%s]"		<heating>		{ channel="zoneminder:server:ZoneMinder:cpu-load" }
Switch zmMonitor1_Online 		"Online [%s]" 				<switch>	{channel="zoneminder:monitor:ZoneMinder:Eingang:online"}
Switch zmMonitor1_Enabled 		"Enabled [%s]" 				<switch>	{channel="zoneminder:monitor:ZoneMinder:Eingang:enabled"}
Switch zmMonitor1_EventState 		"Motion [%s]"	 			<switch>	{channel="zoneminder:monitor:ZoneMinder:Eingang:alarm"}
@wborn
Copy link
Member

wborn commented Jul 13, 2018

There are performance improvements in https://github.com/openhab/openhab2-addons/pull/3583. Perhaps you can help @Mr-Eskildsen testing it?

@wborn wborn changed the title Zoneminder Motion Detection in openhab improvement [Zoneminder] Motion detection is slow Jul 14, 2018
@TheChrissi1
Copy link
Author

Thank you for the quick respone.
Since i'm running openHAB 2.3, i've installed zoneminder 2.3.0 Snapshot through the PaperUI.

Unfortunately this version does not seem to enable the detection motion faster.

@Mr-Eskildsen
Copy link

Mr-Eskildsen commented Jul 16, 2018

Your Zoneminder Server seems to be pretty loaded. Cpuload is over 3.
I don't know what kind of server you are using for ZoneMinder. It might need some more juice tro run smooth.

You should also consider how long time it takes in ZoneMinder before ZoneMinder reports motion. Typically ZoneMinder looks at a number of frames.

Another reason for the 18 seconds might be that the listener isn't working correct (You should be able to start a telnet on port 6902,), That could cause some problems.

My guess is that the cause is one of / or a combination:

  1. Slow hardware (image processing requires some processing power as well as memory)
  2. Config tweaking
    3 Config. problem

@TheChrissi1
Copy link
Author

Thank you for your help.

I've installed the .jar which you link in the #3583 post, because i realizied the 2.3.0 Version from the PaperUI did not have an Image channel, so i've found out it's not the same version.

I didn't test out the performance with the new version jet, but if i hit trigger the alarm in ZoneMinder it seems to work faster. I will run some more test to confirm this.

The other thing i've noticed is that the function channel is no longer avaliable. So i can't switch between Monitor and Motion through openHAB. Is it correct that way?

I'm running ZoneMinder Server in Virtualbox with 2 Processor and 4GB of RAM. Is not that enough?

At the moment one IP-Camera "Wansview W2" is connected over RTSP at 1080p@25fps.
Soon i would like to add a second one with the same settings.

I've activated the "OPT_TRIGGERS" option in ZoneMinder so that openHAB can recive the informations, so telnet on port 6902 should work right?!

@wborn wborn changed the title [Zoneminder] Motion detection is slow [zoneminder] Motion detection is slow Dec 20, 2018
@davidgraeff davidgraeff added the enhancement An enhancement or new feature for an existing add-on label Mar 18, 2019
@hmerk
Copy link
Contributor

hmerk commented Jul 25, 2021

closed due to inactivity

@hmerk hmerk closed this as completed Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

No branches or pull requests

5 participants