Buttons for PTZ preset positions?

What is the best user interface to control the position of a PTZ camera?

I have a Dahua PTZ1A225-HNR-XA which I have programmed with several preset positions, numbered from 1 up to potentially 300. I can issue the following shell command to tell the camera to move to position X (where X is a value from 1 to 300).

curl --digest -g --interface enp0s3 "http://username:password@ipaddress/cgi-bin/ptz.cgi?action=start&channel=1&code=GotoPreset&arg1=0&arg2=X&arg3=0"

What buttons would be best to trigger this shell command for the desired preset position? I was thinking it would be nice to have a keypad on which I could enter the position number and then press an “enter” key to execute the shell command. But I don’t think this kind of interface exists.

Any suggestions?

Is that an onvif camera? PTZ Service

@nickrout – Yes. But this integration does not resolve the issue about how to input the values to control the camera. What buttons should I use to set the position of the camera?

I am no GUI expert, but you could use a button card with the tap action set to that service.

Just an example. :slightly_smiling_face:
HA_Dahua_PTZ_Button

camera_view: live
type: picture-glance
title: 'Dahua Hof '
entities:
  - entity: camera.dahua_hof_mediaprofile_channel1_substream2
    icon: mdi:numeric-1-box-outline
    name: Position1
    secondary_info: Overview
    tap_action:
      action: call-service
      service: ONVIF.PTZ
      service_data:
        entity_id: camera.dahua_hof_mediaprofile_channel1_substream2
        move_mode: GotoPreset
        preset: '1'
  - entity: camera.dahua_hof_mediaprofile_channel1_substream2
    icon: mdi:numeric-2-box-outline
    name: Position2
    tap_action:
      action: call-service
      service: ONVIF.PTZ
      service_data:
        entity_id: camera.dahua_hof_mediaprofile_channel1_substream2
        move_mode: GotoPreset
        preset: '2'
  - entity: camera.dahua_hof_mediaprofile_channel1_substream2
    icon: mdi:numeric-3-box-outline
    name: Position3
    tap_action:
      action: call-service
      service: ONVIF.PTZ
      service_data:
        entity_id: camera.dahua_hof_mediaprofile_channel1_substream2
        move_mode: GotoPreset
        preset: '3'
  - entity: camera.dahua_hof_mediaprofile_channel1_substream2
    icon: mdi:numeric-4-box-outline
    name: Position4
    tap_action:
      action: call-service
      service: ONVIF.PTZ
      service_data:
        entity_id: camera.dahua_hof_mediaprofile_channel1_substream2
        move_mode: GotoPreset
        preset: '4'
camera_image: camera.dahua_hof_mediaprofile_channel1_substream2