Reolink NVR to Home Assistant Issue

Hello Everyone,
I’m pulling my hair for a few days now. I have 6 Reolink RLC-810A cameras connected to NVR Model RLN8-410. I added Reolink Integration from HACS and tried to add my cameras to HA however when i log in it does not show my cameras, see the picture below

If I connect my cameras to the switch directly (not using NVR) I don’t have any problem!

Before you ask The ONVIF protocol is enabled on the NVR!

I could kill to make the NVR work with my HS, Please HELP

3 Likes

I too was having issues with motion detection, so I went with this method

Reolink NVR Camera(s) in Home Assistant
For example, if your Reolink NVR has the following information,
IP address: 192.168.86.17
username: admin
password: 123456
You may also change the channel number (starts at 0) to recieve different channels.
Motion detection (configuration.yaml)

binary_sensor:
  - platform: rest
    resource: http://192.168.86.17/api.cgi?cmd=GetMdState&channel=2&user=admin&password=123456
    name: Carport
    scan_interval: 2
    value_template: '{{ value_json[0].value.state }}'
    device_class: motion

  - platform: rest
    resource: http://192.168.86.17/api.cgi?cmd=GetAiState&channel=2&user=admin&password=123456
    name: Carport Vehicle AI
    scan_interval: 2
    value_template: '{{ value_json[0].value.vehicle.alarm_state }}'
    device_class: motion

  - platform: rest
    resource: http://192.168.86.17/api.cgi?cmd=GetAiState&channel=2&user=admin&password=123456
    name: Carport Person AI
    scan_interval: 2
    value_template: '{{ value_json[0].value.people.alarm_state }}'
    device_class: motion

  - platform: rest
    resource: http://192.168.86.17/api.cgi?cmd=GetAiState&channel=2&user=admin&password=123456
    name: Carport Pet AI
    scan_interval: 2
    value_template: '{{ value_json[0].value.dog_cat.alarm_state }}'
    device_class: motion

Camera (configuration.yaml)

stream:
camera:
  - platform: generic
    name: Carport
    still_image_url: http://192.168.86.17/cgi-bin/api.cgi?cmd=Snap&channel=2&rs=Carport&user=admin&password=123456
    stream_source: rtsp://admin:[email protected]:554/h264Preview_03_sub

Use Picture Glance Card to view camera in HA

Works flawless

10 Likes

@tteck Thank you! This worked to obtain motion events from my Reolink cameras via the NVR. Great work

1 Like

Great! light and performing, in fact it is of little use to see the video streaming, the important thing is to be able to intercept the alarms !!!
THANK YOU!

2 Likes

Hi, silly question, do I just add these lines to the configuration.yaml file? You have mentioned “Motion detection (configuration.yaml)” and " Camera (configuration.yaml)"

Yes, if you don’t have a split configuration.

Does this work with the pet/animal detection?

Would it just be: value_template: ‘{{ value_json[0].value.animal.alarm_state }}’?

I’ve added all these sensors I’m not getting any updates, it always shows clear. Any ideas?

1 Like

Not sure what they’re calling it (not running that firmware), try “pet” :man_shrugging:
I’ll update if I find anything.

hi @rjmcfadd
for the pet detection, it’s : value_json[0].value.dog_cat.alarm_state

1 Like

Thanks @tteck and @mnpg! I tried that but I’m not getting any motion events from any of the AI sensors.

Probably of use to anyone interested in this — Reolink just posted an updated guide to their API, at Reolink Camera API User Guide_V7 (Update in Sept 2022) | Reolink Community.

Of course, this method includes making a http request per sensor frequently — in the example given, every two seconds. It’d be nice of the NVR itself could trigger webhooks — or have native MQTT! (There is a request for such on their forum, but not much attention.)

Yeah, that’s rediculous. Most of the time that doesn’t work since the camera is too busy processing the detection and recording to reply back with the status. That’s why I think the reolink integration for HA is so unreliable. … Anyway MQTT would be the best, I already made a comment on their main ask customers what they want forum here: Get to Know Your Customers Day: Tell Us What You Want! | Reolink Community We just need to upvote it I guess :man_shrugging:

1 Like

Good news is that they are working on webhooks — a little buried but this comment indicates that they plan beta firmware for at least some cameras in the next couple of months.

Nice find, I saw your comment in there. Thanks for the vote-up. I also noticed there is a new Reolink integration that apparently fixes all the issues with reolink-dev. It’s here: GitHub - JimStar/reolink_cctv: Home Assistant Reolink NVR/cameras addon I tried it and it works really well for me!

1 Like

The problem with the sensor method is that you are querying the camera every 2 seconds and if you have 5 sensors that’s a lot of querying. I have 10 cameras which would result in 40 sensors checking urls every 2 seconds. On top of it, you are using http with a user and pass right in the url :slight_smile:
The new Reolink integration uses onvif so you actually get notifications pushed instead of constantly checking urls.

1 Like

Is this working for you for notifications? I turned on ONVIF on the NVR, but all of the various sensors are reporting Clear. They trigger on the app just fine.

Also video playback seems flaky – works occasionally, but usually stalls out. Tried all of the protocols – still image works best (except all of the downsides).

That integration also seems to do a bunch of “username and password right in the URL” too, though – seems like that’s the protocol.

I don’t have NVR so I connect directly to the cameras. I have 10 POE Reolink cameras and the notifications all do work if they are present in the Reolink app. I actually verified this against notifications in the app side by side as the previous Reolink_dev plugins missed about 60% of the notification.

What helped me a lot in clearing Auth errors in the log is moving the 2 sliders in the camera plugin config all the way to the right (something like timeout and subscription). RTSP stream works smoother for me so try that. I don’t think anything can be done about user and pass in the url as it’s how Reolink api works.

I always have had just okaish performance with any camera stream in HA, I think the issue is the size of the stream so it takes a while for it to actually connect and work. I had really good success with WebRTC Lovelace card by AlexxIT. But even with that having 10 cameras request WebRTC stream doesn’t give instant results. Again this is not related to the plugin as the plugin just provides the direct stream.

In Lovelace now I switched to use GitHub - dermotduffy/frigate-hass-card: A Lovelace card for Frigate in Home Assistant Card. You dont need Frigate for it to work and it works with any camera entity, it also automtically decides the best way to stream it (It can even fallback to AlexxIT WebRTC from above).

I have those cards setup to automatically switch to camera with motion when motion is detected and start playback. So all my cameras load on screen at once and are shown as an image that’s updated every few seconds. If any of the cameras have motion those cameras starts live playback automatically and are highlighted (you just define which entities are triggered in the card config).

You can also configure it through UI so you don’t have to worry about all the options that are in the doc.

I’ll try those settings.

I am using an NVR, though, so I think that’s probably most of the trouble. The github page mentions a known problem where the NVR only gives ONVIF notifications for AI events for the camera on the first channel, but I’m not even seeing those.

Post the issue in that plugins discussion thread the author actually has an NVR himself so it should be easier to troubleshoot.

1 Like