dermotduffy / frigate-hass-card

A Lovelace card for Frigate in Home Assistant
MIT License
532 stars 59 forks source link

go2rtc live provider not working via external url #971

Closed conorlap closed 1 year ago

conorlap commented 1 year ago

Checklist:

Release with the issue: Latest manual build of 4.1.0

Last working release (if known): Didn't work on any build of 4.1.0 that I've tried so far

Browser and Operating System: Edge / macOS

Description of problem: When go2rtc is selected as live view provider, the stream does not load when HA is accessed via external URL (nginx and reverse proxy). Both Home Assistant Video Stream & WebRTC Card live view options work fine. Live view via go2rtc works fine when using local IP of my HA instance (http://192.168.0.22:8123)

Javascript errors shown in the web inspector (if applicable):

Additional information:

type: custom:frigate-card
cameras:
  - live_provider: go2rtc
    frigate:
      camera_name: frontdoor
    camera_entity: camera.frontdoor
view:
  default: live
  camera_select: live
dimensions:
  aspect_ratio_mode: static
  aspect_ratio: '4:3'
live:
  controls:
    thumbnails:
      mode: none
      media: clips
    title:
      mode: none
    next_previous:
      style: none
    timeline:
      mode: none
  show_image_during_load: true
  lazy_unload: hidden
  draggable: false
  auto_unmute: never
media_viewer:
  controls:
    title:
      mode: none
    thumbnails:
      mode: none
      show_timeline_control: false
    next_previous:
      style: chevrons
  auto_unmute: all
  transition_effect: slide
  auto_mute: hidden
  draggable: false
menu:
  buttons:
    frigate:
      enabled: false
    live:
      enabled: true
    clips:
      enabled: true
    snapshots:
      enabled: false
    download:
      enabled: true
    fullscreen:
      enabled: false
    timeline:
      enabled: false
    media_player:
      enabled: false
    image:
      enabled: false
    camera_ui:
      enabled: false
    cameras:
      enabled: false
    recordings:
      enabled: false
  style: overlay
  position: right
elements:
  - type: custom:frigate-card-menu-icon
    icon: mdi:fullscreen
    tap_action:
      action: fire-dom-event
      browser_mod:
        service: browser_mod.popup
        data:
          size: wide
          content:
            aspect_ratio: 55%
            type: custom:webrtc-camera
            url: rtsp://192.168.0.22:8554/frontdoor?video=all&audio=all
            mode: webrtc
            muted: true
  - type: custom:frigate-card-conditional
    conditions:
      view:
        - live
    elements:
      - type: custom:frigate-card-menu-submenu
        priority: 0
        icon: mdi:package-variant
        items:
          - title: Package at Door
            icon: mdi:door
            tap_action:
              action: call-service
              service: shell_command.doorbelltts
          - title: Package in Bin
            icon: mdi:trash-can-outline
            service: shell_command.doorbellttsrecycling
            tap_action:
              action: call-service
              service: shell_command.doorbellttsrecycling
media_gallery:
  controls:
    thumbnails:
      show_details: false
      show_favorite_control: true
      show_timeline_control: false
performance:
  profile: high
felipecrs commented 1 year ago

I'm facing the same issue.

dermotduffy commented 1 year ago

Possibly a long-shot but can you try having this in your frigate.yml (not the card, the backend):

go2rtc:
  api:
    origin: "*"
[... rest of config ...]

See this debugging thread between myself and Nick where we ran into an issue that could theoretically be another version of what you are reporting.

felipecrs commented 1 year ago

That works!

BTW, I have the Frigate add-on, and the HA integration connects to it using its internal hostname local-frigate-beta (local because I'm using my modified version with dev release).

dermotduffy commented 1 year ago

@NickM-27 Do you think we should have this set by default? Suspect this may keep happening with various different permutations of host names that people will inevitable use.

NickM-27 commented 1 year ago

Interesting, I hadn't thought of that.

My initial thing is it's either set it by default or just make it prevalent in the frigate and frigate card docs.

felipecrs commented 1 year ago

I would say it should be the default configuration, unless someone complains otherwise. :)

conorlap commented 1 year ago

Yep that fixes my issue also! 🥳

dermotduffy commented 1 year ago

@NickM-27 added this as default in https://github.com/blakeblackshear/frigate/pull/5610 -- thanks Nick!

Closing this issue.