Controlling PTZ of a Reolink camera using buttons

I got a Reolink E1 Zoom camera which I have integrated with Home Assistant using the official integration. Now I am playing around with possibilities to control the camera using buttons in a dashboard.

To start with I have created a Picture glance card according to the description the Picture glance documentation.

I have added buttons to pan the camera to the left and to the right. The problem is that when I press the buttons the camera pans correctly to the left and to the right, but with just one short press it always goes the full left (or full right), ie almost 180 degres.

So, is there any way to control the panning of the camera so it pans in smaller steps?

The yaml code for the picture glance card looks like this:

camera_view: live
type: picture-glance
entities:
  - entity: button.e1_zoom_ptz_left
    icon: mdi:pan-left
    tap_action:
      action: call-service
      service: button.press
      data:
        entity_id: button.e1_zoom_ptz_left
  - entity: button.e1_zoom_ptz_right
    icon: mdi:pan-right
    tap_action:
      action: call-service
      service: button.press
      data:
        entity_id: button.e1_zoom_ptz_right
camera_image: camera.e1_zoom_fluent
title: Gårdsplan
1 Like

I am facing the exact same issue. Did you find an answer please?

I found the below video, seems like the ONVIF integration is better to control the PTZ for Reolink cameras (he mention this around 6:00 into the video). So I used ONVIF instead.

Thank you for your reply. I have got it working. Need to sort out 2-way audio next!

Mind sharing how you solved it?

Yeah I am pulling the video feed via webrtc and achieving ptz control via onvif. Onvif does have the video feed, but it is more laggy. I also added shortcut buttons to different ptz presets. Here’s my code if it helps…

type: custom:webrtc-camera
url: rtsp://username:password@IPaddress:554/h264Preview_01_main
style: ".mode {display: none}"
shortcuts:
  - name: Garden
    icon: mdi:flower
    service: select.select_option
    service_data:
      entity_id: select.living_room_ptz_preset
      option: Garden
  - name: Sofa
    icon: mdi:sofa
    service: select.select_option
    service_data:
      entity_id: select.living_room_ptz_preset
      option: Living Room
  - name: Sofa
    icon: mdi:dog
    service: select.select_option
    service_data:
      entity_id: select.living_room_ptz_preset
      option: Crate
  - name: Kitchen
    icon: mdi:pot-steam
    service: select.select_option
    service_data:
      entity_id: select.living_room_ptz_preset
      option: Kitchen
ptz:
  service: onvif.ptz
  data_left:
    entity_id: camera.living_room_profile000_mainstream
    pan: LEFT
    move_mode: ContinuousMove
  data_right:
    entity_id: camera.living_room_profile000_mainstream
    pan: RIGHT
    move_mode: ContinuousMove
  data_up:
    entity_id: camera.living_room_profile000_mainstream
    tilt: UP
    move_mode: ContinuousMove
  data_down:
    entity_id: camera.living_room_profile000_mainstream
    tilt: DOWN
    move_mode: ContinuousMove
  data_zoom_in:
    entity_id: camera.living_room_profile000_mainstream
    zoom: ZOOM_IN
    move_mode: ContinuousMove
  data_zoom_out:
    entity_id: camera.living_room_profile000_mainstream
    zoom: ZOOM_OUT
    move_mode: ContinuousMove
1 Like

So, your solution was to have presets to point to rather than actually solving the full-range panning issue. Correct?

No. In the code I shared there’s a ptz section, with up/down/left/right/in/out. The presets was just a nice bonus as I can achieve most the views I want with one press. I still have full manual control too.

I made an account just to say that your preset worked like a charm for my reolink camera!

Thanks @edcoppen

I get a lot of help from others. I’m pleased I managed to help out on this occasion. :blush:

1 Like