Onvif camera platform - How to do PTZ?

it works for me

type: custom:webrtc-camera
url: http://onvif_rtsp
mode: webrtc
ui: true
muted: true
style: >-
  .mode {display: none} .pictureinpicture{display: none} .screenshot{display:
  none} .ptz{opacity: initial}
background: true
ptz:
  service: onvif.ptz
  data_up:
    tilt: UP
    entity_id: camera.ip_camera_profile_001
    speed: 1
    distance: 1
    move_mode: ContinuousMove
    continuous_duration: 0.6
  data_down:
    tilt: DOWN
    entity_id: camera.ip_camera_profile_001
    speed: 1
    distance: 1
    move_mode: ContinuousMove
    continuous_duration: 0.6
  data_left:
    pan: LEFT
    entity_id: camera.ip_camera_profile_001
    speed: 1
    distance: 1
    move_mode: ContinuousMove
    continuous_duration: 0.6
  data_right:
    pan: RIGHT
    entity_id: camera.ip_camera_profile_001
    speed: 1
    distance: 1
    move_mode: ContinuousMove
    continuous_duration: 0.6
type: custom:webrtc-camera
url: onvif://admin:[email protected]:80?subtype=MediaProfile00000
mode: webrtc
ui: true
muted: true
style: >-
  .mode {display: none} .pictureinpicture{display: none} .screenshot{display:
  none} .ptz{opacity: initial}
background: true
ptz:
  service: onvif.ptz
  data_zoom_in:
    zoom: ZOOM_IN
    entity_id: camera.shed_onvif_mediaprofile_channel1_mainstream
    speed: 1
    distance: 1
    move_mode: ContinuousMove
    continuous_duration: 0.1
  data_down_out:
    zoom: ZOOM_OUT
    entity_id: camera.shed_onvif_mediaprofile_channel1_mainstream
    speed: 1
    distance: 1
    move_mode: ContinuousMove
    continuous_duration: -0.1

Anyone know how to get zoom on a varifocal working? ODM says it supports ptz but i can’t get it working. Empire Tech/ Dahua 5542 s3 IPC-T54IR-ZE White S3

1 Like

This is the zoom part from my code and is working

  - entity: camera.hikvision_ds_2de4225iw_de_mainstream
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.hikvision_ds_2de4225iw_de_mainstream
        zoom: ZOOM_IN
        speed: 1
        distance: 0.3
        move_mode: ContinuousMove
    name: zoomin
    show_state: false
    icon: mdi:magnify-plus
    show_icon: true
  - entity: camera.hikvision_ds_2de4225iw_de_mainstream
    tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.hikvision_ds_2de4225iw_de_mainstream
        zoom: ZOOM_OUT
        speed: 1
        distance: 0.3
        move_mode: ContinuousMove
    name: zoomout
    show_state: false
    icon: mdi:magnify-minus
    show_icon: true