Gallery Panel for images/videos

Yes. See slideshow_timer

1 Like

hi,
@TarheelGrad1998

really a nice card, i used it for my cam snapshots, but i have a problem.

my files saved with this format “”%d-%m-%Y_%H-%M" in my automation in HA.
for example here a output 05-06-2023_14-21

Now i tried to add this to the file_name_format.

file_name_format: d-m-Y_H-M
caption_format: d/m H:M

but he names every image with this “4/6 20:3”. this is of course the wrong date.
can you perhaps help a little bit?

Thank you

Your file has two digit day and month, so this is what you want:

file_name_format: DD-MM-YYYY_HH-mm

Also note that capitalization is important.

thank you for your reply, it works, but i changed my save folder this way

he creates in a automation the file and folder with this code

/config/www/esp32_cam_person/{{now().year }}/{{month}}/{{now().day}}/{{
    as_timestamp(now()) | timestamp_custom("%H:%M:%S") }}.jpg

this gives me a folder with filename for example
2023/Juni/7/15:38:32.jpg

now is the problem, he shows me always the latest picture, i think by filename?
this is what happens the two pictures are from yesterday the others from today, can i something do that he always shows me the picrtures from TODAY?
The problem is the folder names changes every day how i explain in the beginning of the post.,

The card doesn’t really support parsing the date out of the folder yet (though it needs to). So yes what you’re getting is the latest time, not the latest date.

As a workaround, can you also include the date in the file names?

is the format of the date whether?

i changed the card code to

file_name_format: 'HH:MM:SS-dd.mm.yy'

still the same

I’m not sure I understand the question.

Currently, the card’s code can only figure out the date from the file name. So if the file name contains only time, then the month/day/year will not be accurate. And thus neither will the sorting.

okay, i try to explain it, today we have the 08.06.2023, my automation creates a new folder with 8 for the day, and saves the pictures name ´"07:20:19-08.06.23.jpg"
i added the date to the filename, its not longer only the time.

you said i should add the date, but with the date the yesterday picture is on the left side, but normally there must be the right picture because the date is newer or?

Do you have these settings?

parsed_date_sort: true
reverse_sort: true

no, but i tested it with this settings than everything is a little messed.

this is my actually code

 
              - 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'

iI don’t really understand what I can do now, but I don’t think he sorts by date. Do I have the date format wrong or does it not matter?

3 different days in one row :weary:

EDIT

okay i think i found the problem, my file_name_format was wrong, i used your link on github for research thats my new format

file_name_format: 'HH:mm:ss-DD.MM.YY'

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