AlexxIT / WebRTC

Home Assistant custom component for real-time viewing of almost any camera stream using WebRTC and other technologies.
https://github.com/AlexxIT/Blog
MIT License
1.37k stars 164 forks source link

The PTZ controls are unresponsive when combined with Vertical or Horizontal stack cards. #105

Open sheminasalam opened 3 years ago

sheminasalam commented 3 years ago

Hi there, appreciate the good work but I tried to combine this card with some of my switches using a vertical stack card. The card shows the live feed but the PTZ controls doesn't work. The following is my config.

type: vertical-stack
cards:
  - type: custom:webrtc-camera
    url: >-
      rtsp://admin:shemin2011@192.168.33.100:554/cam/realmonitor?channel=9&subtype=1&unicast=true&proto=Onvif
    poster: https://home-assistant.io/images/cast/splash.png
    intersection: 0.75
    muted: false
    ui: true
    background: true
    ptz:
      service: onvif.ptz
      data_left:
        entity_id: camera.gate_ptz_cam
        pan: LEFT
      data_right:
        entity_id: camera.gate_ptz_cam
        pan: RIGHT
      data_up:
        entity_id: camera.gate_ptz_cam
        tilt: UP
      data_down:
        entity_id: camera.gate_ptz_cam
        tilt: DOWN
      data_zoom_in:
        entity_id: camera.gate_ptz_cam
        zoom: ZOOM_IN
      data_zoom_out:
        entity_id: camera.gate_ptz_cam
        zoom: ZOOM_OUT
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        entity: light.robo_fan_speed
      - type: button
        tap_action:
          action: toggle
        entity: light.robo_fan_volume
      - type: button
        tap_action:
          action: toggle
        entity: light.robo_fan_control
      - type: button
        tap_action:
          action: toggle
        entity: light.robo_fan_tilt
rikman122 commented 3 years ago

I'm facing the same problem when using in vertical-stack cards. Here is the log output:

image

Looks like "hass" object is undefined when the card is rendered inside another card

baurmatt commented 1 year ago

I think I'm running it the same bug. I've integrated the custom:webrtc-camera card into a custom:state-switch card. That way, plz control isn't shown at all.

Could it be possible to get this fixed? :)