IpCamera: New IP Camera Binding

I agree it should be in the Readme, however we should also consider asking reolink if this is a bug on their end. Right now we have people asking that the binding can get the ability to turn the push notifications on and off with the binding, so that causes a conflict and addressing it at documentation is not as good as someone asking reolink about it. I don’t own one so it needs to be someone else.

Well, amazingly they released a new Client application yesterday that seems to clear up the answer a bit better! (This is only their client app and not new firmware for the doorbell).

I was wrong in my descriptions above about what Push notifications are, but only because of how the previous software was laid out (Im going to edit my posts above to make sure Im clear about this).

It looks like Push notifications are actual API level push notifications (the ones that the doorbell will send out as an alert) based on:

-The time schedule you set (this applies as a group to ALL 3 of the below options)

  • Visitor (Someone pressing the doorbell button)
  • Person (AI detection of a person)
  • Any Motion (AI detection of other large objects e.g. cars. a horse etc)

So these are the things (Visitor, Person, Any Motion) that people would probably want to be able to turn off and on.

If you disable Push on the camera, you will get no alerts on your phone app OR sent to Openhab. The push setting doesn’t disable the API, only the alert types and schedule it works on.

Ive had a little glance at their current API API-April, 2023 – Google Drive

I think its pages 164 to 174 that relate to these features and getting/setting via API.

I did note here on their forums that some API options are either not yet documented in the doorbell OR not yet in the firmware of the doorbell Reolink Camera API User Guide_V8 (Updated in April 2023) | Reolink Community So maybe that means that current firmware may or may not support the API requests mentioned.

Im happy to try query it/get a response from any settings, if you can tell me what you want (and I can figure out how to do it).

Dear all, i am searching for a compatible outdoor camera for my house door. Mandatory feature would be a detection alarm in openhab because i dont have a smart door bell. I do have a wall tablet, there i want to show the video stream as soon as a motion is detected. Nice to have would be person detection.

Availability in Germany (Amazon?) And budget maybe 100€ would be great. Can someone give a recommendation?

I am using openhab 4.0.4 on a Raspberry pi 3b+. Is this hardware sufficient?

Thank you :blush:

The very first post of this thread has the brands that work and the different features that they all offer. Instar is a German company and works well and has good support, check if they are in your budget range.

Thank you for the quick answer :slight_smile:
Yes i read the first post, but i was not sure if it was update since 2018. If its up to date i can kf course just check availability and price of the recommended cameras.

The 2 recommended instar cameras are above my price expectations, and one of them seems to be only indoor.

Found this one INSTAR IN-8403
It reasonable priced and availableon amazon (130€). Do you know if its compatible?
Edit: IN-8403 seems to LAN cable connection only, i would need wifi connection.

Thought there is maybe a price / performance champion known in the openhab community :smiley:

It should be compatible as it is the newer Sony Starvis 1/2.8" sensor range so it will have the Instar API in it. The list of models in the first post are ones that people have reported back that work, many many more will work just fine it is just no one has bothered to reply back and most people that have working gear do not post.

If you want to buy purely on price alone and do not value support and firmware updates, then you can look at Ankke which can have Hikvision firmware loaded onto them, and Amcrest which are Dahua hardware and have their API in them with stock firmware. Dahua and Hikvision are both Chinese and you will not get firmware released as often if you buy one of the OEM re-branded units, but they will be the cheapest prices along with Reolink.

You need to weigh up the advantage of a camera with good after sales support, regular firmware and security updates and the quality of the picture quality when you account for day and night vision.

If you like the idea of full colour at night time, then you may be willing to pay extra for a starlight / starvis / Ultra Low Light or whatever the brand likes to call the Sony Starvis sensors.

If you want to learn about cameras above just the price, then head to a forum with people that know more than I do here and they post footage to compare:

hello people, I asked this in Sep but the problem is still here despite updates and testing

when i did the transition from 3.X to 4.0 i had some issues on logging etc which i corrected - but what seems to be consistently problematic is that my 20 cameras (RSTP) which are also displayed on habpanel/with the clickable widget (but this doesnt seem to be the issue) are causing memory issues / resources usage issues.

