IpCamera: New IP Camera Binding

But that url was written by ArC not by me, I only quoted what he/she said.

I made some test yesterday, but I did not have a look on the log sorry, I have just see now your answer. This evening I will repeat it but:

I did not have a look on LOG. I will do this evening. But I do not see anything clear.

Is there other way to auto login?
Is this happening because my way of auth is DIGEST and I do not use it properly?

Thank you!

EDIT:

I have checked via SSH the logs, and the only warning I have is this (on openhab.log)…

2018-08-16 21:47:07.533 [ERROR] [.smarthome.model.script.actions.HTTP] - Fatal transport error: java.util.concurrent.ExecutionException: java.net.NoRouteToHostException: No route to host

on events.log there is no ERRORs reported.

Hi @matt1 I want to create static .things file for my Foscams. Is there any guide for this already?

@zacofunny
Yes on Github there are full things, items and sitemap examples with explanations on what to do, about half way down the page.
https://github.com/Skinah/IpCamera/blob/master/README.md
The only thing not covered there is the special URL for motion detection arming which you can search this thread for where it was discussed. Also if you drop the refresh rate too low or have multiple cameras you may get OOME which this thread has a fix listed in it for that as well. Two things for me to consolodate back into the readme. Any questions not covered in the readme just ask and I will update it.

@grhosso
Your errors are not from this binding. The openhab methods to my knowledge do not support DIGEST, If your camera uses DIGEST I suspect this binding is your only option to get a picture as that is exactly what the binding does for you, it auto enters the log in details for every transaction you make so you do not have to.

1 Like

Understood. I guess my camera use DIGEST. I will clarify with the Seller maybe they can tell me if is used DIGEST and afterthat I will implement something. I will keep on testing.

just to clarify, which BINDING you mean?? or you mean “Image Item” ?

Thank you for the help.

Please read post number 1 of this thread you are in right now, or the link to the readme in my last post :slight_smile:

ok, thanks

Just FYI. Basic authentication works for me in a D-Link DCS-932 in Safari, but not in Chrome. I will test in Safari the other camara I have, maybe is a Chomre configuration.

Quick question regarding this note
"NOTE: You need to ensure the 001 is replaced with the cameras UID which may look like “0A78687F” if you used PaperUI to add the camera. "

Does it really need to be an uid taken from Paper UI? Why is that?

No it can be any UNIQUE ID that you wish to use. I literally use 001 for mine, next camera is 002 and so on. If you do not use an ITEM file and use paperUI to create the camera, that is when you will need to swap in the ugly number in the sitemap files. Make sense? If you remove and add the camera again with paperUI, it will then be a new ID and has created a lot of work doing find and replace to fix. I just find the files easier.

ok it finally worked:

Thing ipcamera:FOSCAM:ad66a173 "camKitchen" @ "Cameras" [ IPADDRESS="192.168.1.111", PORT=988, PASSWORD="somepassword", USERNAME="openhab", POLL_CAMERA_MS=5000, IMAGE_UPDATE_EVENTS=1, ONVIF_MEDIA_PROFILE=0, ONVIF_PORT=888 ]
Thing ipcamera:FOSCAM:b48c0ada "camSalon" @ "Cameras" [ IPADDRESS="192.168.1.112", PORT=988, PASSWORD="somepassword", USERNAME="openhab", POLL_CAMERA_MS=5100, IMAGE_UPDATE_EVENTS=1, ONVIF_MEDIA_PROFILE=0, ONVIF_PORT=888 ]
Thing ipcamera:FOSCAM:969ef853 "camHall" @ "Cameras" [ IPADDRESS="192.168.1.113", PORT=988, PASSWORD="somepassword", USERNAME="openhab", POLL_CAMERA_MS=5200, IMAGE_UPDATE_EVENTS=1, ONVIF_MEDIA_PROFILE=0, ONVIF_PORT=888 ]
Thing ipcamera:FOSCAM:7106cd8e "camKidsroom" @ "Cameras" [ IPADDRESS="192.168.1.114", PORT=988, PASSWORD="somepassword", USERNAME="openhab", POLL_CAMERA_MS=5300, IMAGE_UPDATE_EVENTS=1, ONVIF_MEDIA_PROFILE=0, ONVIF_PORT=888 ]
Thing ipcamera:FOSCAM:4cfaab4f "camBedroom" @ "Cameras" [ IPADDRESS="192.168.1.115", PORT=988, PASSWORD="somepassword", USERNAME="openhab", POLL_CAMERA_MS=5400, IMAGE_UPDATE_EVENTS=1, ONVIF_MEDIA_PROFILE=0, ONVIF_PORT=888 ]

