IpCamera: New IP Camera Binding

any ideas @matt1 ?

DahuaVTO could stream two subtypes in one channel, one of lower quality, good for widget, mjpeg and sip, second of a better quality, good for security recordings. How to implement that feature into binding?

I have need received any feedback from reolink. Did you implement changes into the binding which I could help testing?

Hi Juergen,

i received a knife package for Reolink 810A camera which solved the issue.

Reolink couldn’t disclose at that point in time any release date for official builds.

Personally i added some changes to the binding:

  • support of multiple messages within one packet (also solving the issue)

  • support of AI indication (person, pet, car)

Skinah asked me to share those changes as he’s working on the binding as well.

Unfortunatelly i faced issues with github token, hence i wasn’t able to raise a pull request on short notice.

Instead i shared a diff (quite limited still) with Skinah via email.

Seems Skinah has limited email connectivity, haven’t heard anything whether the changes made it into the code :frowning:

Best regards,

Dieter

i never got any email and it is preferred if you create your own github PR.

Hi Skinah,

Of course i send you couple of emails and i even asked you whether you have been able to merge the snippets.

I took below screen shot from here: https://community.openhab.org/t/setting-up-nvr-based-reolink-cameras/136752/22

Might be that forum cuts off email at a certain lenght.

But I’m the new one here, and in this case i would have expected a bit more verbose reaction.

Regards,

Dieter

I have not been sent real emails.
I have not gotten any useful diff outputs that have not been cut short and bad formatting.
GitHub is where all contributions should be made, where multiple people can help.
I won’t waste My time posting multiple times that a diff appears to not be complete, it should be obvious to you that the post does not contain all your hard work.

Thank you for making the changes and testing, thank you for wanting to contribute. We are all not paid and have multiple more important things in our lives, so please use GitHub and don’t post in a forum in a totally different thread where the history is now split.

I’ve installed pytapo library on my openhabian and finally I can control my tapo cam privacy mode and alarm with a simple script. maybe someone of the ipcamera binding can integrate the library on ipcamera addon.

First install the library with this command (mine is and openhabian on rpi):

python3 -m pip install pytapo

once installed, create a .py script like this:

$ cat enable_priv_tapo.py

from pytapo import Tapo

user = “admin” # always admin when using your cloud tapo account
password = “” # password from your cloud tapo account
host = “192.168.0.238” # ip of the camera, example: 192.168.0.238

tapo = Tapo(host, user, password)

tapo.setPrivacyMode(True) enable the privacy mode (True or False)
tapo.setAlarm(False) #Disable camera alarm (True or False)


there are also many other functions on the pytapo library you can test and add to your script.

Also you can test and run this script from the command line or from a dsl rule on the openhab gui. Example:

executeCommandLine(“/usr/bin/python3 /etc/openhab/scripts/enable_priv_tapo.py”)

cheers!

I may have just found an issue with reconnects with ONVIF cameras that may be your cause of issues. I’m in the middle of testing a fix at the moment.

The other thing you could do is use an older version to work out when exactly the issue started to occur. You can download a few builds I keep for this purpose here
Index of /openhab/IpCameraBinding/OldVersions/ (pcmus.com)

You need to uninstall the merged binding and install the telstick binding to take care of the needed dependencies, then just drop the jar into the addons folder unzipped. You can jump around the versions, but dont go older then the one marked dual servers as there was a big breaking change to the urls that the binding serves the files on at that point in time.

Having an issue with a Barlus ONVIF camera that is not a true PTZ it does not pan tilt or zoom, it uses PTZ Presets 233,242, 243, 244, 245, 250 and 251 for controlling its white and infrared lights… these Presets are not seen by IpCamera and can’t be set via pulldown, Preset 1 and 2 work fine.

The pulldown list shows Presets 1 -127 and when setting the above Presets the trace log gives an notification that the number is incorrect. I’m guessing anything that isn’t sen in the pull down is rejected.

If you change the presets you either have to send a refresh command or pause and unpause the camera to scan and update the list. There is no npn stop polling to check if the preset list has changed but you can set this yourself to occur with a REFRESH command.

A trace log would also help.

Hi matt,

UPDATED:

Thanx for the reply,

Sorry, your correct I meant using gotoPreset, the camera doesn’t expose its presets above 127 to the pull down unless you set and refresh, but the log shows any value above 127 as invalid when a gotoPreset 233 is done. btw these presets are not really settable they are hard wired.

sending a gotoPreset 233

