WebRTC icon indicating copy to clipboard operation
WebRTC copied to clipboard

Uncaught TypeError: Cannot read property 'callService' of undefined

Open gomble opened this issue 4 years ago • 5 comments

If i add onvif ptz i get the following error if i click left right etc.:

Logger: frontend.js.latest.202106030
Source: components/system_log/__init__.py:190
First occurred: 11:54:32 (14 occurrences)
Last logged: 11:59:29

https://---:8123/webrtc/webrtc-camera.js?v2.0.2:332:22 Uncaught TypeError: Cannot read property 'callService' of undefined

my card:

type: custom:webrtc-camera
url: ---
ui: true
background: true
ptz:
  service: onvif.ptz
  data_left:
    entity_id: camera.onvif_camera_profile_001
    pan: LEFT
  data_right:
    entity_id: camera.onvif_camera_profile_001
    pan: RIGHT
  data_up:
    entity_id: camera.onvif_camera_profile_001
    tilt: UP
  data_down:
    entity_id: camera.onvif_camera_profile_001
    tilt: DOWN
  data_zoom_in:
    entity_id: camera.onvif_camera_profile_001
    zoom: ZOOM_IN
  data_zoom_out:
    entity_id: camera.onvif_camera_profile_001
    zoom: ZOOM_OUT

PTZ works with manual service call like this:

   tap_action:
      action: call-service
      service: onvif.ptz
      service_data:
        entity_id: camera.onvif_camera_profile_001
        pan: RIGHT
        distance: 0.41
        speed: 0.5
        continuous_duration: 0.5
        move_mode: ContinuousMove

gomble avatar Jun 11 '21 10:06 gomble

type: custom:webrtc-camera
url: ---
background: true
ptz:
  service: onvif.ptz
  data_left:
    entity_id: camera.onvif_camera_profile_001
    pan: LEFT
    speed: 1
    distance: 0.41
    move_mode: ContinuousMove
  data_right:
    entity_id: camera.onvif_camera_profile_001
    pan: RIGHT
    speed: 1
    distance: 0.41
    move_mode: ContinuousMove
  data_up:
    entity_id: camera.onvif_camera_profile_001
    tilt: UP
    speed: 1
    distance: 0.41
    move_mode: ContinuousMove
  data_down:
    entity_id: camera.onvif_camera_profile_001
    tilt: DOWN
    speed: 1
    distance: 0.41
    move_mode: ContinuousMove
  data_zoom_in:
    entity_id: camera.onvif_camera_profile_001
    distance: 0.41
    speed: 0.5
    continuous_duration: 0.5
    move_mode: ContinuousMove
    zoom: ZOOM_IN
  data_zoom_out:
    entity_id: camera.onvif_camera_profile_001
    distance: 0.41
    speed: 0.5
    continuous_duration: 0.5
    move_mode: ContinuousMove
    zoom: ZOOM_OUT

this worked now, you should update your wiki/documentation

gomble avatar Jun 11 '21 12:06 gomble

@gomble I have the exact same issue, but your .yaml file doesn't solve the problem in my case. Could you tell me what exactly you have changed, and how the working configuration looks like? The ptz controls were working just fine for a while, when suddenly that error appeared.

hairypotta avatar Jul 01 '21 13:07 hairypotta

@gomble I have the exact same issue, but your .yaml file doesn't solve the problem in my case. Could you tell me what exactly you have changed, and how the working configuration looks like? The ptz controls were working just fine for a while, when suddenly that error appeared.

It worked 2-3 times, then no more. I give up and did solve another way. Created some rest scripts to move the camera.

gomble avatar Jul 01 '21 17:07 gomble

Maybe fixed by https://github.com/AlexxIT/WebRTC/pull/115

AlexxIT avatar Sep 01 '21 13:09 AlexxIT

Yes, this fixed the problem (tested on Tapo C200).

wowgamr avatar Sep 26 '21 12:09 wowgamr