Skip to content

PTZ Config Examples

Alex X edited this page Feb 18, 2024 · 10 revisions

Sonoff

Integration

type: 'custom:webrtc-camera'
entity: ...
ptz:  # optional PTZ controls
  opacity: 0.4  # optional default contols opacity
  service: sonoff.send_command  # service for control PTZ (check Hass docs to your camera)
  data_left:  # service data for each direction
    device: '048123'
    cmd: left
  data_right:
    device: '048123'
    cmd: right
  data_up:
    device: '048123'
    cmd: up
  data_down:
    device: '048123'
    cmd: down

ONVIF

Integration

type: 'custom:webrtc-camera'
entity: ...
ptz:
  service: onvif.ptz
  data_left:
    entity_id: ...
    pan: LEFT
  data_right:
    entity_id: ...
    pan: RIGHT
  data_up:
    entity_id: ...
    tilt: UP
  data_down:
    entity_id: ...
    tilt: DOWN
  data_zoom_in: # optional, for zoom increase
    entity_id: ...
    zoom: ZOOM_IN
  data_zoom_out: # optional, for zoom decrease
    entity_id: ...
    zoom: ZOOM_OUT

Xiaomi Dafang (with hack)

hack

type: 'custom:webrtc-camera'
entity: ...
ptz:
  service: mqtt.publish
  data_left:
    topic: myhome/dafang/motors/horizontal/set
    payload: left
  data_right:
    topic: myhome/dafang/motors/horizontal/set
    payload: right
  data_up:
    topic: myhome/dafang/motors/vertical/set
    payload: up
  data_down:
    topic: myhome/dafang/motors/vertical/set
    payload: down

Reolink E1 Zoom

type: custom:webrtc-camera
entity: camera.reolink_e1_zoom_profile000_mainstream
webrtc: false
ptz:
  service: onvif.ptz
  data_left:
    entity_id: camera.reolink_e1_zoom_profile000_mainstream
    pan: LEFT
    move_mode: ContinuousMove
  data_right:
    entity_id: camera.reolink_e1_zoom_profile000_mainstream
    pan: RIGHT
    move_mode: ContinuousMove
  data_up:
    entity_id: camera.reolink_e1_zoom_profile000_mainstream
    tilt: UP
    move_mode: ContinuousMove
  data_down:
    entity_id: camera.reolink_e1_zoom_profile000_mainstream
    tilt: DOWN
    move_mode: ContinuousMove
  data_zoom_in:
    entity_id: camera.reolink_e1_zoom_profile000_mainstream
    zoom: ZOOM_IN
    move_mode: ContinuousMove
  data_zoom_out:
    entity_id: camera.reolink_e1_zoom_profile000_mainstream
    zoom: ZOOM_OUT
    move_mode: ContinuousMove

Roborock

Integration

ptz:
  service: roborock.vacuum_remote_control_move
  data_left:
    duration: 0
    rotation: 30
    velocity: 0
    entity_id: vacuum.tank
  data_right:
    duration: 0
    rotation: -30
    velocity: 0
    entity_id: vacuum.tank
  data_up:
    duration: 1000
    rotation: 0
    velocity: 0.29
    entity_id: vacuum.tank
  data_down:
    duration: 1000
    rotation: 0
    velocity: -0.29
    entity_id: vacuum.tank

Tapo

Integration

type: custom:webrtc-camera
streams:
  - entity: camera.cameraname_hd_stream
    mode: webrtc
muted: true
ptz:
  service: button.press
  data_left:
    entity_id: button.cameraname_move_left
  data_right:
    entity_id: button.cameraname_move_right
  data_up:
    entity_id: button.cameraname_move_up
  data_down:
    entity_id: button.cameraname_move_down

ICSee/DVR-IP/NetSurveillance/Sofia

Check this issue

Eufy

Check this issue

Ezviz PTZ

Check this issue

Imou

Check this issue

Custom

configuration.yaml

script:
  camera_ptz:
    sequence:
      - service: rest_command.camera_ptz_start
        data:
          param: "{{ direction }}"
      - service: rest_command.camera_ptz_stop
        data:
          param: "{{ direction }}"

card

type: 'custom:webrtc-camera'
entity: ...
ptz:
  service: script.camera_ptz
  data_left:
    direction: directionleft
  data_right:
    direction: directionright
  data_up:
    direction: directionup
  data_down:
    direction: directiondown