Adding Reolink API to the IpCamera binding, beta testers needed

With trace debug enabled I noticed I was getting authentication issues.
Seems passwords with mixed lowercase/uppercase characters are not a good idea.
The authentication problems disappeared when using all uppercase characters.

On initialization I’m seeing a lot of get commands returning valid data.
Still no luck with the enablePush command though.

When setting the channel to ON:

Closing an idle channel for 192.168.1.150/api.cgi?cmd=SetPushV20&token=bc63c735648f02d

To OFF:

16:27:43.801 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: POST: http://192.168.1.150:80/api.cgi?cmd=SetPushV20&token=bc63c735648f02d
16:27:43.874 [TRACE] [mera.internal.handler.IpCameraHandler] - HTTP Result from /api.cgi?cmd=SetPushV20&token=bc63c735648f02d contains  :[
   {
      "cmd" : "SetPushV20",
      "code" : 0,
      "value" : {
         "rspCode" : 200
      }
   }
]

Also tried disabling the token but same result.
Going to try your new build now.

Edit: same result with new build.

Ah, I remember when I updated from 4.3.2 to 4.3.6-1 I removed the ipcamera jar from addon folder and used the original addon.

The enable/disable ftp didn’t work too, so I removed it again and added my old ipcamera.jar.

Greets..

Try a different firmware then as the camera is saying the API command was accepted. From asking AI if the camera works in other HA platforms, it appears it does not, but can if you use a home hub or one of the Reolink NVRs that will expose the camera via the API.

I came across this issue: Push notification · Issue #635 · fwestenberg/reolink_dev · GitHub
Just did some testing and this indeed seems to be the case.
The push notification button in the app is probably a per phone setting, globally the push notifications can be set using the api.

I have got the Altas PT Ultra connected to the Hub and it works

@matt1 I installed Openhab 5 now an did a complete new installation. The fix you made seems now integated in the binding. Very good.

I experimented with the status quo and as you told: When changing to a different page I get this message:

19:40:43.490 [DEBUG] [camera.internal.servlet.CameraServlet] - Now there are 0 ipcamera.mjpeg streams open.
19:40:43.494 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Stopping ffmpeg MJPEG now when keepalive is: 8
19:40:43.495 [DEBUG] [camera.internal.servlet.CameraServlet] - All ipcamera.mjpeg streams have stopped.


It would be helpful to have the possibility to switch on or off the “restarting feature” you added via a parameter in the binding. what do you think?

Hey, I don’t know where to put.

I was in contact with Reolink support, they have really the willing to help.

I tried to get 2way audio running without any solution. They are working on it an it is foreseen to implement a official solution for home assistant.

As workaround in my case I got a new API CMD command, which I want to share with you. With this you get a list of prepared short sound’s/notifications which you can manually create in the app and play as sound at the door bell:

[{
“cmd”: “GetAudioFileList”,
“action”: 1,
“param”: {
“channel”: 0
}
}]

You need to pick the correct ID of this list for the sound you want to play. To play the sound at the door bell:

[{
“cmd”: “QuickReplyPlay”,
“action”: 0,
“param”: {
“id”: 0,
“channel”: 2
}
}]

With this solution I can see now the live video with Ipcam binding, I can send via a switch a sound like ”The door is open, please step in” and in combination with a Shelly in my case I switch the dooropener on for 8 seconds.

Maybe someone need this too. It is not documented in the current API specification.

Github is the best place to put requests like this when you provide methods. It would be helpful to give examples of what your camera returns to each of the above so it can be added. See the first post of this thread on how to create a curl command to send to your camera.

@matt1 what is the best way to install this binding for OpenHAB 5 milestone?
Nevermind, scrolled up a bit and found the link.
Installed the binding and my reolink doorbell is now recognized, the doorbell button is active and even the person recognition is working. Still fumbling with the feed url but other than that it’s looking great!

Update:
Black Poe reolink door bell seems to be working!
I’m having trouble in understanding the url streams, it generates an url with my OpenHAB ip instead of the doorbell but the snapshot is working and I get the door bell click also so that’s quite good right now.

@matt1 Feedback on Reolink Lumus Pro and Reolink E1 Outdoor, OH5.0.2 release build:

both Cameras were immediately recognized by the IpCamera binding.

Channel “enableMotionAlarm” does not change anything, I think this feature is not available on these cameras? at least I did not find a equivalent button in the Reolink App.

Channel “lastMotionType” always reports motionAlarm, no matter if it is humanAlarm, animalAlarm or carAlarm.

Channel “lastEventData” is not reporting, I tried with item type String and DateTime, it stays NULL

Channel “enablePush” enables or disables PushNotifications. unfortunately the reolink App does not reflect the update. whereas enableFTP and enableEmail do reflect the update in the App.

I can also confirm that channels motionAlarm, enableEmail, enableFTP enablePush, humanAlarm, animalAlarm, carAlarm, whiteLED, autoLED work as I would expect.

I did not test other features as I only want to automatically arm or disarm the cameras when I’m leaving/coming home. I also enable/disable autoLED to save some kWh by disabling autoLED when cameras are disarmed.

lastMotionType and lastEventData would be nice if they could work.

thanks for your work to integrate the Reolink API!

@matt1 hey!! Are you still working on this binding? I got a reolink E1 zoom, and it has children crying detection.
I thought that perhaps the audio alarms would trigger when the crying was detected or the lastmotiontype would bring something but in fact it doesn’t. I checked the HA integration and it mentions: * AI baby crying detection+ (sound detection)
Here: Reolink - Home Assistant

Is it something you can add? Cheers!

I would have to take a look at it next time I am working on the binding, so please raise a GitHub issue for it as I will look there when making other changes. Interesting AI feature that I have not heard of cameras having before. I actually started this binding as I wanted to create a baby monitor out of a normal camera using openhab to notify and display the feeds. Worked well especially as the cameras noise reduction meant the live feed did not transmit the white noise but we could hear the baby when they made a noise.

Understood! Created two:

Thank you for your support! It seems that the home assistant reolink integration has improved a lot, hope it’s easy to pick stuff up from them :smiley:

It should be pretty simple to add it if you can provide the TRACE level logs for when the crying detection is triggered and also when it is not triggered.

You should see a line like this

HTTP Result from /api.cgi?cmd=GetAiState contains \t:{xxxxxxxxxxxx}

You have to change the binding into TRACE level logging to see this.

As for moving the camera, that may be missing support in the camera especially since you said it works with presets. Can you install a free program called “onvif device manager” and test if the camera works in other OPVIF methods, as there are 4 ways to move the camera and its very common that some of them are missing from a camera.

ABSOLUTE

RELATIVE

continuous

PRESET

The binding has all 4 methods implemented, but you have to choose one that your camera supports. The WIDGETS in the marketplace make it easy to move your camera in all of these modes.

Cheers for the feedback!
I’m going through the logs now. With the binding in trace:

I setup a baby crying video for about 30 minutes. The camera, which btw has internet blocked, so nothing is getting out, detected the baby crying.
I got motion and person alarm on the logs, but no baby crying. Should I be looking elsewhere?

@matt1 I found the original request in home assistant. I see star killer there mentioning that reolink uses different protocols for different purposes, maybe worth a read:

And this is the PR to add it to the home assistant plugin:

Hope this helps more than what I could until now :smiley: