I own a Hikvision and have tested it extensively direct to openhab with no NVR as I do not own one. Please delete the camera, re-add it and check your settings. Recent builds have different channels so you must delete and re-add if you do not use TEXTUAL CONFIG. The error as I have mentioned before is your camera not replying when asked about PTZ, it should not stop the camera working. The error should disable the PTZ from working, but it is not related to your picture issue. Check the setting are correct and the NVR input channel is set to 1 for cameras not connected to a NVR.
linkage param is enabling my cameras sound/siren, sensitivity is being set to medium, triggerInterval is saying only trigger every 15 secs motion is present, then the schedule^N and area^N params are enabling motion detection 24/7 as well as setting the motion area for all cells of the cameras motion grid.
I’m considering branching your git repo to try and contribute… You let me know what I can do to help.
Thanks again for all your work.
Also, I just realized that the Motion Alarm state through OH never changes when motion is detected.
Earlier you had asked me to check the value at:: /cgi-bin/CGIProxy.fcgi?cmd=getDevState
and param motionDetectAlarms value never changed from 1 (no alarm). Now with your help and the troubleshooting that has been done, with the proper setting in my cameras configuration, that value does change from 1 to 2 (detect alarm) when motion is detected.
Am I misconfiguring OH? I also have OH configured to “Update the image during motion alarm” and the image does not update.
Since this build has changes effecting Foscam users I’ll give a shout out to the people who posted they have foscam in this thread.
Chad has posted his camera appears to be working differently as most of you have already posted the alarm is working fine. In case you find the binding is not turning the alarm back on correctly, I have added another setting in the binding that allows you to enter your own custom url in this format…
Note there is no IP and it starts with a /.
I have done this because I do not wish for the binding to over write the detection area as many people will want to stop motion detection in areas with tree branches that move in the wind. If you leave this setting blank, it will work the way it did in previous builds.
The other change is Chad seems to be reporting his camera uses “motionDetectAlarms” and other cameras use “motionDetectAlarm”, so the binding should now accept both, but it needs to be tested.
Any problems please contact Chad as he now handles all Foscam complaints just kidding, all push requests are welcome and the binding now has the framework to allow users to make changes easily without needing to understand the workings of netty.
first of all, thank you very much for this binding! It already works great with my Foscam C1 and C1 Lite.
I have a little request: My wife sometimes plugs out the wifi repeater where one of my camera is connected to.
In the Logfile I can see every minute the following Message:
2018-06-22 10:37:56.485 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:foscam02:888
2018-06-22 10:37:59.493 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - Can not connect with ONVIF to the camera at foscam02, check the ONVIF_PORT is correct. Fault was java.net.ConnectException: Host not available.
2018-06-22 10:38:02.494 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - Can not connect with HTTP to the camera at foscam02:88 check your network for issues.
2018-06-22 13:10:16.137 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can't find ch when removing handler URL:/cgi-bin/CGIProxy.fcgi?usr=openhab&pwd=yxenSg2zrOZ4&cmd=snapPicture2
2018-06-22 13:16:07.376 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:foscam02:888
2018-06-22 13:16:17.945 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Camera is reporting that it does NOT support Absolute PTZ controls via ONVIF
2018-06-22 13:16:17.947 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Finished with PTZ with no errors, now fetching the Video URL for RTSP from the camera.
Is it possible to just report just once that the connection to the camera is lost? The thing state reflects the actual connection state.
@matt1 Hey, i had a little time to investigate. I was never be able to check getMotionDetectConfig but with your recent posts i found out that i need to check getMotionDetectConfig1 Now that i am able to fully investigate I had some test with my C2 Foscam camera. Before i connected the enable motion alarm switch to my presence rule. When i was going out of home the motionAlarm get activated but since there was nobody home i always assumed it would have worked fine. After last posts i checked and motionalarm never got triggered (changed to 2).
I used the link sent from @chaderick9 and was not working too. So i factory reset my camera and got it working and checked the getMotionDetectConfig1 parameter. I have no area, mine has different parameter. Here is the standard response of the C2 straight out of the box that is working.
New build 25-06-2018 only has minor logging changes for Ozzy and Foscam changes for Chad…
It looks like that log output may be from an old build as the newer ones have less output. I just made a change that all ONVIF errors are now only warnings. What this means is you can set your log output to ERROR and you will then only see errors and get what you are after, just don’t forget if you ever have issues to step the log back up to TRACE before asking for help. How to change the log level is found in the very first post of this thread.
Download the PDF from this link and on the very last page is an example url for your camera type using the getMotionDetectConfig1 format. Use that example in the binding and it may be that simple.
What you need to look for is “HTTP Result back from camera is” and then in TRACE you will see the reply back from the camera. Your log output stopped too short, it should have been in the next 10+ lines of the log. Because the binding is now async comms, the binding can be asking multiple things of the camera before a reply comes back. I added a line that tells you when the foscam handler is closing the connection to the camera, it is possible the entire message is not reaching the handler in a single packet and it gets closed before the full message comes in. Your camera does not send a length header so I have an idea what may be causing it and I put a change in that may resolve it, hopefully without causing issues for foscam users that have no problems.
Can you define slow? I see you have it set to update every second, is it not doing that? Cameras need a key frame to generate a snapshot from so the video settings can effect the snapshot ability.
That warning should happen when first connecting as it means the alarm checking was not running. If it continues in the logs then it will be an issue to look at. Dahua and hikvision both have the ability to open a single stream and keep it open so the camera can inform openhab a alarm is going off. If the stream is not staying open that warning occurs.
Thank you for the feedback it is greatly valued as I have not heard how it works on Dahua yet. I’m sorry but I am still unclear if your picture updates every second? If you think there is an issue then please create some trace log output and I can take a look. As I don’t own Dahua cameras I am very limited to what I can do without log files to show what is going on. First post of this thread explains how to change to trace log output.
The I frame setting try reducing that or play with all settings on that page. The hikvision cameras I have actually send 3 requests for a snapshot before the first request actually gets a picture. The compression also takes time on high resolution cameras so the binding needs to ask multiple times and that may not be happening on your camera, can’t tell without log output.
Testing latest 18.104.22.168806250815…
On my two Foscams C1 almost everything seems to work properly. Almost…
What’s not working is pulling the state of enableMotionAlarm and enableAudioAlarmfrom the camera.
If I disable motion or audio alarm from the camera interface or app the channels are not updated.
the response from the camera is:
The API states that if the alarms are disabled those two should report as 0. If the alarms are enabled and not occurring 1 is the value. Value of 2 for when the alarm is detected… Perhaps check for a newer firmware for your camera.