dermotduffy / frigate-hass-card

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

Live View & Gallery with Multiple Cameras/Streams not Automatically Updating Events #1499

Closed EPiSKiNG closed 1 month ago

EPiSKiNG commented 2 months ago

I'm trying to configure the following:

Running:

I've tried the following card where scan mode works properly, and the gallery is shown, but only shows the events from the active camera:

type: custom:frigate-card
cameras:
  - camera_entity: camera.front_walkway
    dependencies:
      cameras:
        - camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_301
    live_provider: go2rtc
    go2rtc:
      stream: front_walkway_sub
  - camera_entity: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_301
    title: Front Walkway HD
    id: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_301
    hide: true
  - camera_entity: camera.driveway
    dependencies:
      cameras:
        - camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1501
    live_provider: go2rtc
    go2rtc:
      stream: driveway_sub
  - camera_entity: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1501
    title: Driveway HD
    id: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1501
    hide: true
  - camera_entity: camera.front_door
    dependencies:
      cameras:
        - camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_101
    live_provider: go2rtc
    go2rtc:
      stream: front_door_sub
  - camera_entity: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_101
    title: Front Door HD
    id: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_101
    hide: true
  - camera_entity: camera.living_room_slider
    dependencies:
      cameras:
        - camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_901
    live_provider: go2rtc
    go2rtc:
      stream: living_room_slider_sub
  - camera_entity: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_901
    title: Living Slider HD
    id: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_901
    hide: true
  - camera_entity: camera.bedroom_slider
    dependencies:
      cameras:
        - camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1001
    live_provider: go2rtc
    go2rtc:
      stream: bedroom_slider_sub
  - camera_entity: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1001
    title: Bedroom Slider HD
    id: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1001
    hide: true
  - camera_entity: camera.side_yard
    dependencies:
      cameras:
        - camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1301
    live_provider: go2rtc
    go2rtc:
      stream: side_yard_sub
  - camera_entity: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1301
    title: Side Yard HD
    id: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1301
    hide: true
  - camera_entity: camera.pergola
    dependencies:
      cameras:
        - camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1101
    live_provider: go2rtc
    go2rtc:
      stream: pergola_sub
  - camera_entity: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1101
    title: Side Yard HD
    id: camera.ds_7616ni_i2_16p1620171008ccrr107469073wcvu_1101
    hide: true
view:
  scan:
    enabled: true
  update_force: true
menu:
  buttons:
    substreams:
      icon: mdi:high-definition
      priority: 100
    frigate:
      enabled: false
    cameras:
      enabled: false
    live:
      enabled: false
    clips:
      enabled: false
    snapshots:
      enabled: false
    recordings:
      enabled: false
    download:
      enabled: false
    camera_ui:
      enabled: false
    expand:
      enabled: false
    timeline:
      enabled: false
    media_player:
      enabled: false
  style: overlay
  position: top
  alignment: right
live:
  transition_effect: none
  auto_play: all
  controls:
    thumbnails:
      mode: below
      show_favorite_control: false
      show_timeline_control: false
      show_download_control: false
visibility:
  - condition: numeric_state
    entity: sensor.sun_solar_elevation
    above: -4

I've also tried this gallery only card which is functional, but only refreshes when I interact with it, when the entire dashboard is refreshed, or when I set update_seconds and update_timeout to something greater than 0, but when I do that, the gallery view flickers each time it refreshes, which is a bit annoying as it catches my eye and makes me think something happened, when in reality something may not have. I wouldn't mind this flicker if it only happened when there is a new snapshot available to review.

type: custom:frigate-card
cameras:
  - camera_entity: camera.driveway
    dependencies:
      all_cameras: true
  - camera_entity: camera.front_door
  - camera_entity: camera.front_walkway
  - camera_entity: camera.side_yard
  - camera_entity: camera.bedroom_slider
  - camera_entity: camera.pergola
  - camera_entity: camera.living_room_slider
view:
  default: snapshots
  update_seconds: 0
  timeout_seconds: 0
  update_entity:
    - binary_sensor.driveway_all_occupancy
    - binary_sensor.front_door_all_occupancy
    - binary_sensor.front_walkway_all_occupancy
    - binary_sensor.side_yard_all_occupancy
    - binary_sensor.bedroom_slider_all_occupancy
    - binary_sensor.pergola_all_occupancy
    - binary_sensor.living_room_slider_all_occupancy
dimensions:
  aspect_ratio_mode: unconstrained
  max_height: 203px
media_gallery:
  controls:
    thumbnails:
      show_details: true
      size: 100
      show_favorite_control: false
      show_timeline_control: false
      show_download_control: false
    filter:
      mode: none
media_viewer:
  layout:
    fit: cover
menu:
  buttons:
    frigate:
      enabled: false
automations:
  - conditions:
      state:
        - entity: binary_sensor.driveway_all_occupancy
          state: 'on'
        - entity: binary_sensor.front_door_all_occupancy
          state: 'on'
        - entity: binary_sensor.front_walkway_all_occupancy
          state: 'on'
        - entity: binary_sensor.side_yard_all_occupancy
          state: 'on'
        - entity: binary_sensor.bedroom_slider_all_occupancy
          state: 'on'
        - entity: binary_sensor.pergola_all_occupancy
          state: 'on'
        - entity: binary_sensor.living_room_all_person_occupancy
          state: 'on'
    actions:
      - action: custom:frigate-card-action
        frigate_card_action: snapshots
    actions_not:
      - action: custom:frigate-card-action
        frigate_card_action: snapshots

I'm fairly certain that the automations section is unnecessary, but it was something I was trying to see if I can "force" the refresh of the card.

I should also note that there is a vehicle parked in the "driveway" zone/camera, so that sensor is always showing "1" car count and occupied. I would like to think I can still get refreshed snapshots when other cameras/areas get triggered?

Thanks in advance for the help!

dermotduffy commented 1 month ago

Please update to the latest build and let me know if you still have this issue:

https://github.com/dermotduffy/frigate-hass-card/releases/tag/v6.0.0-beta.1

EPiSKiNG commented 1 month ago

Same issue on the first card, where events in the gallery are shown, but only for the selected camera... Perhaps my config needs some work.

The 2nd card (media gallery only) appears to be working properly now! Awesome!

I am noticing however, on the initial dashboard load (I have mine in Sidebar mode, with the Snapshots at the bottom of the main view), the web browser scrolls down the page to the snapshots, which is not ideal. I have to scroll back up each time the page is refreshed or loaded.

Thanks a ton for all your work!

dermotduffy commented 1 month ago

Same issue on the first card, where events in the gallery are shown, but only for the selected camera... Perhaps my config needs some work.

Can you help me understand what this means? What happens, and what do you expect to happen?

EPiSKiNG commented 1 month ago

When I have the card configured per the first YAML, all the cameras listed are selectable by scrolling left/right, however, the thumbnails in the media gallery/snapshots show only those related the camera that is currently selected/displayed. I want it so that the media gallery/snapshots show events from all cameras, rather than just the selected camera.

Ultimately, I'm looking for a view where all cameras are in scan mode (camera with active person/occupancy is brought to front), reset to primary/original camera after occupancy clears, and where the media gallery at the bottom displays events from all the cameras, and not just the events from the in-focus/active camera (preferably on any/all of the cameras, not just the primary/original camera).

Hopefully that clears it up?

EDIT:

I added:

dependencies:
      all_cameras: true

to each camera in the config, and now the media gallery is showing properly. :)

I think we can close this one as solved for now! Nice work on the new interface/features! Thanks so much for everything you do!