Skip to content

PTZ Config Examples

Alex X edited this page Jan 2, 2023 · 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

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
Clone this wiki locally