Reolink E1 Zoom and/or Pro in HA

I took advantage of an online offer to replace my 720p cameras (documented in their own saga 2 years ago ( Fun had with Vstarcam C7837WIP ) with several 5MP Reolink E1 Zoom cameras (most of which were later replaced by E1 Pros which had the new LAN port I really missed in the case of the Zooms).

Reolink seem like a good option in Europe because of their decent pricing, lack of availability of the Amcrest cameras the US users seem crazy about and pretty good online guides available. While those guides on Reolinkā€™s website were very useful in plugging in some gaps, I could not find one place on the Internet which would teach me to:

  • have cloud-free control over the cameras
  • have full pan-tilt controls working in HA
  • have access to the position presets in order to use them in automations
  • have local motion detection & notifications sent to Telegram

I initially tried to use Blue Iris, but that did NOT go well (at least not with the Zooms, the cameras would be added and then appear disconnected after a few mins, even though they worked fine in their web UI, the local Reolink apps, HA, etc.), so I tried to have everything I needed in HA, which did ultimately go perfectly.

  1. After connecting the cameras to WiFi via the Reolink mobile or Windows apps, assign static IPs to the cameras, either via DHCP reservations on your router or from the apps
  2. Add the ONVIF integration to HA, with the camera settings being their allocated IPs, port 8000, user ā€œadminā€ and password whatever you set in the initial app-based setup
  3. Add whatever position presets you need in the Reolink app (in the list of positions 1 in Reolink = ā€˜000ā€™ in HA, 2 = ā€˜001ā€™ in HA and so on) - this only worked in Windows or the web UI (no web UI exists on the E1 Pros, though), on my Galaxy S20 the mobile app had a bug which made the preset editor disappear every time I tried to add a preset
  4. Create a Lovelace card:
type: picture-glance
title: Living Room
camera_image: camera.living_room_new_camera_profile000_mainstream
camera_view: live
entities:
  - entity: camera.living_room_new_camera_profile000_mainstream
    icon: 'mdi:arrow-down-drop-circle-outline'
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.living_room_new_camera_profile000_mainstream
        tilt: DOWN
        move_mode: ContinuousMove
  - entity: camera.living_room_new_camera_profile000_mainstream
    icon: 'mdi:arrow-up-drop-circle-outline'
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.living_room_new_camera_profile000_mainstream
        tilt: UP
        move_mode: ContinuousMove
  - entity: camera.living_room_new_camera_profile000_mainstream
    icon: 'mdi:arrow-left-drop-circle-outline'
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.living_room_new_camera_profile000_mainstream
        pan: LEFT
        move_mode: ContinuousMove
  - entity: camera.living_room_new_camera_profile000_mainstream
    icon: 'mdi:arrow-right-drop-circle-outline'
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.living_room_new_camera_profile000_mainstream
        pan: RIGHT
        move_mode: ContinuousMove
  - entity: camera.living_room_new_camera_profile000_mainstream
    icon: 'mdi:wall'
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.living_room_new_camera_profile000_mainstream
        preset: '000'
        move_mode: GotoPreset
  - entity: camera.living_room_new_camera_profile000_mainstream
    icon: 'mdi:sofa'
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.living_room_new_camera_profile000_mainstream
        preset: '001'
        move_mode: GotoPreset

  1. Create scripts that access the presets if you want automations like ā€œTurn the cameras to the wall when I get homeā€
living_room_camera_back_to_wall:
  alias: Living Room Camera Back To Wall
  sequence:
  - service: onvif.ptz
    data:
      entity_id: camera.living_room_new_camera_profile000_mainstream
      preset: '000'
      move_mode: GotoPreset
living_room_camera_room_view:
  alias: Living Room Camera Room View
  sequence:
  - service: onvif.ptz
    data:
      entity_id: camera.living_room_new_camera_profile000_mainstream
      preset: '001'
      move_mode: GotoPreset
  1. If you need to use the camera live jpeg snapshot, its format is this:

For the E1 Zoom:

http://192.168.x.x/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=YOURPASSWORD

For the E1 Pro (which doesnā€™t have a web UI, so the link above doesnā€™t work) I used the HA snapshot service and integrated it into my door opening automation like this:

- alias: Front Door Opened Florin
  trigger:
  - platform: state
    entity_id: binary_sensor.front_door_sensor
    to: 'on'
  action:
  - delay: '7'
  - service: camera.snapshot
    data:
      filename: /config/www/snapshot.jpg
      entity_id: camera.living_room_camera_lan_profile000_mainstream
  - service: notify.telegram_florin
    data:
      title: Front Door Opened
      message: Your front door has been opened.
      data:
        photo:
          - file: /config/www/snapshot.jpg
  1. Motion detection & notifications: I wanted something relatively easy to use and configure that would also be on the same server as HA, so I installed the MotionEye addon & integration (I realize that people can just use MotionEye for everything instead of the ONVIF integration, but I still prefer not running an NVR all the time).

In the MotionEye addon config you use the camera RTSP link:

rtsp://CAMERAIP:554//h264Preview_01_sub

For motion detection performance reasons, I used the link for the 640x480 substream, itā€™s _main instead of _sub for the full-res stream - I did this because I can just create the snapshot from the full-res stream, no need for a stream Iā€™ll never look at to be high-res.

In the MotionEye addon settings, all you need to enable are Motion Detection & Motion Notifications.

Motion Detection you can mess around with to suit your environmentā€™s settings, as its sensitivity depends on what you actually wish to capture.

Go to your HA Account (your name in the sidebar) and get a long-lived access token and copy it.

In configuration.yaml, create these:

binary_sensor:
  - platform: template
    sensors:
      yard_motion_sensor:
        entity_id: input_boolean.yard_motion
        device_class: motion
        value_template: '{{ is_state("input_boolean.yard_motion", "on") }}'

input_boolean:
  yard_motion:
    initial: off

Restart HA, then go to MotionEyeā€™s addon settings, Motion Notifications & you should enable:

Run A Command:

curl -X POST -k -H ā€œAuthorization: Bearer YOURTOKENā€ -H ā€œContent-Type: application/jsonā€ -d ā€˜{ā€œentity_idā€: ā€œinput_boolean.yard_motionā€}ā€™ http://YOURHAIP:8123/api/services/homeassistant/turn_on

Run An End Command:

curl -X POST -k -H ā€œAuthorization: Bearer YOURTOKENā€ -H ā€œContent-Type: application/jsonā€ -d ā€˜{ā€œentity_idā€: ā€œinput_boolean.yard_motionā€}ā€™ http://YOURHAIP:8123/api/services/homeassistant/turn_off

Now, what these will do is create two entities, one a boolean which will be fed by MotionEye with the occurence of motion, and one binary sensor which will translate that into an on/off state that can be used in automations.

Finally, hereā€™s the adapted automation from above for the MotionEye motion detection entities - once motion is detected, a snapshot is made by HA with the cameraā€™s proper high-res stream and sent to you via Telegram:

- id: 'HAgeneratedid'
  alias: Yard Motion Florin
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.yard_motion_sensor
    to: 'on'
  condition: []
  action:
  - service: camera.snapshot
    data:
      filename: /config/www/yard_snapshot.jpg
    target:
      entity_id:
      - camera.yard_camera_profile000_mainstream
  - service: notify.telegram_florin
    data:
      title: Yard Motion
      message: There is motion in the yard.
  - service: notify.telegram_florin
    data:
      title: Yard Motion
      message: There is motion in the yard.
      data:
        photo:
        - file: /config/www/yard_snapshot.jpg
  mode: single
  initial_state: 'on'
  1. Enjoy!

P.S. - It has in the meantime come to my attention that Reolink cameras use some weird P2P network thing for access outside the house. Thus, even if you only assign an internal IP and never sign up for any account with them, their app allows you access to the cameras from outside the house via a process described at http://www.nozominetworks.com/blog/new-reolink-p2p-vulnerabilities-show-iot-security-camera-risks/ - I highly recommend blocking their Internet access at router level and using HAā€™s NTP addon for time sync + a VPN (like the HA Wireguard addon) to get to them from outside the house.

This approach does not work with their official phone app (killing their Internet access makes them only work via the webUI and Windows app from within the LAN from what I can see), but works fine on the phone with a VPN and apps like tinyCam.

P.S. 2 - Although not really made clear until you try to Add To Cart on the Reolink website, the E1 Pro camera now has an option with a LAN port! You get a 16:9 picture instead of 4:3, 4MP instead of 5MP and lose the optical zoom and the web UI, but it is soooo much better than any WiFi camera (and cheaper than the E1 Zoom).

57 Likes

Thanks for the write up!

Iā€™m just setting up an E1 Pro. I have the ptz working following your guide, but not the presets so far. They are working in the Reolink app, but from HA nothing happens so far. Will keep digging.

2 Likes

This guide worked great! Thank you very much!
By any change do you use homekit? Would be a great addition to this tutorial.

All my attempts at configuring this in homekit, results in snapshots working successfully and updated every 10 seconds, but live stream never works :frowning:

@Bold, I can only imagine that the Preset IDs must be an issueā€¦if you edited several in the Reolink app, their IDs are not too clear, like I saw that if I had 3 presets and deleted Preset 1, the next one I created had Preset 1ā€™s ID internally or smthn, so just try several numbers there until you hit upon the one you want.

@sergio_pt, sorry, not a Homekit houseā€¦no idea what limitations exist in Homekit for non-official cameras.

OOOHHHH MYYY GAWWWDD
Iā€™ve been trying to integrate my E1Pro for about a year.
Iā€™ve even moved 2 apartments in the process.
This worked flawlessly! (I mean, as youā€™d except from HA and PRC made products)
Once I figured the correct spell words, bish bash bosh, and PTZ is alive!

2 Likes

Thanks a lot for the guideline. Really works well with the ONVIF integration. However since I have the E1 pro I can confirm that

  1. the motion detection url and the snapshot url do not work
  2. the presets are not discovered/exposed
    Hope thatĀ“s getting fixed in some future firmware upgrades by Reolink.
    BR

Hi,

I just integrated with a E1 Zoom and also the presents donā€™t work.

I created them on the app but for example on the logs of homeassistant is seems empty

  • PTZ preset ā€˜000ā€™ does not exist on device ā€˜realink cam 1ā€™. Available Presets:
  • PTZ preset ā€˜001ā€™ does not exist on device ā€˜realink cam 1ā€™. Available Presets:
  • PTZ preset ā€˜002ā€™ does not exist on device ā€˜realink cam 1ā€™. Available Presets:

Ha, thatā€™s strangeā€¦in my case it said Available Presets: 002, 003 or smthn. Do the presets work in non-Reolink apps like TinyCam?

You probably already figured this out, but for the sake of new people who are having the same error:

Reload the ONVIF integration after creating presets in the app, then the code will work.

6 Likes

Not working on standard E1. the process stop on first step with the onvif integration.
I put the IP address, port 8000 and when it ask me for user and password after I write it I receive and unknown errorā€¦
Any idea?

1 Like

Look at what the main HA log says when you get the error and maybe we can helpā€¦

I thought the standard E1 doesnā€™t have onvif.

Standard E1 doesnā€™t have ONVIf support, but the Baichuan protocol has been reverse engineered so if youā€™ve got spare processing power on your HA server you could theoretically run neolink and then stream the resulting RTSP stream into HA as a generic camera. Iā€™ve got this set up here and itā€™s working pretty well, although I havenā€™t figured out how to capture stills yet.

2 Likes

I have the E1 zoom and get the same error. Do I need to enable ONVIF in the camera some how?

Iā€™ve also noticed there is a HACS integration for the Reolink cameras. I might try that as well.

1 Like

Works like a charm in docker on my side :smile:. Glad i donā€™t have to replace the E1 with E1 pro

2 Likes

Iā€™m so happy Iā€™ve found your article @johnflorin !
I was already able to connect my RLC-510A and 520A cameraā€™s, and bought some C1 Pro.
They are discontinued, but beautifully black which is way better in our household.
Yes, the E1 Pro (or Zoom) has better specifications, but for me the C1 Pro in the living room and hallways are just fine.

Anyway, I did the trick youā€™ve shared and it was very simple, thanks for that!
Now I can use some presets via HA, which I didnā€™t even knew they were there :wink:

I wanted to add, that ƍā€™m using an easier way yo create live snapshots from my cameraā€™s, which I use a lot with all of them. When somebody is at my frontyard, backyard, opens my backdoor etc. etc.

Instead of what youā€™ve pointed out in #6, this is also working just fine:

image: /api/camera_proxy/YOUR_ENTITY_NAME

What are your thoughts andā€¦maybe youā€™ve created some nice triggers/scripts/automations , which you want to add in your original post?

Thanks again!

1 Like

I donā€™t really get how to use the camera_proxy image link you posted above, can you please share your automation that includes it? I bought an E1 Pro today and it does not work at all with the previous snapshot type used in the E1 Zoom.

@johnflorin, many thanks for the clear guide I had quite easy life in integrating my E1 Pro.
Everything works like a charm, however, the only trouble Iā€™m facing right now is to see the camera from HA web browser, video itā€™s all scattered and lagged. On the other hand in my smartphone HA app it works perfectly. Maybe is an issue related to my laptop.
Here below my configuration in case this may help other fellas.

type: picture-glance
title: Salotto
camera_image: camera.salotto_profile000_mainstream
camera_view: live
entities:
  - entity: camera.salotto_profile000_mainstream
    icon: mdi:arrow-down-drop-circle-outline
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.salotto_profile000_mainstream
        tilt: DOWN
        move_mode: ContinuousMove
  - entity: camera.salotto_profile000_mainstream
    icon: mdi:arrow-up-drop-circle-outline
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.salotto_profile000_mainstream
        tilt: UP
        move_mode: ContinuousMove
  - entity: camera.salotto_profile000_mainstream
    icon: mdi:arrow-left-drop-circle-outline
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.salotto_profile000_mainstream
        pan: LEFT
        move_mode: ContinuousMove
  - entity: camera.salotto_profile000_mainstream
    icon: mdi:arrow-right-drop-circle-outline
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.salotto_profile000_mainstream
        pan: RIGHT
        move_mode: ContinuousMove
  - entity: camera.salotto_profile000_mainstream
    icon: mdi:sofa
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.salotto_profile000_mainstream
        preset: '000'
        move_mode: GotoPreset
  - entity: camera.salotto_profile000_mainstream
    icon: mdi:door
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.salotto_profile000_mainstream
        preset: '001'
        move_mode: GotoPreset
  - entity: camera.salotto_profile000_mainstream
    icon: mdi:stove
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.salotto_profile000_mainstream
        preset: '002'
        move_mode: GotoPreset
  - entity: camera.salotto_profile000_mainstream
    icon: mdi:wall
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.salotto_profile000_mainstream
        preset: '003'
        move_mode: GotoPreset

I also created a couple of scripts to be utilized when my alarm is off/on

alias: Camere Attive
sequence:
  - service: onvif.ptz
    target:
      entity_id: camera.salotto_profile000_mainstream
    data:
      preset: '000'
      move_mode: GotoPreset
mode: single
icon: mdi:camera
alias: Camere Off
sequence:
  - service: onvif.ptz
    data:
      preset: '003'
      move_mode: GotoPreset
    target:
      entity_id: camera.salotto_profile000_mainstream
mode: single
icon: mdi:camera-off
1 Like

Great tip, E1 pro integrates nicely. However, there is a big lag/latency in the stream. Both in the standard picture glance and in the pop-up. Anyone with an idea?

1 Like

I personally have 5 seconds delay, which honestly I think isnā€™t that bad.
My biggest concern is that I donā€™t think we canā€™t implement the motion detection, at least with my E1 Pro.