I’m getting the following error:

[ing.saaj.soap.ver1_2.SOAPPart1_2Impl] - SAAJ0415: InputStream does not represent a valid SOAP 1.2 Message

This is just after:

[INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.1.111:888
[INFO ] [ing.ipcamera.handler.IpCameraHandler] - Finished with PTZ with no errors, now fetching the Video URL for RTSP from the camera.

Hi,
I just installed this addon. Configured it without any problems and all seems to work fine. Thanks for all the effort that has been put into this!. However, my openhab log file is filled with errors that seem to start whenever I open the image on the openhab app (android )

Any idea what is causing this?

rg.glassfish.jersey.server.internal.process.MappableException: org.eclipse.jetty.io.EofException at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:92) [170:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) [169:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130) [169:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711) [170:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444) [170:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434) [170:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329) [170:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [169:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [169:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [169:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [169:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [169:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [169:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [170:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [170:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [167:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [167:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [167:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [167:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [167:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [15:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [85:org.eclipse.jetty.servlet:9.3.21.v20170918] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [85:org.eclipse.jetty.servlet:9.3.21.v20170918] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [82:org.eclipse.jetty.security:9.3.21.v20170918] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [85:org.eclipse.jetty.servlet:9.3.21.v20170918] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.eclipse.jetty.server.Server.handle(Server.java:534) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [84:org.eclipse.jetty.server:9.3.21.v20170918] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [87:org.eclipse.jetty.util:9.3.21.v20170918] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [87:org.eclipse.jetty.util:9.3.21.v20170918] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [87:org.eclipse.jetty.util:9.3.21.v20170918] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [87:org.eclipse.jetty.util:9.3.21.v20170918] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [87:org.eclipse.jetty.util:9.3.21.v20170918] at java.lang.Thread.run(Thread.java:745) [?:?] Caused by: org.eclipse.jetty.io.EofException at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:199) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:420) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.WriteFlusher.completeWrite(WriteFlusher.java:375) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.SelectChannelEndPoint$3.run(SelectChannelEndPoint.java:107) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.SelectChannelEndPoint.onSelected(SelectChannelEndPoint.java:193) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.processSelected(ManagedSelector.java:283) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.produce(ManagedSelector.java:181) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:249) ~[87:org.eclipse.jetty.util:9.3.21.v20170918] ... 5 more Caused by: java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[?:?] at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) ~[?:?] at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[?:?] at sun.nio.ch.IOUtil.write(IOUtil.java:65) ~[?:?] at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) ~[?:?] at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:177) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:420) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.WriteFlusher.completeWrite(WriteFlusher.java:375) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.SelectChannelEndPoint$3.run(SelectChannelEndPoint.java:107) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.SelectChannelEndPoint.onSelected(SelectChannelEndPoint.java:193) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.processSelected(ManagedSelector.java:283) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.produce(ManagedSelector.java:181) ~[76:org.eclipse.jetty.io:9.3.21.v20170918] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:249) ~[87:org.eclipse.jetty.util:9.3.21.v20170918] ... 5 more

@zacofunny
The soap errors are usually caused by the camera either not supporting a particular ONVIF method or may take too long to reply or something like that. For cameras with an API the binding already knows where to get the snapshot and video streams from so just ignore it. Looks like the camera does not return a RTSP url if that is the line directly before the error. A trick I use is for any camera that does not have PTZ features I give it the wrong onvif port number as the camera connects quicker without going through the onvif code.
Very interested to hear how your camera setup goes with 5 cameras and I note you have given different refresh times to spread the load? did you find that needed to be done to solve an issue?

@bartsnijder
I may have seen an error like that and it appears to occur for me only when I have the app open to the cameras picture and I save a config file causing parts of openhab to restart possibly in the middle of displaying/updating the picture. Because I ignore and it is very rare it I cant be sure it is exactly the same. To fault find this please turn on TRACE log output (see first post of this thread for how, or the readme) and look for the following info. Some output from the log when it is fetching the snapshot would be great as I can see what is happening then… I would be looking for this kind of info from the logs as I have a theory…

  1. HTTP1.0 in the headers of the replies.
  2. POssibly a message saying the camera does not give a content length
  3. It will tell you what size the snapshot being given to openhab is, interested in what size is reported.

I can take a look at adding a fix after I get the log output as I can then emmulate what your camera is doing to see if I can reproduce.

Matt1,

concerning the intrusion detection:
I took a look at the xxx.xx.x.x/ISAPI/Event/triggers and I have a fielddetection in there, could this be the intrusion detection (there is no intrussion detection in /Events/triggers)

<EventTrigger>
<id>fielddetection-1</id>
<eventType>fielddetection</eventType>
<eventDescription>fielddetection Event trigger Information</eventDescription>
<videoInputChannelID>1</videoInputChannelID>
<dynVideoInputChannelID>1</dynVideoInputChannelID>
<EventTriggerNotificationList>
<EventTriggerNotification>
<id>IO-1</id>
<notificationMethod>IO</notificationMethod>
<notificationRecurrence>beginning</notificationRecurrence>
<outputIOPortID>1</outputIOPortID>
</EventTriggerNotification>
<EventTriggerNotification>
<id>email</id>
<notificationMethod>email</notificationMethod>
<notificationRecurrence>beginning</notificationRecurrence>
</EventTriggerNotification>
<EventTriggerNotification>
<id>record-1</id>
<notificationMethod>record</notificationMethod>
<videoInputID>1</videoInputID>
<notificationRecurrence>beginning</notificationRecurrence>
</EventTriggerNotification>
<EventTriggerNotification>
<id>center</id>
<notificationMethod>center</notificationMethod>
<notificationRecurrence>beginning</notificationRecurrence>
</EventTriggerNotification>
<EventTriggerNotification>
<id>FTP</id>
<notificationMethod>FTP</notificationMethod>
<notificationRecurrence>beginning</notificationRecurrence>
</EventTriggerNotification>
</EventTriggerNotificationList>
</EventTrigger>

When I look at http://192.168.0.64/ISAPI/Event/notification/alertStream and trigger the intrusion alarm, I get:

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.0.64</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>64:db:8b:34:2e:42</macAddress>
<channelID>1</channelID>
<dateTime>2018-08-20T11:29:19+01:00</dateTime>
<activePostCount>1</activePostCount>
<eventType>fielddetection</eventType>
<eventState>active</eventState>
<eventDescription>fielddetection alarm</eventDescription>
<DetectionRegionList>
<DetectionRegionEntry>
<regionID>1</regionID>
<sensitivityLevel>80</sensitivityLevel>
<RegionCoordinatesList>
<RegionCoordinates>
<positionX>139</positionX>
<positionY>274</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>415</positionX>
<positionY>229</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>636</positionX>
<positionY>965</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>222</positionX>
<positionY>969</positionY>
</RegionCoordinates>
</RegionCoordinatesList>
</DetectionRegionEntry>
</DetectionRegionList>
<channelName>Camera Inkom</channelName>
</EventNotificationAlert>
--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 1137

@matt1

I believe you are using only the basic motion detection on hikvision. I took the liberty to look at IpCameraHandler.java at GitHub. At line 1315 it says:

/ISAPI/System/Video/inputs/channels/" + nvrChannel + "01/motionDetection

this results in : http://192.168.0.64/ISAPI/System/Video/inputs/channels/101/motionDetection
I am not using the basic motion detection and the sensitivity is set to

<sensitivityLevel>0</sensitivityLevel>

In the hikvision API, there is also: 8.4.17 /ISAPI/System/Video/inputs/channels//motionDetectionExt
For me this is : http://192.168.0.64/ISAPI/System/Video/inputs/channels/1/motionDetectionExt/

When I enable the motion alarm through Habpanel the first part results in this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<MotionDetectionExt xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<enabled>true</enabled>
<samplingInterval>2</samplingInterval>
<startTriggerTime>500</startTriggerTime>
<endTriggerTime>500</endTriggerTime>
<minObjectSize>0</minObjectSize>
<maxObjectSize>100</maxObjectSize>
<ROI>
<minHorizontalResolution>1000</minHorizontalResolution>
<maxHorizontalResolution>1000</maxHorizontalResolution>
</ROI>
<enableHighlight>true</enableHighlight>
<MotionDetectionSwitch xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<type>auto</type>
<Schedule>
<scheduleType>day</scheduleType>
<TimeRange>
<beginTime>06:00:00</beginTime>
<endTime>18:00:00</endTime>
</TimeRange>
</Schedule>
</MotionDetectionSwitch>
<activeMode>normal</activeMode>
<MotionDetectionRegionList size="0">

When I enable the motion alarm through the webbased config of the camera, the fisrt part gives me:

<?xml version="1.0" encoding="ISO-8859-1"?>
<MotionDetectionExt xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<enabled>true</enabled>
<samplingInterval>2</samplingInterval>
<startTriggerTime>500</startTriggerTime>
<endTriggerTime>500</endTriggerTime>
<minObjectSize>0</minObjectSize>
<maxObjectSize>100</maxObjectSize>
<ROI>
<minHorizontalResolution>1000</minHorizontalResolution>
<maxHorizontalResolution>1000</maxHorizontalResolution>
</ROI>
<enableHighlight>true</enableHighlight>
<MotionDetectionSwitch xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<type>auto</type>
<Schedule>
<scheduleType>day</scheduleType>
<TimeRange>
<beginTime>06:00:00</beginTime>
<endTime>18:00:00</endTime>
</TimeRange>
</Schedule>
</MotionDetectionSwitch>
<activeMode>expert</activeMode>
<MotionDetectionRegionList size="0">

would it be possible to impliment the expert mode motion detection in the binding if the Hikvision camera supports expert mode?

No, that is a different alarm, please use google to search this kind of thing.

Yes I have implemented the basic motion detection as well as some of the advanced methods like LINE CROSSING and also the PIR. The line crossing in particular gets many positive reviews as having less false positives. Also your post does not make sense, the URL you posted is for an AUDIO DETECTION alarm and nothing to do with movement.

Sure, if you test it up front in a browser and confirm it works and provide the output for the alertstream (like you did for PIR) it does not take long to add another alarm if someone needs it. The main thing to check first is that it actually shows up when triggered when displaying the output of alertStream in a browser.
http://192.168.0.64/ISAPI/Event/notification/alertStream
I am not keen on adding too many alarms until I write the framework to stop polling alarms that the camera does not have and auto add and remove the Openhab channels.

@matt1,

I should have put line 1315 of the IpCameraHandler.java. I have updated my post.

When I enable the motion alarm through the webbased config if the hikvision camera and trigger it, the http://192.168.0.64/ISAPI/Event/notification/alertStream says:

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.0.64</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>64:db:8b:34:2e:42</macAddress>
<channelID>1</channelID>
<dateTime>2018-08-20T12:15:12+01:00</dateTime>
<activePostCount>1</activePostCount>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>Motion alarm</eventDescription>
<DetectionRegionList>
</DetectionRegionList>
<channelName>Camera Inkom</channelName>
</EventNotificationAlert>
--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 557

When I trigger the intrussion alarm, I get:

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.0.64</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>64:db:8b:34:2e:42</macAddress>
<channelID>1</channelID>
<dateTime>2018-08-20T12:21:48+01:00</dateTime>
<activePostCount>1</activePostCount>
<eventType>fielddetection</eventType>
<eventState>active</eventState>
<eventDescription>fielddetection alarm</eventDescription>
<DetectionRegionList>
<DetectionRegionEntry>
<regionID>1</regionID>
<sensitivityLevel>80</sensitivityLevel>
<RegionCoordinatesList>
<RegionCoordinates>
<positionX>139</positionX>
<positionY>274</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>415</positionX>
<positionY>229</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>636</positionX>
<positionY>965</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>222</positionX>
<positionY>969</positionY>
</RegionCoordinates>
</RegionCoordinatesList>
</DetectionRegionEntry>
</DetectionRegionList>
<channelName>Camera Inkom</channelName>
</EventNotificationAlert>
--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 1137

Thanks that is all the info I need to add that alarm. In the middle of some changes so can not do a build until I get it back together and testing fine.

Hi. Trying to get the binding to work with a Dahua camera.

Here’s a log dump:

2018-08-22 12:42:42.645 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-22 12:42:42.648 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have re-opened  the closed channel:1 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-22 12:42:42.651 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.14.229, 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-22 12:42:42.660 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 4 channels tracked (some of these may be closed).

2018-08-22 12:42:42.667 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-22 12:42:42.670 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have re-opened  the closed channel:2 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-22 12:42:43.009 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: text/plain;charset=utf-8

CONNECTION: close

CONTENT-LENGTH: 0

2018-08-22 12:42:43.013 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-22 12:42:43.017 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Packet back from camera is not matching HttpContent DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: text/plain;charset=utf-8

CONNECTION: close

CONTENT-LENGTH: 0

2018-08-22 12:42:43.021 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent

2018-08-22 12:42:43.027 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-22 12:42:43.030 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-22 12:42:43.052 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: text/plain;charset=utf-8

CONNECTION: close

CONTENT-LENGTH: 0

2018-08-22 12:42:43.055 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:2 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-22 12:42:43.058 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Packet back from camera is not matching HttpContent DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: text/plain;charset=utf-8

CONNECTION: close

CONTENT-LENGTH: 0

2018-08-22 12:42:43.061 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent

2018-08-22 12:42:43.068 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:2 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-22 12:42:43.071 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

This will repeat over and over again.

I found an API reference in this thread: https://ipcamtalk.com/threads/ipc-hdb4300c-http-api-get-current-alarm-state.6988/ that would suggest the URL for video motion would be /cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect.

Testing both URLs, the /cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion in the logs returns a blank document. /cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect, however, returns the following:

table.MotionDetect[0].Enable=true
table.MotionDetect[0].EventHandler.AlarmOut=1
table.MotionDetect[0].EventHandler.AlarmOutChannels[0]=0
table.MotionDetect[0].EventHandler.AlarmOutEnable=true
table.MotionDetect[0].EventHandler.AlarmOutLatch=10
table.MotionDetect[0].EventHandler.BeepEnable=false
table.MotionDetect[0].EventHandler.Dejitter=5
table.MotionDetect[0].EventHandler.Delay=0
table.MotionDetect[0].EventHandler.ExAlarmOut=1
table.MotionDetect[0].EventHandler.ExAlarmOutChannels[0]=0
table.MotionDetect[0].EventHandler.ExAlarmOutEnable=false
table.MotionDetect[0].EventHandler.FlashEnable=false
table.MotionDetect[0].EventHandler.FlashLatch=10
table.MotionDetect[0].EventHandler.LogEnable=true
table.MotionDetect[0].EventHandler.MMSEnable=false
table.MotionDetect[0].EventHandler.MailEnable=false
table.MotionDetect[0].EventHandler.Matrix=1
table.MotionDetect[0].EventHandler.MatrixChannels[0]=0
table.MotionDetect[0].EventHandler.MatrixEnable=false
table.MotionDetect[0].EventHandler.MessageEnable=false
table.MotionDetect[0].EventHandler.PtzLink[0][0]=None
table.MotionDetect[0].EventHandler.PtzLink[0][1]=1
table.MotionDetect[0].EventHandler.PtzLinkEnable=false
table.MotionDetect[0].EventHandler.Record=1
table.MotionDetect[0].EventHandler.RecordChannels[0]=0
table.MotionDetect[0].EventHandler.RecordEnable=true
table.MotionDetect[0].EventHandler.RecordLatch=10
table.MotionDetect[0].EventHandler.Snapshot=1
table.MotionDetect[0].EventHandler.SnapshotChannels[0]=0
table.MotionDetect[0].EventHandler.SnapshotEnable=false
table.MotionDetect[0].EventHandler.TimeSection[0][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TipEnable=false
table.MotionDetect[0].EventHandler.Tour=1
table.MotionDetect[0].EventHandler.TourChannels[0]=0
table.MotionDetect[0].EventHandler.TourEnable=false
table.MotionDetect[0].EventHandler.VoiceEnable=false
table.MotionDetect[0].Level=3
table.MotionDetect[0].MotionDetectWindow[0].Id=0
table.MotionDetect[0].MotionDetectWindow[0].Name=Region1
table.MotionDetect[0].MotionDetectWindow[0].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[0].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[0].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[0].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[0].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[0].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[0].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[0].Region[7]=262143
table.MotionDetect[0].MotionDetectWindow[0].Region[8]=262143
table.MotionDetect[0].MotionDetectWindow[0].Region[9]=262143
table.MotionDetect[0].MotionDetectWindow[0].Region[10]=262143
table.MotionDetect[0].MotionDetectWindow[0].Region[11]=524287
table.MotionDetect[0].MotionDetectWindow[0].Region[12]=524287
table.MotionDetect[0].MotionDetectWindow[0].Region[13]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[14]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[15]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[16]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[17]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Sensitive=67
table.MotionDetect[0].MotionDetectWindow[0].Threshold=15
table.MotionDetect[0].MotionDetectWindow[0].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[0].Window[1]=3185
table.MotionDetect[0].MotionDetectWindow[0].Window[2]=8191
table.MotionDetect[0].MotionDetectWindow[0].Window[3]=8191
table.MotionDetect[0].MotionDetectWindow[1].Id=1
table.MotionDetect[0].MotionDetectWindow[1].Name=Region2
table.MotionDetect[0].MotionDetectWindow[1].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[1].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[1].Threshold=5
table.MotionDetect[0].MotionDetectWindow[1].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[3]=0
table.MotionDetect[0].MotionDetectWindow[2].Id=2
table.MotionDetect[0].MotionDetectWindow[2].Name=Region3
table.MotionDetect[0].MotionDetectWindow[2].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[2].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[2].Threshold=5
table.MotionDetect[0].MotionDetectWindow[2].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Id=3
table.MotionDetect[0].MotionDetectWindow[3].Name=Region4
table.MotionDetect[0].MotionDetectWindow[3].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[3].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[3].Threshold=5
table.MotionDetect[0].MotionDetectWindow[3].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[3]=0
table.MotionDetect[0].PirMotionLevel=3
table.MotionDetect[0].Region[0]=0
table.MotionDetect[0].Region[1]=0
table.MotionDetect[0].Region[2]=0
table.MotionDetect[0].Region[3]=0
table.MotionDetect[0].Region[4]=0
table.MotionDetect[0].Region[5]=0
table.MotionDetect[0].Region[6]=0
table.MotionDetect[0].Region[7]=4194288
table.MotionDetect[0].Region[8]=4194288
table.MotionDetect[0].Region[9]=4194288
table.MotionDetect[0].Region[10]=4194288
table.MotionDetect[0].Region[11]=4194296
table.MotionDetect[0].Region[12]=4194296
table.MotionDetect[0].Region[13]=4194303
table.MotionDetect[0].Region[14]=4194303
table.MotionDetect[0].Region[15]=4194303
table.MotionDetect[0].Region[16]=4194303
table.MotionDetect[0].Region[17]=4194303

Hopefully some of that helps.

Thanks.

@brad
Yes that is helpful thanks, but can you post what model you have and if you have the latest firmware? Also what is the symptom? ie do you get the alarms detecting and showing, only the enable and disable control is not updating?

The method the binding uses to see the Alarms is actually a stream that should stay open and the binding does not Poll for the alarms.

/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0] 

Can you test that in a browser please as I can see a few possible problems…

  1. If your camera does not support an alarm, remove it from the URL and try again as it may stop it working if the camera does not support all 5 of the alarms in that link.
  2. Check the channel matches the channel of your NVR if you have one. It is 0 for stand alone cameras.
  3. You may need to add MotionDetect to that URL in a browser to then see the alarm tripping in the stream.

If you can let me know I can make the change. It will be great to have Dahua finally checked over and confirmed as working as I have not had a user report back fully on all functions.

I get yesterday new cam Dahua IPC-HFW4431R-Z this si china version which can’t be updated after first checking Motion detection on/off is working. Status of motion detection not working , Zoom is not working.
I will collect logs this evening to share more detailes . Face detection i need to investigate too.

Camera is an IPC-HDW2100. They are a little bit older than current generation. I tested with both firmware 2.420.0.0 (the most current I could locate) and then downgraded (due to a different issue) to 2.212.1.0 with similar results. The only different was that the /cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion URL returned “error” in 2.212.1.0 versus a 0 byte response in 2.420.0.0

When initially running the binding, I observed that I was able to use enableMotionAlarm to turn the motion detect event on and off in the camera settings. However, with it set on, I was not receiving any motion events within openHAB. I see that the motion events are being logging in the camera logs – they just don’t seem to flow to OH.

That’s great that it’s listening to the event stream and not polling. The event stream behaved as expect and returned the following with motion at the camera:

-- myboundary
Content-Type: text/plain
Content-Length:37
Code=VideoMotion;action=Start;index=0

-- myboundary
Content-Type: text/plain
Content-Length:37
Code=VideoMotion;action=Start;index=0

-- myboundary
Content-Type: text/plain
Content-Length:36
Code=VideoMotion;action=Stop;index=0

It was not necessary to remove any of the alarm codes to get the VideoMotion event, even though the camera does not support some of them.

Checking back with openHAB logs, there’s still no VideoMotion event. Only the same repeating config messages from before:

2018-08-23 10:27:30.221 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.14.229, 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-23 10:27:30.229 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 6 channels tracked (some of these may be closed).

2018-08-23 10:27:30.236 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-23 10:27:30.239 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have re-opened  the closed channel:1 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-23 10:27:30.242 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.14.229, 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-23 10:27:30.251 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 6 channels tracked (some of these may be closed).

2018-08-23 10:27:30.259 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-23 10:27:30.264 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have re-opened  the closed channel:2 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-23 10:27:30.632 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

2018-08-23 10:27:30.635 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:2 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-23 10:27:30.639 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Packet back from camera is not matching HttpContent DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

2018-08-23 10:27:30.642 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 6, cap: 6/6, unwrapped: PooledUnsafeDirectByteBuf(ridx: 103, widx: 103, cap: 1024)), decoderResult: success)

2018-08-23 10:27:30.645 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:Error

2018-08-23 10:27:30.704 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:2 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-23 10:27:30.707 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection

2018-08-23 10:27:30.726 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

2018-08-23 10:27:30.729 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-23 10:27:30.733 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Packet back from camera is not matching HttpContent DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

2018-08-23 10:27:30.736 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 6, cap: 6/6, unwrapped: PooledUnsafeDirectByteBuf(ridx: 103, widx: 103, cap: 1024)), decoderResult: success)

2018-08-23 10:27:30.739 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:Error

2018-08-23 10:27:30.744 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion

2018-08-23 10:27:30.746 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion