Gallery Panel for images/videos

Yep, the uppercase and lowercase can get confusing. Glad you got it sorted.

1 Like

BUT i run in anther problem, actually i had a limit of 20 images set in the card code, but than he doesnt load the newest pictures, only 20 from the oldest pictures.

- type: 'custom:gallery-card'
                entities:
                  - path: 'media-source://media_source/esp32_cam/'
                    recursive: true 
                menu_alignment: Hidden     
                include_images: true
                parsed_date_sort: true
                reverse_sort: true
                menu_alignment: Bottom
                maximum_files: 20
                file_name_format: 'HH:mm:ss-DD.MM.YY'
                caption_format: 'D/M H:mm:ss'

So he shows exactly 20, but takes the oldest picture as the beginning for counting and then just stops at 20 although the latest picture is not reached, he would have to start with the latest one and then count the 20 among the oldest

Odd. Try reverse_sort: false, which is backward, but…

no, unfortunately that doesn’t work either, then 2 pictures from 10.06 appear, but there is already the 11.06 with 3 pictures so far and the 10.06 alone already has about 30 pictures. If I take out the limitation of the pictures, (maximum_files: 20) it works, but then it shows me all the pictures and there are a lot of them after a few days

Hrm, there was a report of a bug I’ve yet to have time to investigate. Try this:

reverse_sort: true
maximum_files_per_entity: false

Thanks for this card. I could not get the files to sort correctly so created a template file with a sorted list of files Folders Sensor - How to sort files?! - #7 by PickOne

Has anyone managed to get this to work well with the Nest integration? After fighting with it some I did manage to get it to display some thumbnails, but the file naming format the nest integration saves them in just appears to be some numeric sequence I can’t figure out how it relates to time and date. Is there a way to use the time/date attribute of the file?

The last I checked, it wasn’t possible to get the actual file dates from HA, just the names and path. So, at the moment, it is probably not possible

I do have some work to do so that the card supports the varied media sources, and I’ll research this again then…though in fairness, that might be a while. If anybody has pointers that can help me, I’d appreciate them.

1 Like

Thanks for the card.
Any idea what I’m doing wrong in parsing the date?
The file “1664522828-camera_person.mp4” starts with a unix date.

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: XXXXXXXXXX
caption_format: M/D h:mm A 
maximum_files: 20
show_reload: true

Any help appreciated

You just need one X, i.e.:

file_name_format: X

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