Reolink POE IP Camera Setup

Finally got person detection sensor to work. Added all my cameras and my E1 Outdoor person sensors were working but for my RLC-820As the person sensors were not working (on HA only, working on the Reolink app). After digging around I found that the RLC-820As had rtmp and rtsp ports disabled out of the box). You’d have to dig in to the advanced port settings on the web interface to turn them on. Person sensors started working after that. Hope this saves someone from banging their head against the wall.

2 Likes

In case it helps anyone getting their person, vehicle (and pet) detection working:

Manually download the latest firmware from Reolink (camera will not pick up that there’s a new version). Once applied, reboot the camera. Then, using the Reolink App, click on the cog next to the camera name, then Network Settings → Advanced → Port Settings (Set Up) → enable all options. If you want to enable the Pet Detection (Beta) option, you can do that in Camera-> Alarm Settings.

Then reload the Reolink Home Assistant integration.

Hopefully, as I found after hours of scratching my head, all the A.I. will be now working in HA, including Pet Detection.

Hope it saves someone some time.

3 Likes

@The_Flash and @bendarklighter may it be because, once enabled RTSP, also ONVIF get enabled, and ONVIF is required by reolink_dev to work?

Make sure ONVIF is enabled on your camera/NVR. It might be disabled by default and can only be enabled when you have a screen connected to the NVR, not via webb or app clients. Be aware that this can be reset during a firmware upgrade

(source)

Or you necessarily need both RTMP and RTSP?

I have the same question!

My REST commands stopped working after the last firmware update. Can’t figure out what changed.

I’m considering buying the new duo 2 180 degree camera.

I use frigate and realise I will have issues playing back h.265 streams.
On current h.265 cams how to people handle this? convert on the fly somehow or can the camera be forced into h.264?

Any thoughts appreciated.

You can force it to 264 stream if you select lower resolution. More on this in reddit thread

1 Like

Anyone know how to get the last recorded event video snapshot from the Reolink Camera (I am using Reolink_dev integration as well) ? I would like to set up some notifications

Thanks, picked up the duo 2 for $110usd in the aliexpress sale. I’ll see how we go managing 265 first, then consider dropping the res if i have issues.

Hi, I have the same problem.

I find this solution:

In resource field you had to use https instead http, in addition add the row verify_ssl: false.

I received my Duo 2 and after a fair bit of fiddling have it working with frigate, but only in H.265.

There are only two resolution options on the clear stream and neither causes the stream to fall back to h.264. So my only potential other option is to reencode it on the fly for recording. I tried a few methods without luck so far, but I am not overly familiar with ffmpeg so i’m sure I’ll figure it out eventually.

For now i’m recording in h.265 and I can download and play events on my computer, just not in most web browsers.

On my other cams (520s) I was using the http path for both main (record) and sub (detect) streams. I have found that the http path does not work for h.265 so I had to use the rtsp url for record.
I also found that rw_timeout is an incompatible input arg for this stream so had to overwrite the input_args without it.

inputs:
        - path: rtsp://admin:[email protected]:554/h265Preview_01_main
          roles:
            - record
          hwaccel_args:
            -hwaccel vaapi
            -hwaccel_device /dev/dri/renderD128
            -hwaccel_output_format vaapi
          input_args: 
            -avoid_negative_ts make_zero
            -fflags genpts+discardcorrupt
            -strict experimental
            -analyzeduration 1000M
            -probesize 1000M
        - path: http://192.168.1.X/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=password
          roles:
            - detect

With 5x 8MP reolinks that use H265 for mainstream and H264 for substream and one old RLC-511 i did the following to get working in frigate ~0.11 & 0.12+:

  • Turn hw accel off to get H265 to work reliably in frigate, i could not solve the ffmpeg argument hell. bought an old i5-6600 $40 on ebay just for this ;p
  • Switched browser of android device to chrome & use chrome exclusively for HA/frigate on my desktop to beable to playback H265 events.
  • use RTSP from Reolink NVR, they are solid, compared to RTSP direct from camera which can have time-drift
    – however, multiple frigate restarts in a small timespan will saturate the camera/NVR’s connection limit as they have really long timeout. I got around this problem by running rtsp-simple-server on same frigate box. This allows only one connection to be made to the cameras, and frigate can hammer the hell out of the rtsp-simple-server with no trouble. with my 6 cameras the cpu usage is a constant 5-20% from RTSP-simple-server.
    – In rtsp-simple-server i have 12 cameras in config, its one for each stream so like garageSD, garageHD, doorSD, doorHD etc… also dont forget to use sourceProtocol: tcp
    – dont forget to update frigate config to point to the rtsp server!!!
    – example RTSP-simple-server link to H265 reolink camera
