If your keen to take it on, I can do 80% of the work needed in a few hours saving you from needing to learn how the binding works.
I’m willing to take it on. The FOSCAM code seems pretty straight forward (although those are often famous last words). Seems like we can keep most of the structure and just update the CGI syntax and result parsing. I’ll start working through the developers guide. While I’m working on that, do you want to take an initial stab the new Reolink handler class? I can then use that as a base line to troubleshoot/debug.
hi, i’m using Reolink too. Camera, not NVR.
per onvif I get only the motion detection signal.
Somewhere in the internet i found a list for the api commands and i use the http binding for polling a person alarm state.
Thanks for the info. I hadn’t thought to look into using the HTTP binding. I think I’m going to continue to pursue the IP Camera Binding option right now as I’m interested in some of its built in features, but might use this as a fall back.
At what rate do you have to poll to make sure you don’t miss an event?
Every 3 seconds.
It’s enough for me…
I use both… Ptz preset is working fine with ipcamera binding… And the snapshot and video stream…
I use the http binding just for person detection.
For anyone that comes across this thread, I can confirm that you can use the HTTP Binding to poll the AI state with an NVR system. To access different cameras on the NVR, you simply need to change the channel reference accordingly: IPofCam/api.cgi?cmd=GetAiState&channel=0&user=aaaa&password=aaa. I should note that, you need to have the firmware v3.0.0.148_21101146 or above installed on your NVR. Prior to that, the AI option doesn’t work through the API.
One of the downsides of this approach, is that you username and password are stored in raw format within the Thing definition. There is likely a way around this, but I haven’t delved too deep into it.
It is far better to use the ONVIF methods as they are event based and the events get pushed to the binding, where how your doing it with the http binding is polling and not as good as event based methods. If you place the binding into DEBUG level logging it will tell you if the camera is reporting events that the binding does not have implemented and if you post this info, it can be added very easily.
@azureshammer Let me know when your able to compile the code and create a jar. I think the best way forward would be to use ONVIF if the dvr channel is 0, and for numbers above this, it could switch to polling so people get the best of both worlds. But this requires someone to test that actually has a camera. I would not be surprised if the API polling has added benefits and extra features. For example with Dahua and Hikvision if you get a Line Crossed alarm, the API can tell you which direction the line was crossed so you know if someone if walking towards or away from your home.
I don’t know anything about reolink but I have noticed that there is a working solution for home assistant, might give you some ideas on how to integrate it.
Hi there, I’m using a Reolink E1 outdoor (no NVR) and I would be happy to provide a debug log. Unfortunaly I’m currently stuck with OH 3.0.2 as I need to fix a backup issue. Let me know if this (OH 3.0.2) isn’t an issue.
Just only the CellMotion Event.
In the http binding I saw person alarm…
Do I need to link an item? Or are all onvif Events logged? I have linked only cellmotion alarm to an item.
Maybe trace log?
NO, the logs will show any event that the camera sends exactly as you have shown. This means the camera has to recognize a person to send the event and for it to show up in the logs. Some cameras are slow and not reliable at detecting a person so give it some more time standing in front of the camera without wearing a cap/hat.
Great but that will be using the API method and not using ONVIF method. The ONVIF method is better as it is using the PUSH method, whereas the API is using the POLLING method. If you camera can only send it via the API (perhaps that is the case or you have an older firmware) then that is another reason to implement the API into the IP Camera binding which is very easy to do and sounds like we have a few users that are keen to look at it.
That would be great if you can contribute those soon as I will hold off making any changes until yours are made so that we can prevent any merge conflicts that may happen.
hi, me again.
I wanted to try the Onvif Events with “Onvif Device Manager”.
I was not able to get a subscription for the Onvif Events , “400 Bad Request”.
After a reboot of the Cam I got a connection with Onvif Device Manger.
But there are also no Person Alarms… Just CellMotionAlarm… damn
I tried Trace Log from the Ipcambinding and found the following:
is it possible that the "Method ‘Unsubscribe’ not implemented: " didnt let me subscribe to the Onvif Events with ‘Onvif Device Manager’? Was it locked by the ipcamerabinding?
I hope you know what I’m talking about
I tried it again. There are definitely no (onvif) people alarms to be found in the log.
Only the cellmotionalarm is displayed.
So no onvif with my Reolink E1 Outdoor cam.
Maybe with a firmware update in the future.
I stay with my http polling…
Greets.
Haven’t you received my earlier email (9.7.) at all or was it cut off in the middle?
I’m aware that PR is the preferred option.
Since you mentioned you are in a hurry and i was offline for a week, to shorten it up, i send you the diifs (giving it another try, i.e. diffs attached below).
As mentioned, i’m facing access violation issues with the token.
Please let me know whether the diffs now made it.
In doubt i can give’m another try with the token at the weekend.
What i did: checkout, create branch, changed to the branch, added my changes on the branch, commited them and tried to check the branch in again.
With last step i got rejected, due to insuffiant access rights.
@matt1 I’ve started coding up a ReolinkHandler class, but have a few comments and questions:
It doesn’t look like the Reolink NVR allows for ONVIF functionality, only direct connection with a camera on the network (although I haven’t explicitly tried this). So, the NVR systems will have to only use polling. Not quite sure how to handle these two options.
I don’t understand how/when the readChannel method is called. Is it called after every HTTP request?
In the handleCommand method, what is the “refresh” portion of the code doing?