Gallery Panel for images/videos

Thanks for the reply, one X gives me invalid date for some reason.

type: custom:gallery-card
entities:
  - path: >-
      media-source://media_source/nest/event_media/85be2b7d21fa4feecd32168b2fdfa57a
    include_images: true
    include_video: false
menu_alignment: Responsive
file_name_format: X
caption_format: D/M h:mm A
maximum_files: 20
show_reload: true

Hm…maybe try the lowercase x?

Hello, I just installed Gallery card to see some CCTV footage and I can’t get the videos to play. The videos are mp4 and play Ok in the media side-menu. Been looking for somebody with the same issue but so far no luck. I am getting this error in the log

Logger: frontend.js.latest.202308020
Source: components/system_log/init.py:270
First occurred: 9:55:22 PM (3 occurrences)
Last logged: 10:04:17 PM

  • xxxxxxxxxxx.com Error: Failed to execute ‘define’ on ‘CustomElementRegistry’: the name “gallery-card” has already been used with this registry


image

What is sensor.syno? Is that using the files or folder integration? If so, are the files in your www directory? If not, you may need to use the media source.

homeassistant:
  media_dirs:
    syno: ***path goes here***

…then in the card…

entities:
  - 'media-source://media_source/syno/'
1 Like

That was indeed the issue, I was trying to use the sensor folder and allow an external folder (/media) in the configuration yaml. Files with folder sensor were showing but not being played back, eventually, I was able to configure the media source way and it worked, it was not straightforward forward but figure it out by looking at the HA documentation. I thought the sensor folder would allow files outside www directory, I have a large nas already mounted on /media and the new NAS thing in HA forces the files in /media. I guess I could look into mounting the SMB share inside www but it’s working now I might try it later for a different use case. Thanks for the reply.

I did it this way

entities:

  • media-source://media_source/local/syno

Hi @fi-sch did you ever get to the bottom of your mp4 videos not previewing? I have the same issue. no preview but works fine when you click it.

First of all thanks for the card its just what I have been looking for.

Has anyone else seen this issue? I’m using the files integration to get mp4’s from the www/blink directory and they all play fine when clicked. I can see the preview fine using Chrome but when using my Fire Tablet or iPhone I see just a blank square. This is using the HA App or fully kiosk browser.

Thanks in advance for any ideas…

Lower case didn’t work either, I did manage to get it working by changing line 671 to " var fileDatePart = fileName.substring(0,10);". Is it possible to add “fileNameDateEnds” as a config parameter?

Sure. I logged an issue so that I don’t lose track of that. Add File Name Date Ends Parameter · Issue #70 · TarheelGrad1998/gallery-card · GitHub

Odd, in my testing that library had little trouble plucking a date out of the string, but maybe the unix format is special. Anyway, sounds like you’ve found a good workaround.

For some reason keep getting my media source link breaking, happened last night and I reverted to a previous backup, and everything working normally, and then this afternoon, not sure what is causing this, I know the links work so the configuration is fine. I am using the default media dir as local, can’t really assign it to another directory since that is the one that HA assigns for the NAS mounting

2023-08-09 14:16:21.650 ERROR (MainThread) [homeassistant.components.system_log.external] Gallery Card Error: Invalid path. media-source://media_source/local/syno

Hrm, not sure on that one. Are you keeping the page open, like on a kiosk or something? I’m wondering if maybe the session is expiring or something. Just a wild guess, but I haven’t not heard of that happening before.

I don’t have a kiosk but I am keeping the session open for a long time, in a chrome tab, tried logging out or logging in, unless there is another way to restart the session can’t think of anythig else. Also there was a guy on the git hub page that had a similar issue with a Japan folder I think last year, it is in the issues page. I am going to try mounting a smb under the www folder, seems to be more reliable. Also if this doesn’t work I will probably look for another solution on docker/linux, if you know of anything similar please let me know. Thanks again for the reply

If logging out and back in didn’t “reconnect” then it’s not the session. So maybe a bad guess on my part.

Personally I’ve been transitioning more and more to Frigate, from Synology Surveillance Station. The Frigate card is superior to mine, at least when your videos are hosted within Frigate. For what it’s worth…

I had a look and I couldn’t find a way to do just playback, I had to add a camera, I have my files being recorded by a ring integration to the NAS, unless there is a trick in which I add a dummy camera I wouldn’t know how to do it, that is why I like your card so much, it’s simple and it does exactly what i need

Great card. I previously had this setup using the deprecated version and had separate tabs inside the panel view to separate the content from different cameras. I’m struggling to reproduce the same tabbed view just like your screenshot. Any help would be appreciated.

If I understand correctly, the equivalent using the new card would be:

  1. Create a new Dashboard (Settings → Dashboard)
  2. On that new Dashboard, add a new tab/view per camera.
  3. Configure each view to View type = Panel
  4. On each view, add the Gallery card configured to show just the camera of interest

Thanks, that was very helpful. When I was using the old gallery panel I was able to have separate tabs inside the panel that separated videos from images like this.

panel_custom:

  • name: gallery
    sidebar_title: Front Door (Kuna)
    sidebar_icon: mdi:cctv
    config:
    title: Front Door
    tabs:
    - name: Videos
    entity_id: sensor.gallery_videos
    maximum_files: 10
    - name: images
    entity_id: sensor.gallery_images
    maximum_files: 10

Is this stil possible?

image

Yes, that is the scenario I covered. That same thing is now two views/tabs using the built in HA functionality, each containing a gallery card – one for the videos and one for the images. The separation and tabs are just now handled by HA.

Great card, I use it as photo frame at my home screen at a 10" tablet. Only when you tapped on the photo it is too big and does not fit on the screen. Can the size for full screen be set somewhere? I now have this configuration:

type: custom:gallery-card
entities:
  - media-source://media_source/video
  - media-source://media_source/slide
menu_alignment: hidden
slideshow_timer: '120'
video_preload: false
video_muted: true
video_autoplay: true
video_loop: true
show_duration: false
parsed_date_sort: false
reverse_sort: false
random_sort: true

You should be able to use card-mod to do styling on the imageModal tag.