Basically, when i install the binding (having added ffmpeg) over time the memory as observed via system info binding decreases slowly. It eventaully reaches a point where the system hangs and i get alerts on resource errors/availability. Rules fail.

I tried uninstalling the binding and reinstalling
Removing the things and recreating them.

My current test incase it is a upgrade issue is that I just setup a clean install only with IPcamera to see if it is something else on the system and am waiting a few days. but first signs is that the memory is dropping by .1% every 1hour or so. I will leave it to see if it hangs

Has anyone had a similar experience?

thanks for your time!
@matt1

Dear all, i bought myself a Instar IN9008 FullHD camera and integrated it to Openhab today.
I installed ffmpeg on my RPI with Openhabian by sudo apt install ffmpeg showing now:

openhabian@openhabian:~ $ ffmpeg -version
ffmpeg version 4.3.6-0+deb11u1+rpt5 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 10 (Raspbian 10.2.1-6+rpi1)
configuration: --prefix=/usr --extra-version=0+deb11u1+rpt5 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100

Under /usr/bin there is now a file called ffmpeg. I hope this is okay …

Then i configured the ip camera thing:

UID: ipcamera:instar:980dac2114
label: Instar Camera with API
thingTypeUID: ipcamera:instar
configuration:
  mjpegOptions: -q:v 5 -r 2 -vf scale=640:-2 -update 1
  ipAddress: 192.168.0.221
  updateImageWhen: "0"
  gifPreroll: 0
  onvifPort: 8080
  ffmpegLocation: /usr/bin/ffmpeg
  ipWhitelist: DISABLE
  mp4OutOptions: -c:v copy -c:a copy
  pollTime: 1000
  password: PASSWORD
  port: 80
  snapshotOptions: -an -vsync vfr -q:v 2 -update 1
  ptzContinuous: true
  onvifMediaProfile: 0
  username: USERNAME
  hlsOutOptions: -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy
    -hls_flags delete_segments -hls_time 2 -hls_list_size 4
  gifOutOptions: -r 2 -filter_complex
    scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse

Now i am a little bit lost.
What i want to do is to have a PIR trigger and a video stream on a openhab page.
But channel Motion alarm stays OFF all the time. I have to PIR enabled in the web UI and its also triggering in mqtt. As a backup i can use the mqtt channel …
Then i put a item to MJPEG URL Image URL and HLS URL. They all have a URL now. MJPEG URL is showing a good stream in the browser, Image URL and image only. HSL URL wants to download something. Now i put the MJPEG item into a video card in a openhab page but the card shows No compatible source was found for this media. The Image Card Image URL is showing the camera image, i can set the refresh rate to 500 ms but below this the image does not refresh. Using the HLS URL in the video card is resulting in a very delayed video (~30sec). What is the best way to do this? Can someone give me a hint? (Sorry for the long text)

edit: Ok managed to fix it. There is another PIR channel which is working. And for the MJPEG i also have to use the image card :smiley:

I want to setup something like a event historie to show the last 3 motion triggered pictures / short videos in the UI. I managed to save the gif files on my raspberry pi with the date ans time as file name. Does someone know how to show them on a openhab page? I only do have the path and file name.

There is a widget in the marketplace for doing exactly that.

Hi, thank you for your answer. This sounds good. I checked all the widgets in the marketplace but didnt find something which may help for this. Which exactly do you mean?

I think me means this one…
https://community.openhab.org/t/camera-live-mjpeg-view-with-a-mp4-recording-history/147009
Greets

FFmpeg stopped to give snapshot for generica RTSP camera.
I have such an EZVIZ C6N that worked for months:

Thing ipcamera:generic:sala “Webcam Sala” @ “Webcams”
[ ipAddress=“192.168.1.85”,
snapshotUrl=“ffmpeg”,
ffmpegInput=“rtsp://192.168.1.85:554/H.264”,
ffmpegOutput=“/TMPDIR/ezviz/sala/”,
snapshotOptions=“-an -vsync vfr -q:v 2 -update 1”,
polltime = 2000,
password=“*******”,
username=“admin”
]
//
Now it stopped to display the snapshot in my sitemap
Image url=“http://mhw.int.fmal.com:8080/ipcamera/sala/ipcamera.jpg” refresh=2000

I traced the log

