IpCamera: New IP Camera Binding

Yay, now also managed to get my HLS stream working. Error was in the things file where I wrote:

FFMPEG_OUTPUT="/tmpfs"

Which should have been:

FFMPEG_OUTPUT="/tmpfs/"

Now its working like a charm :stuck_out_tongue:

1 Like

@matt1 I have a specific question to the ā€œExternal Motionā€ channel. I like to use this with my Amcrest camera. Trigger motion externally which then triggers recording of the cam. (the cam motion sensor is really useless in my situation)
I did set up a switch to trigger the channel, but the camera did not start to record.

ITEM Def

Switch GF_Familyroom_Cam_ExtMotion      "Wohnzimmer ext Alarm"
    { channel="ipcamera:AMCREST:Cam_001:externalMotion", expire="1m,command=OFF"}

I enabled Motion Detection on the Cam, but deleted all Detection Zones. Is there anything else required from the setup / definition of the cam itself for the recording to happen? thanks.

The externalMotion channel will not trigger the camera to record, the intention for the channel is forā€¦

  • autofps.mjpeg It will change from 1 frame every 8 seconds to a new picture every second when motion occurs.
  • groups that scroll through cameras in a set order and when motion occurs the cameras with no motion get skipped.

You can record using the new mp4 record feature of the binding, or you can have a look through the API to see if there is a way to do itā€¦ There is a channel called apiAccess that the readme goes into that will allow you to test features right away from the api, however I may remove this channel when the binding gets merged so be sure to request a feature to be added instead of relying on this channel.

Thank you for the quick response. Obviously, I misunderstood the objective of that channel.

Hello!
Can you help me with configuring my camera? Itā€™s Dahua IP camera. I added this camera as a thing through paper ui and the logs says itā€™s online (also paper ui says that).
Config:
Ip address = 10.0.2.101
port = 8094 (as it is shown in my recorder)
server port = 54321

Then I am creating in sitemap:

Video url="http://10.0.2.173:54321/ipcamera.mjpeg" encoding="mjpeg"
Video url="http://10.0.2.173:54321/snapshots.mjpeg" encoding="mjpeg"
Video url="http://10.0.2.173:54321/autofps.mjpeg" encoding="mjpeg"
Video url="http://10.0.2.173:54321/ipcamera.m3u8" encoding="hls"
Webview url="http://10.0.2.173:54321/ipcamera.m3u8" height=15
Image url="http://10.0.2.173:54321/ipcamera.jpg" refresh=1000

And nothing is showing up. :confused: (10.0.2.173 is openhab address)
Donā€™t know what am I doing wrong. I only want to have a preview on my openhab.

Where is the rest of your config, such as ffmpeg?

How can i actviate the continous moving in the thing file?

i have values from 1 to 100 in my openhab and the PTZ is working in absolute mode.
I am wondering that it is working because the values in onvif in absolute mode are form -1 to 1.

also when i want to zoom, 1 is the nearest opinion. is that correct?

also i cant til the camera to the end point. there is one step i have to til the camera to the web interface.

can you explain this?

To change from relative to continuous movements use PTZ_CONTINUOUS in the thing file as true or false.

Iā€™ll take your feedback and update the readme here later tonight. If you use habpanel I created a widget that makes setup for this much easier and works great.

Hi Matt1,

thx for your reply.

My camera is only working in absolute and relative mode.

But in the openhab log i see the following:

2020-07-10 09:43:14.202 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - Tilt is updating to:112 and the cam value is 1.233333

2020-07-10 09:43:14.204 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - Zoom is updating to:1 and the cam value is 0.007812

When i set the tilt to 100 the camera is not fully tilt. How can i set the item to 112.

Zooming is also between 0 and 1. How can i handle this?

Best regards

Sascha

Hello - I have been looking through this thread as I consider adding a camera to my openhab setup as a doorbell upgrade. I was hoping the community could guide me in choosing a camera that will likely work. I did notice the relatively short list of cameras at the top ā€œknown to workā€ and how it contrasts with the flood of very similar cameras I find when I start poking around on Amazon or bhphoto. I am looking for an outdoor camera with at least one alarm input (for the doorbell button) and at least one alarm out. Any help in narrowing the field would be appreciated!
Thank you,
-Bill

This camera would fit your requirements and it is one I was considering.

or this model if you cant find that one anymore: IPC-HDBW4239R-ASE

There is also INSTAR IN-6001HD as you could surface mount that very easily and fit a zwave or other button next to it but it is not outdoor rated.

Doorbird make a range of cameras.