21:28:35.087 [TRACE] [camera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
21:28:35.617 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'LivingRoomAmazonEcho_Speak' received command Hey you silly Kitties,  stop running all over my she it!
21:28:35.620 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'ONVIFIPCamera_GoToPreset' received command 233
21:28:35.622 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'LivingRoomAmazonEcho_Speak' predicted to become Hey you silly Kitties,  stop running all over my she it!
21:28:35.624 [TRACE] [camera.internal.onvif.OnvifConnection] - Sending ONVIF request:GotoPreset
21:28:35.625 [DEBUG] [camera.internal.onvif.OnvifConnection] - IndexOutOfBoundsException occured, Index: 232, Size: 127
21:28:35.625 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'ONVIFIPCamera_GoToPreset' predicted to become 233
21:28:35.628 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'LivingRoomAmazonEcho_Speak' changed from  to Hey you silly Kitties,  stop running all over my she it!
21:28:35.629 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'ONVIFIPCamera_GoToPreset' changed from NULL to 233
2

sending a gotoPreset 127

21:33:10.598 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'LivingRoomAmazonEcho_Speak' received command Hey you silly Kitties,  stop running all over my she it!
21:33:10.600 [DEBUG] [camera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/CellMotionDetector/Motion, Data:IsMotion, Value:true
21:33:10.605 [TRACE] [camera.internal.onvif.OnvifConnection] - Sending ONVIF request:GotoPreset
21:33:10.602 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'ONVIFIPCamera_GoToPreset' received command 127
21:33:10.606 [TRACE] [camera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
21:33:10.608 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'LivingRoomAmazonEcho_Speak' predicted to become Hey you silly Kitties,  stop running all over my she it!
21:33:10.609 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'ONVIFIPCamera_GoToPreset' predicted to become 127
21:33:10.610 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'LivingRoomAmazonEcho_Speak' changed from  to Hey you silly Kitties,  stop running all over my she it!
21:33:10.611 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'ONVIFIPCamera_GoToPreset' changed from 233 to 127

sending a gotoPreset 1 or 2 works as expected with similar log results.

Tim

Onvif has preset tokens and the camera SHOULD report the presets and a token for each preset. The binding has to know the preset token to recall the preset so it will be interesting to see what the camera reports for these locations.

Without the token, the binding can not just blindly ask to go to preset 233 or any number, onvif does not work that way.

It would also be interesting to know if it works with the onvif device manager software?

matt,

ONVIF Device Manager functions much the same way, 1 an 2 work but doesn’t show anything above 127 unless a preset of 233 is created, then it doesn’t do anything when selected… using CMS or VMS is able to goto preset 233 and toggles the cameras overlay graphics as this command is supposed to.

I believe those programs appear to blindly set the command

Tim

Then they most likely do not use ONVIF and use some other method of control. Suggest you use wireshark to spy on what the program sends as it may be something you can emmulate with the http binding. If they are not ONVIF, then their is no point in the trace logs as that would only show what is happening in the ONVIF traffic between the camera and the binding.

matt,

Thank you again,

Just curious, can’t IpCamera send a forced gotoPreset 233 etc ignoring it isn’t on the cameras list ?

It looks to me ODM and IpCamera are reading the list from the camera, getting 127 entries and denying a send of anything higher…

ONVIF Device Manager when selecting goto preset 1 or 2 work as expected so would think CMS/VMS are using a bastardized ONVIF just ignoring the read ? they don’t show a list of presets just a box to enter the number.

IpCamera binding correctly controls preset 1 and 2 I believe ODM and IpCamera are behaving spec wise reading the list from the camera but Barlus had to do this because there is no ONVIF commands for white or IR lamp control etc so they picked > 232 to stay away from generic presets < just spit balling here.

I thought of wireshark, because frankly these are under water cameras in my Koi Pond and wanted to automate turning the cameras lights on and off to not mess with circadian rhythm much, and use other ways to view :wink:

ODM does show that there are 1-127 presets and I can add and remove them but they don’t have any purpose. adding and removing 1-2 and 233 and greater have no effect on CMS/VMS working, but simply take away a means for ODM to select presets 1-2, adding them back they work fine again.

Using CMS and VMS with wireshark showed… was fun finding that in the log with 30 active connections heh heh

1¶ÃD…#º@E~µí@@'À¨fÀ¨¯Ú?a	#vPÇ&J7ÿxB{ "Name" : "OPPTZControl", "OPPTZControl" : { "Command" : "GotoPreset", "Parameter" : { "AUX" : { "Number" : 0, "Status" : "On" }, "Channel" : 0, "MenuOpts" : "Enter", "POINT" : { "bottom" : 0, "left" : 0, "right" : 0, "top" : 0 }, "Pattern" : "SetBegin", "Preset" : 233, "Step" : 0, "Tour" : 0 } }, "SessionID" : "0x5" }

Tim

I’m 99.9% sure that is not onvif which uses XML format. Yours is JSON which means it is probably easy to replicate it with the html binding or a script.

As already stated onvif MUST have a token, you can not send a goto preset x as it works by saying go to token x and without a token you can not send the command.

matt,

Thanx again, I’ll dig more toward the html path.

Tim

New build I’m testing if anyone is interested to trial as I found a big bug for ONVIF thing type that meant the onvif would not reconnect if the connection was broken by flakely wifi. Most likely it would have only been the onvif events that would have stopped whilst the rest kept working fine. Surprised no one reported this, so if you have troubles, this build has had the bug fixed for the past 5 days for me.

Index of /openhab/IpCameraBinding/ (pcmus.com)

1 Like

@matt1 Thanks for creating this update. I’ll give it a try as I have been been having significant problems with the ipCamera ONVIF Thing going OFFLINE and not returning to ONLINE. In reading through this thread and some of the comments made, I concluded that the problem must be on my end so I would need to deal with it. However, this issue seemed only to appear in recent releases. I’ve been running ipCamera since 2.5.x and all of the iterations in between to OH3.3 final release using a flashed EZVIZ Doorbell Camera. I ended up just creating a rule that Toggles the ONVIF Thing back ONLINE (Disable/Enable) when it went OFFLINE for more than 30sec. Its working, but I’d much rather have a binding that deals with this issue rather than a rule. I’ll report back with my results.