2023-11-30 21:19:36.282 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Webcam.things'
2023-11-30 21:19:36.339 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Stopping ffmpeg SNAPSHOT now when keepalive is:8
2023-11-30 21:19:40.361 [DEBUG] [era.internal.handler.IpCameraHandler] - Binding has no snapshot url. Will use your CPU and FFmpeg to create snapshots from the cameras RTSP.
2023-11-30 21:19:40.363 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-rtsp_transport tcp -threads 1 -skip_frame nokey -hide_banner -i rtsp://admin:********@192.168.1.85:554/H.264 -an -vsync vfr -q:v 2 -update 1 http://127.0.0.1:8080/ipcamera/sala/snapshot.jpg
2023-11-30 21:19:45.972 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - [rtsp @ 0x12369c0] decoding for stream 0 failed
2023-11-30 21:19:45.974 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - Input #0, rtsp, from 'rtsp://admin:WOAKEU@192.168.1.85:554/H.264':
2023-11-30 21:19:45.975 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -   Metadata:
2023-11-30 21:19:45.976 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -     title           : Media Presentation
2023-11-30 21:19:45.977 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -   Duration: N/A, start: 144899.397000, bitrate: N/A
2023-11-30 21:19:45.977 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -     Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 12 fps, 12 tbr, 90k tbn, 24 tbc
2023-11-30 21:19:45.978 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -     Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
2023-11-30 21:19:45.979 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - Stream mapping:
2023-11-30 21:19:45.979 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -   Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
2023-11-30 21:19:45.980 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - Press [q] to stop, [?] for help
2023-11-30 21:19:46.067 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - Output #0, image2, to 'http://127.0.0.1:8080/ipcamera/sala/snapshot.jpg':
2023-11-30 21:19:46.067 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -   Metadata:
2023-11-30 21:19:46.068 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -     title           : Media Presentation
2023-11-30 21:19:46.069 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -     encoder         : Lavf58.45.100
2023-11-30 21:19:46.069 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -     Stream #0:0: Video: mjpeg, yuvj420p(pc), 1920x1080, q=2-31, 200 kb/s, 12 fps, 12 tbn, 12 tbc
2023-11-30 21:19:46.070 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -     Metadata:
2023-11-30 21:19:46.070 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -       encoder         : Lavc58.91.100 mjpeg
2023-11-30 21:19:46.071 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -     Side data:
2023-11-30 21:19:46.072 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] -       cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
2023-11-30 21:19:46.552 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=1 speed=   0x
2023-11-30 21:19:47.094 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=1 speed=   0x
2023-11-30 21:19:47.631 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=1 speed=   0x
2023-11-30 21:19:48.175 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=1 speed=   0x
2023-11-30 21:19:48.676 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=1 speed=   0x
2023-11-30 21:19:49.158 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=1 speed=   0x
2023-11-30 21:19:49.673 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=1 speed=   0x
2023-11-30 21:19:50.226 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=1 speed=   0x
2023-11-30 21:19:50.768 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=2 speed=   0x
2023-11-30 21:19:51.263 [TRACE] [hab.binding.ipcamera.internal.Ffmpeg] - frame=    0 fps=0.0 q=0.0

It looks as noting is captured from ffmpeg…
TY for advices

More testing. I see two ffmpeg processes active, one for mjpeg stream when I watch the Video, and one for the snapshot, always active, but I have no snapshot defined in things file:

Thing ipcamera:generic:sala "Webcam Sala" @ "Webcams"
        [       ipAddress="192.168.1.85",
                ipWhitelist="(127.0.0.1)(192.168.1.11)",
                mjpegUrl="ffmpeg",
                ffmpegOutput="/TMPDIR/sala/",
                ffmpegInput="rtsp://192.168.1.85/H.264",
                mjpegOptions="-q:v 5 -r 2 -vf scale=640:-2 -update 1",
                snapshotUrl="",
                snapshotOptions="",
                password="*****",
                username="admin"
        ]

 # ps -ef | grep ffm