garagedoorsd:
  source: rtsp://admin:[email protected]:554/h264Preview_01_sub
  sourceProtocol: tcp
garagedoorhd:
  source: rtsp://admin:[email protected]:554/h265Preview_01_main
  sourceProtocol: tcp
  • i ditched all input_args for sanity sake for testing. but i want to revisit them some day to fix recording fps, its like 9fps or something despite cameras set to 20+.
  • force frigate to just copy stream for recordings for huge cpu savings, i think this is default behavior but want to make sure!
#this is upper level, but you can put it in each camera if you want, remove -c:a aac if you dont want audio
ffmpeg:
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac

and finally the old RLC-511, this one has been a huge pain to solve. Im sure there is some magic input ffmpeg argument list… alas i never figured that out. To fix green & stuttering in frigate from main stream i had to use something called neolink. This converts the port 9000 stream into RTSP for use in frigate directly or in rtsp-simple-server. (for the rehcord, neolink works on my 810A, 811A, 822A & 842A but they dont need it)

trying to build neolink on linux is another challenge that i counlt figure out… bricked a linux install man the amount of googling… so i spun up a windows vm that does nothing but hog up 2gb of ram, 30gb disk space and 1% cpu just to run neolink…

1 Like

Thank you for this one. I appreciate all the work done by fwestenberg, but I much prefer the cleanliness of your solution.

I bought a reolink RLC-820A, connected it directly to the network and configured it via the Webinterface, works so far.
I added the reolink-integration (Reolink NVR/camera - Home Assistant) to my instance. So homeassistant found three entities for two streams and one for snapshot, which are working well. I expected also auto-configuration for motion-detection entiites. Perhaps I misunderstood this, do I have to setup these manually ? Which interface is used for getting this information? Onvif ? reolink push-notification ?
RTSP and ONVIF are activated in the webinterface, push-notification have I tried also. Is this integration only for NVR attached devices ? The camera runs the latest available firmware. Homeassistant core-release: 2023.1.6… I searched a lot here but i cannot see through :man_shrugging:. Hope somebody can bring a bit clarity.

The Reolink-integration is brand new in 2023.1, motion detection sensor will be added.

The standard HA integration for Reolink doesn’t support motion detection, but Fwestenberg made a custom integration that has to be installed through HACS.

This link does a good job of explaining how to install it.

Doing that will add the motion detection as entities and works fine.

I ended up going with a more lightweight solution instead recommended by @dncex higher up in this thread which uses the Reolink API.

Add the following to your configuration.yaml

Standard motion detection

binary_sensor:
  - platform: rest
    name: <NAME FOR YOUR ENTITY>
    resource: http://<URL OF CAMERA>/cgi-bin/api.cgi?cmd=GetMdState&rs=&user=<USERNAME FOR CAMERA>&password=<PASSWORD FOR CAMERA>
    method: GET
    value_template: '{{ value_json[0].value.state }}'
    scan_interval: 2
    device_class: motion

AI motion detection

binary_sensor:
  - platform: rest
    name: <NAME FOR YOUR ENTITY>
    resource: http://<URL OF CAMERA>/cgi-bin/api.cgi?cmd=GetAiState&rs=&user=<USERNAME FOR CAMERA>&password=<PASSWORD FOR CAMERA>
    method: GET
    value_template: "{{ value_json[0].value.people.alarm_state }}"
    scan_interval: 2
    device_class: motion

Replace this “{{ value_json[0].value.people.alarm_state }}” by the following according to what you’re after:

Person tracking: “{{ value_json[0].value.people.alarm_state }}”
Vehicle tracking “{{ value_json[0].value.vehicle.alarm_state }}”

I’m assuming pet tracking also works, but haven’t tested that.

Motion detection will be released with next HA release (2023.2)

That’s great - you might know of it already but in case not it might be worth taking a look at how the reolink_cctv custom component is working atm

I’m particular the way they handle the cameras via an NVR is much cleaner - and notifications seem quite quick (core is quick too but there is a bit of a delay side by side)

Appreciate this being in core - just think reolink_cctv is less well known than the other 2 custom components but works much better (imho)

NVR still has some delay with this component, though the only I saw was last record not updating correctly but direct connections are quick

Thank you all for the answers :+1:. So I’m looking to the 2023.2-update, test this and then see further which solution will fit my needs.

Thats good to hear so I will wait not to use other integrations and see what the update brings next week.

Do you know if this includes all 3? people, pet and car?