Problem with IP camera binding and Dahua cam

I tried the IP camera binding with my new Dahua camera. I have a (for my understanding) strange behaviour:

When the binding is active, it contacts the cam about every 8 seconds with a:
GET /cgi-bin/snapshot.cgi?channel=1 HTTP/1.1\r\n

This then makes the camera store a snapshot on the attached NAS, filling it up in a couple of days and messing up the whole storage.

Is there any way to stop this behavior? I mostly want to use the binding to start and stop motion alerts and to react on alerts generated by the cam. Being able to see a snapshot on Openhab is nice-to-have, but not important to me. But filling up the storage with bogus images, makes it, unfortunately, unusable for my use case.

Thanks for any help!


Btw, I tried entering an invalid URL on the “Snapshot URL” config item. The binding, however, still uses the correct URL it got from the Onvif discovery. :frowning:

Apparently nobody knows here. Would it make sense to post this question as a bug/enhancement report on github?

I would contact Dahua asking them to look into it as a bug in their firmware or if your doing something wrong in the cameras setup. Asking for a snapshot should not cause the camera to store files.

Yes that is on the todo list as it is not a simple change as 3 different areas get effected as would need changes to the code to handle this. One is that the binding needs to know if the camera has gone offline at any point so that the alarm stream can be restarted.

That is weird as it should over ride the hard coded url when you do that. I just tested it here and it works correctly, the binding will return the last stored jpg so it may appear to work, but it is not sending the right url anymore when you tell it a bad url. You can also enter in ‘ffmpeg’ and use your CPU and create snapshots from the RTSP feed.

You are probably right about the bug, but Dahua is not really a Consumer/Prosumer oriented company, so they don’t really seem to have a communication to end users.

Nonetheless, I don’t know, why the binding needs to ask fro snapshots just to see if the cam is still online. There is a nice python script here (h that uses the api to wait for alarm messages. It does not take any snapshots to do so, so this does not seem to be necessary.

Concerning the invalid URL, I will give another try. I entered something like “INVALID” or so. Maybe it requires a correctly formatted URL to be accepted?

I made the changes you are wanting in this thread, you can try the jar out now if you want. Just read what other changes were made in this thread and the jar link is there as well.

[ipcamera] Move to using port 8080 servlet not Netty. by Skinah · Pull Request #11160 · openhab/openhab-addons (