openhab  20122 14907  1 10:14 ?        00:00:11 /usr/bin/ffmpeg -rtsp_transport tcp -threads 1 -skip_frame nokey -hide_banner -i rtsp://admin:******@192.168.1.85/H.264 http://127.0.0.1:8080/ipcamera/sala/snapshot.jpg
openhab  22546 14907 20 10:23 ?        00:00:32 /usr/bin/ffmpeg -rtsp_transport tcp -hide_banner -i rtsp://admin:******@192.168.1.85/H.264 -q:v 5 -r 2 -vf scale=640:-2 -update 1 http://127.0.0.1:8080/ipcamera/sala/ipcamera.jpg

Hi there :slight_smile:
I got a new INSTAR camera 9420 - which is the successor of the 9020.

Now I am facing an issue with sending ONVIF commands.
With 9020 camera the ONVIF commands for PTZ control were working - the same commands with camera 9420 are showing the following error (ipcamera binding trace log level):

Camera did not report any ONVIF preset locations, updating preset tokens now.
IndexOutOfBoundsException occured, Index: 1, Size: 0
ONVIF reply is: <?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s=„http://www.w3.org/2003/05/soap-envelope“ xmlns:tt=„http://www.onvif.org/ver10/schema“ xmlns:ter=„http://www.onvif.org/ver10/error“><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value>ter:UnknownAction</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang=„en“>Unknown Action</s:Text></s:Reason><s:Node>http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver</s:Node><s:Role>http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver</s:Role><s:Detail><s:Text>An unknown Action is specified</s:Text></s:Detail></s:Fault></s:Body></s:Envelope>

Is this something related to new ONVIF T-Profile?
Is this already implemented into openHAB binding?

Any ideas, why ONVIF commands are not working anymore are highly appreciated.
regards, Kai

EDIT: running on OH4.1M3 and since today OH4.1

Short answer is I suspect that yes this is the reason.

I did take a look 12 months ago and came to the conclusion that the binding probably would work if SSL support was added, or if the camera allowed non SSL communications. The only downside to not having SSL support, was that the PTZ features would not work, so it was a low priority to look into as I did not know of any cameras that had PTZ with only Profile T and requires SSL. It is possible for a camera to support both Profile S and Profile T at the same time. They appear to be same/similar as T is a more secure version of S. The binding already does the DIGEST auth method that Profile T mandates, so the only known issue is the missing SSL support. I course I can not be 100% sure of this as you have only post a single line of the trace logs from when the camera first connects to ONVIF it may give more info then.

Also there are 3 to 4 different ways to move a PTZ camera, it’s possible one of the other methods will work, however if the camera does not response that it supports PTZ the channels may get removed so you can not use them. The handshake trace logs would show more info and if this was the case.

Is it possible to move the camera using the MQTT methods? Just be sure to use the MQTT ports for SSL when setting up the camera as it is likely it only supports SSL to the MQTT broker as well.

1 Like

Thanks for your detailled answer!
I do have the debug-level log file availabe and will send it via PM to you - I don’t want to spam the forum here with long logfiles…

The cam does support ONVIF and ONVIF (SSL) on two different ports. I changed in OH to the SSL-port but this didn’t change anything.

And because I don’t have a MQTT broker yet, I cannot test MQTT yet :innocent:
I will think about testing MQTT…

Happy Christmas!

The binding does not support SSL so if the logs you sent were from the SSL port of the camera that is why they held no replies. There is also ways to move the camera using the Api methods if you do not have MQTT setup.

the log file contained two logs: the first part was ONVIF without SSL, the second part ONVIF with SSL.

Anyhow - your idea using other method worked for me :slight_smile:
I used cgi command to send command for PTZ movement.
INSTAR Cams can moved with e.g.:

sendHttpGetRequest("http://user:password@CAM_IP/param.cgi?cmd=ptzpreset&act=goto&index=1", 100)  // Move camera to PTZ Preset 1

Same result :smiley:
Thanks for the idea @matt1 to consider alternative to ONVIF :ok_hand:

1 Like

@matt1 thank you very much for this great binding. It works flawlessly. I know I asked already two/three years ago but would it not be great to have an another chanel like GotoPreset, a SetPreset? I think a lot of cameras use it to save PTZ positions, motion tracking on/off etc. All these outdated apps from the vendors would become obsolete if you can make little changes in openhab. Today I am using a python onvif commandline tool to execute this task in openhab. I would like to help you but I am not a programmer.