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.
- 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
- 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
- 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
- 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
- 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
- If you need to use the camera live jpeg snapshot, its format is this:
For the E1 Zoom:
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
- 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'
- 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).