I am getting the hikvision / RCA / EZVIZ (DB1) camera going at the moment and it is good, but no events on a button push and the non standard resolutions because of fish eye means that google home does not want to cast the h264. Looking at work arounds to improve it at the moment, but it is working great and the gif can be cast (I would prefer to cast the GIF anyway even if it did work) and the motion alarm works well instead of a button push as it has PIR to cut down on false positives. There is also the ability to use Zwave sensor hacks to capture the button push. Cheap and very easy to setup and integrating in Openhab is very easy.

Lastly there is another camera that could be hacked to work using multiple scripts and mqtt for the button push. If someone looks at what the scripts do and requests a feature it may be possible to have direct support for it. But it has some downsides like no night vision until the button is pushed which makes it a no for me. If u have a sensor light already that may not be an issue for you.

2 Likes

Just to second the EZVIZ flashed with Laview ONVIF firmware. I just bought one a week ago, and now have it fully integrated into OH thanks to @matt1 and this binding. Iā€™m able to use both HABpanel as well as BasicUI, and motion sensing works great once you set the sensitivity to reduce false positives. All in all a nice turnkey doorbell camera setup for $85 US or less.

Iā€™m also using this camera and running Shinobi in a separate docker to continually record the entire rtsp stream as a CCTV area surveillance. So far working well.

1 Like

Hi matt,

do you have an explanation for me:

My camera is only working in absolute and relative mode.

But in the openhab log i see the following:

2020-07-10 09:43:14.202 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - Tilt is updating to:112 and the cam value is 1.233333

2020-07-10 09:43:14.204 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - Zoom is updating to:1 and the cam value is 0.007812

When i set the tilt to 100 the camera is not fully tilt. How can i set the item to 112.

Zooming is also between 0 and 1. How can i handle this?

Best regards

Sascha

New build 2020-07-12 has these changes:

  • Fixed a big bug that was causing deadlocks that was in all previous builds.
  • Onvif Event changes. @John_Siemon this should work better for EZVIZ DB1 cameras.
  • Changed the ffmpeg motion alarm to use its own channel. Breaking change.
  • Huge change to the look of the config of all cameras in PaperUI.
  • Defaults to 1000ms between snapshots.
  • Defaults to not fetch snapshots unless they are needed. Better On Demand detection for all features.

Because of the massive changes to the config and channels, it is going to need a cache clean when you upgrade from this point on. Search forum for how to do thisā€¦

This should hopefully be the end of all the big changes and now it is just testing and bug squashing.

What happens when you send the commands from a rule? The binding uses 0 to 100% on the slider and it auto converts it to the ranges the camera uses which is normally -1 to +1ā€¦ There is no such thing as 112%, as 100% should be at the very end of its travel. It is probably the control getting changed when you use the INCREASE command and it may have gone out of sync. Hence why I ask about when you use it from a ruleā€¦

To fault find in detail I would need to see logs of when the camera connects in TRACE level and then some more logs when you try to move it again in TRACE. If the above explains it then just tell me how to reproduce it and I can test for it here, otherwise I need logs.

Often you find there are glitches in the cameras firmware that show up as doing the same thing in Onvif Device Manager. Worth doing a check in there as well.

@matt1 Thanks for the effort on EZVIZ doorbell camera. I have installed the latest beta from 7-12, but I have a few questions and observations.

  1. When using the FFmpeg Alarm, is the RTSP URL required as part of the FFMPEG setup in the binding or is it auto discovered? Do I need to include the User:Pass as part of the URL?
  2. Does the Enable/Threshold channel still work for FFmpeg with the EZVIZ? The reason Iā€™m asking is that it doesnā€™t seem to matter if I set it to 1 or 100 the results appear to be the same with my quick tests. As with past binding updates/releases, I assume 1 is most sensitive and 100 least sensitive and that both a switch and dimmer/slider can still be linked to the channel.
  3. Does the Motion Alarm still work with EZVIZ or has it been replaced exclusively by the FFmpeg channel?
  4. Is the Motion Alarm affected by the Enable/Threshold channel settings?
  5. Not 100% sure of this and I did not see it explicitly called out in this thread, but the camera PIR events do seem to be seen by this binding even before the most recent update. Everytime the EZVIZ notifies of a PIR Event I also get a notification from OpenHAB. So it would seem that PIR Alarm can be used in conjunction with the Motion Alarm with the EZVIZ. I havenā€™t throughly tested this observation, so I may be totally off base and I have only had the EZVIZ for about a week so more work to be done.

Finally, based on the short time Iā€™ve had the updated binding running, it does appear rock solid in terms of remaining connected. Thanks for your hard work and time invested in pulling this together. It really is a great contribution to the OH community.

1 Like

