IpCamera: New IP Camera Binding

If I am correct, channels are for when there is a STATE like a light globe is ON or OFF, and rebooting does not have a state, as it is something that you trigger to occur. It is only temporary and you are not able to know the difference between rebooting and the camera being offline. I believe what would be considered the correct way to do it, is implement it as an ACTION which would require you to setup a rule to trigger the action when the switch is moved.

This then makes it almost just as easy to create a script and call the script when the switch is moved with a rule. To be clear I don’t like this answer I am giving and wish it was simple to create a switch for an action that takes zero arguments. It should be simple, to just add a camera and get advanced actions available in the main UI without the need to research and spend 20+ minutes setting it up when it should be available to add when your creating some equipment in the model.

Sadly after a quick github search it appears that actions still are not fully supported by mainUI/core

[automation] Binding actions cannot be configured by UIs · Issue #1745 · openhab/openhab-core (github.com)

This is something which is best raised as a request in github, especially as I am busy on another binding at the moment and a post in this long thread is only going to get lost.

1 Like

Hi

Since I always had problems with the Livestream, I have now test an own Rasperry PI in use for the IP Camera Binding. The only binding installed is the IP Camera binding.
Nevertheless, the stream stops after some time.
However, the binding shows me both cameras as online.
I have a copy from the live logging attached as well as the logfile from this afternoon. According to the camera image, the stream stopped at 17:51. Im am running on openhab 3.3 snapshot

Logfile_Live.txt (55.9 KB)

Logfile during end of stream (OneDrive)

When I disable and then enable the binding, it works again.

Cameras
TP Link Tapo and Reolink

BR
Daniel

Have you tried to connect the cameras with lan cable?
I have problems with reolink WLAN camera but with cable it works great.

Hi Sebastian

both are connected via LAN.

I thought maybe its due to the powerline, but for test purposes I connected both cameras directly to the switch. At the time of the failure, both were directly connected to the switch

BR

Hey guys.

Does anybody know if the Xiaomi Mi 360° Home Security Camera 2K would work as a Generic camera?

Cheers

See here as you would need a working rtsp or http stream as a minimum for it to work as generic.

That’s what I thought, thanks. Apparently some CfW for the Xiaomi cam offer both RTSP and ONVIF, but as of yet not my model.

Recently i upgraded a Reolink RLC-811A IP camera to the latest FW version v3.1.0.956_22042008. Before, i.e. with FW v3.1.0.764 everything worked like a charme. But with latest FW, camera seems to reboot every ~4 minutes. I don’t even receive any motion indication although there’s mortion.
Critical here, Reolink upgraded ONVIF protocol to version 21.06. Usually standardized protocols are backwards compatible, however with ONVIF device manage 2.2.250 i don’t face any issues and i even receive motion indication messages.
Now i’m wondering, makes ip camera binding use of more and different messages compared to ONVIF DM manager or is there probably a somehow “mailformed” packet send by the binding?

Rational on why i want to stay with recent Reoliunk FW: They introduced and still improve AI to further detail the motion, i.e. person, pet, car.
I’m having discussion with Reolink support team in parallel.
Currently I’m struggling with “log:set TRACE org.openhab.binding.ipcamera” answering “Error executing command: Unable to set level for logger”, hence i don’t have more details yet :-(.

Meanwhile i managed to set the ipcamera binding log level to TRACE. Having had a look into three retries, i noticed “Sending ONVIF request:PullMessages” to be the last output of the binding before camera connection got lost (camera most probably restarts).
Any idea on whether there has been changes in the ONVIF protocol in version 21.06?
Will share the same with Reolink support team.

If switching off the ipcamara binding, does the Reolink camera work as intended (i.e. no reboots at all)?

Yes, in this case camera is stable. Similar to disabling the ONVIF interface/port on camera side.

Just checked: ONVIF DM makes use of “PullMessages” as well.But in contrast to ipcamera binding, the IE “MessageLimit” within the body isn’t <1> but <1000>. Don’t think the other IE “Timeout” with “PT8S” vs “PT1M” makes any difference. Despite that body seems to be identicall for both.

The “PullMessages” answer takes 3 IP fragments with std ethernet (i.e. MTU = 1500). Hope above messages are not treated as IP fragments.
Will next take a tcpdump during misbehaving situation.

I’m not an expert on interpreting ONVIF messages, but what i see in misbehaving situation: from 3 “PullMessages” requests within the short tcpdump, seems just one received an answer.
Kindly let me know what further tests could be done / what to focus on in detail. Thanks a lot!

From memory the binding asks that only 1 event is reported in each reply to the “PullMessages” request. This means the camera has to only reply with 1 event instead of the binding having to parse multiple events out of the one reply which may contain 1000 events to parse. The binding will keep asking for “PullMessages” and the camera is meant to send 1 at a time until there are no more. Perhaps there is an issue in the way that is working in the cameras firmware. Since the messages were modelled around the ODM software they should be almost identical so very few areas that can cause 1 to work and the other to not.

I managed to modify, build and apply the ipcamera binding. Root cause of the Reolink camera reboot seems to be MessageLimit set to 1. I started with 1000, similar to what the ONVIF DM set the setting to. After proofing this, i went down to 10, and this works as well.
Question to the IpCamera maintainer: Is there any reason to stay with 1? Setting the parameter to e.g. 10 shouldn’t harm i assume.
I will communicate the same to Reolink support team. Not sure how fast / whether they will incorporate a fix.
Hence, to be on the safe side, changing the binding might be the best and fastest approach.

Haven’t seen your chat before i send my latest updates :frowning: How about the complexity to parse multiple messages?

Its not hard it just needs someone to implement it. If you don’t implement it then the camera could send multiple events even just a CPU load message and you would miss the 2nd event in the same message which may be a motion event that you care about. The value of 1 is a valid request and the camera should be able to handle it, it just takes multiple replys instead of 1 holding many events.

ok, got it. Thanks! Lets see whether Reolink shares any update on this in the near future.
I fear issue will show up on more Reolink cameras than just RLC-811A with latest firmware :frowning:

Hi,

did you manage to connect HikVision DS-KV6113 to openhab?

Y

Unfortunately not with the IPCamera Binding. As I use a Synology, this DS-KV6113 is handled by Video Surveillance Station. There is a OpenHAB binding for this but I did not yet experiment it.