IpCamera: New IP Camera Binding

Will Onvif enabled cams get detected by name or by protocol (onvif) ?

Dahua cameras should get detected as ā€˜dahuaā€™ thing type.
If you have a camera like Reolink that is not an API camera listed by the binding it should get then detected as onvif thing type.

In the newest binding, the moment you add the auto detected camera, it should take you to the page for user/pass and serverPort. After giving it those 3 things the camera will be online if all went well.

1 Like

Hy matt, thx for this longs and greats works.

Iā€™ve got a problem with my foscam FI9826p V2 itā€™s an ONVIF devices and i canā€™t manage PTZ to work correctly. at the beginning (one year ago) with an older version of your binding PTZ worked but nowā€¦
i use the lattest version of the binding et openhab 2.5.8.1, everything works great except PTZ, automatic discovery working good too
here are my log

2020-09-08 22:42:09.829 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - End of FOSCAM handler reached, so closing the channel to the camera now
2020-09-08 22:42:17.442 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.41/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXX&pwd=XXXXX
2020-09-08 22:42:17.734 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:<CGI_Result>
<result>0</result>
<IOAlarm>0</IOAlarm>
<motionDetectAlarm>1</motionDetectAlarm>
<soundAlarm>0</soundAlarm>
<record>0</record>
<sdState>0</sdState>
<sdFreeSpace>0k</sdFreeSpace>
<sdTotalSpace>0k</sdTotalSpace>
<ntpState>1</ntpState>
<ddnsState>0</ddnsState>
<url>http%3A%2F%2Fhe4516.myfoscam.org%3A4143</url>
<upnpState>0</upnpState>
<isWifiConnected>1</isWifiConnected>
<wifiConnectedAP>Livebox-7166</wifiConnectedAP>
<infraLedState>0</infraLedState>
</CGI_Result>

Thx for your attention

I changed to using my own implementation of onvif recently to gain onvif events and make more possible. To fault find and possibly fix your issue I will need trace log when the camera is connecting where it does a onvif hand shake talking back and forth to look into it. Change a config that does not matter for the camera and it will reconnect and create the logs I need or restart the binding/openhab. Feel free to PM this to me to keep it out of the forum.

will HIKvision also detected ?

Yes mine does. I have tested with 3 models from completely different brands and they all work here. If you have any ONVIF camera that does not, then I just need some trace log when the camera does a hand shake.

Hi, maybe, this helps you:

I had simmilar problem with other Foscam camera - R4M. It hasnā€™t worked PTZ. First, Iā€™ve checked response from the camera and Iā€™ve noticed I havenā€™t got the XAddr but in the response I had something like this:

<tt:PTZ xsi:type="tt:PTZCapabilities">
  <tt:XAddr>http://192.168.1.17:888/onvif/device_service</tt:XAddr>
</tt:PTZ>

Then Iā€™ve checked sources of the binding and Iā€™ve noticed that binding expects element '<tt:PTZ>' not '<tt:PTZ xsi:type="tt:PTZCapabilities">'. Iā€™ve corrected this part of the code and now Foscam works properly with PTZ functions.

@yippicai
Thanks for sending the logs via PM, new build with hopefully a fix in it is uploaded.

@Lukas_1st
thanks for posting, it was useful to have your post as I can be sure the fix implemented should work on your cam as well. There was an additional issue for yippicai on top of what you pointed out.

Hi lukas

thx for pointing the problem, could you please point me on how to rewrite this piece of code

Matt1 has mentioned that he has already fixed your problem and uploaded new build. Iā€™ve already checked this version and I have to say it works properly. Please check matt1ā€™s fix.

@Lukas_1st
Since you use Foscam, would you mind giving a quick look over the readme to ensure it is clear, accurate and useful info please? The other thing probably worth doing is checking if the alarm response works better if you setup the camera as ā€˜onvifā€™ instead of ā€˜foscamā€™. It may be better to flick the switch and use the newer onvif events instead of the old polling for alarms that it currently uses.

I donā€™t have any Foscams for testing here so it would be great to have it checked over by someone that does. If you dont know github, just PM me and I can change itā€¦

New build 2020-09-13 Uploaded and marked with this date and Testing.

Note: There are changes to low level files compared to all previous builds so it would be smart to clean cache and tmp when upgrading.

Linux command to clean cache and tmpā€¦

sudo openhab-cli stop && sudo rm -rf /var/lib/openhab2/cache/* && sudo rm -rf /var/lib/openhab2/tmp/* && sudo openhab-cli clean-cache

There are breaking changes to all previous versions that did not have ā€˜Testingā€™ in the zip file name, details on this are found in this thread in recent postsā€¦ Any issues please report them as the binding is about to get merged soon and I would like the first build to be very smooth.

PTZ on Foscam FI9826p V2 now works :wink: only with preset selection, and still not working with directionnal command, tested both with FOSCAM thing and ONVIF thing, and continous and relative move.

*HLS ok
*Motion and audio detection ok
*night vision ok
*zoom KO

Since you have told me via PM that your camera does not work in onvif device manager, and I have narrowed down your issue is caused by a Highly likely camera firmware bug. You need to take that up with your camera support.

The code between onvif and Foscam thing types is the same only the alarm/ events will be different and it may be the case the alarms work better as onvif thing type. However due to your cameras bug I can not accept any reports of things not working very seriously from you, Iā€™m sure you understand why.

Thanks for confirming what is working as that is always good to hear back as I donā€™t own a Foscam to test with. If you find features from the API that donā€™t work then please let me know as it will only be ONVIF and your camera that may need a new firmware.

Ok, itā€™s not a problem for me. Iā€™ll try to check it and Iā€™ll give you the answer. Of course, Iā€™ll check the camera as onvif thing too (I am curious myself).
I know github, but thanks for help

Hi!
im on openhab 2.5.8-1 and have installed the latest testing version of this binding.
and it seems to be running:

openhab> bundle:list | grep 2.5.9
201 x Active x  80 x 2.5.9.202009130204      x openHAB Add-ons :: Bundles :: IpCamera Binding

but it doesā€™t work :confused:
on a previous setup the binding worked with my ā€œgenericā€ setup, but now i donā€™t get anything in the logs (log:set TRACE org.openhab.binding.ipcamera)

iā€™ve made some reboots but the binding still doesnā€™t work (or speak to me)ā€¦
any ideas?

What kind of bug is this? As far as I remember I was able to use PTZ by sending direct commands do my Foscam cameras with http binding (POST).

BTW. With the latest version of the binding Iā€™ve lost Hikvision camera (cache cleaned)

I just started with this binding and it seems very promising! But there are sooo many options :slight_smile:

I already managed to get a snapshot in my sitemap and some switched of motion detection etc. Now I wanted to try the example rule which is in the documentation for creating a gif and sending it. I installed ffmpeg, but I get the following warning when triggering the updateGif channel:

2020-09-14 20:35:22.288 [WARN ] [era.internal.handler.IpCameraHandler] - The camera tried to use a FFmpeg feature when no valid input for FFmpeg is provided.

What am I mssing?

Same in my case

There are breaking changes that need to be dealt with. Look for anything in all caps in your thing and item file, then update with what is listed in the newer readme. More info above.

1 Like