No problems, there was also a lot of hard work and testing done by @bgilmer which is greatly apricated the help given. The changes for the motion control were their idea as well.

  1. It is auto discovered and can be left blank. If you do over ride it you can leave user:pass out and the binding handles this for you making changes to the password much simpler.
  2. Yes that control works for all brands. There is a separate thread on this feature where it goes into much more detail which I will edit the posts in it and update the readme over the next few days.
  3. Yes it still works, just now you can use both at the same time if you wish and the channels are separate to give more flexibility. For example you could use ffmpeg to cut down on false positives by automations needing to see two types of alarms going off at the same time.
  4. No they are 100% separate features, if an enable/disable feature is added for the onvif motion alarm it will be a new channel.
  5. Please give more info as to my knowledge which is limited to only a few days getting it running I have not seen the PIR get sent to onvif. There are two different event types that get sent but these appear to be the same. Do a test of covering up the camera and moving in front of the PIR, does it send an event? if yes then please give details on how to get that going as I have not tested any firmware other than Hikvision so far.

Yes only the latest build is rock solid, previous ones the camera would crash and reboot which would be seen by the button of the camera going red not blue for 20 seconds whilst it rebooted. Fingers crossed this is now a thing of the past and it works for days as that took some time to solve :slight_smile:

1 Like

New build 2020-07-13 has these changes:

  • Line Crossing, Intrusion/FieldDetection and heaps of other new channels for Onvif events, look in paperUi and you can see what is available but your camera needs to send the right message to make the channel move. If you see an event that is not added feel free to request it.
  • PTZ minor changes.
  • Instar alarm bug fix.
2 Likes

So this morning I tried your suggestion and placed a piece of masking tape over the camera lens and then walked toward the camera and away from it. Sure enough both OH and the EZVIZ app sent a notification at the same time, with EZVIZ app notification calling it a PIR Event. I am doing nothing special other than using Laview firmware and in the app I have Audio, Status Light, IR Light, and Alarm Notifications enabled. Of course I have the PIR Alarm in your binding linked to an item/group that I use to send OH notifications. I read somewhere that Laview was better to use for cross flashing EZVIZ firmware, but that may or may not be true. Iā€™m generally satisfied with it, the only thing I lose is the ability to turn off the doorbell sound at the camera, but if that is important it can be done before flashing the firmware to Laview or whatever. Interestingly ipcamera binding just lists motionAlarm as the LastMotionDetected, not PIR. Not sure if that is by design, but just FYI. Also, from my selfish perspective it would be nice to be able to adjust the sensitivity/threshold of the motionAlarm, not just the FFMpegAlarm. It is my understanding that when the motion alarms used the same channel the sensitivity changes affected both. Is that correct? Anyway great binding and great work. Thanks again.

No not correct, it has never adjusted the sensitivity. You need to setup the sensitivity in the cameras settings, I did notice that this may be possible to do with Onvif device manager under ANALYTICS but note I have barely used the camera, I have spent my time getting it going instead. The FFmpeg controls do allow you to adjust the sensitivity and also ignore areas from seeing movement by using ffmpegs CROP feature. This is why it is kept separate, you can tweak away with it without interfering with the motion alarm that starts recordings.

Interesting, Iā€™ll need to retest as mine did not with Hikvision firmware so hopefully I was wrong or it works with LAView firmware. You probably know the camera better then I do.

Yes that is because my camera does not send a unique event for PIR.
RuleEngine/CellMotionDetector/Motion
VideoSource/MotionAlarm
Different brands of cameras use both of those for normal motion detection, AFAIK both of those are not set aside for PIR use. I could be wrong and it may be my other camera has used it incorrectly.

Hi @John_Siemon. I am running the EZVIZ DB-1 flashed with HikVision FW. Both the EZVIZ and Hikvision FW allow you to adjust the sensitivity of the PIR sensor. The EZVIZ app has three range settings - near, medium and far. The Hikvision app shows the same three range settings, but then supposedly allows you to choose to limit or enhance sensitivity in a specific direction. (E.g. you can have high sensitivity on the left, but low sensitivity on the right.

As far as I can tell, this functionality is not available - all the Hikvision app allows is near, medium or far sensitivity for the entire field of view.

Looking at Wireshark captures of communications between China (Hikvision servers) and my camera, all of this communication is encrypted. AFAIK, no one has had access to an API document or has reverse-engineered the commands that allow you to set PIR sensitivity, doorbell type (none, mechanical, electronic), to set HD or UHD video mode, etc. This all seems to be proprietary and closely held information. None of this is available in any of the Wireshark captures I have done when querying about ONVIF capabilities, so unless someone comes across some documentation or manages to reverse-engineer this, you will have to connect the doorbell to a remote server and then use an app to configure these parameters.

I know this is OT, but I have two VLANs. One has Internet access, the other is completely isolated without any routes to other networks. When I need to use the app, I just change the vlan of the port for my doorbell wifi, connect the app to the doorbell, and do the configuration. When done, I change the VLAN back to the one that is isolated.