#Show a simple image on the Dashboard with a dynamic url not possible?

1 messages · Page 1 of 1 (latest)

coarse remnant
#

Hey folks, i have a sensor that has an attribute like entity_picture: /local/snapshots/20251124_211006.jpg
i tried adding a picture-entity card to my dashboard in order to display the picture at the path but with no success.
when i access http://homeassistant.local:8123/local/snapshots/20251124_211006.jpg it works like a charm... any idea how to get the picture to display without hardcoding it (tried that, that also works)

tardy storm
#

You said "no success to display the picture at the path", but it does work if you hard code it. So what did you try that's not working exactly?

regal pendant
#

My guess is that they want to use the entity attribute to construct the path for the image, which I don't think is possible

tardy storm
#

A template image entity may be useful here.

coarse remnant
#

So naively i tried this:
works:

- type: picture
  image:
    media_content_id: /local/doorbell_20251125_000052.jpg

does not work:

- type: picture
  image:
    media_content_id: "{{ input_text.image_path }}"

So then i had a sensor that outputs the same path as the entity_picture attribute, and used the type: picture-entity
which didnt work either.

The template image entity does work, however its needs to be an absolute url, tried it as follows, working:

- image:
    - name: testimage
      unique_id: testimage
      url: >-
        http://homeassistant.local:8123/local/doorbell_{{ now().strftime('%Y%m%d') }}_000052.jpg

This is still very unflexible, what im doing is im grabbing the last 30 image paths out of a database and populating a sensor attribute list with it.
Now in theory i could have 30 sensors and work with that, but thats not very elegant right 🙂
Is there another solution im missing here?

tardy storm
#

So you can't have jinja templates in core cards, so that's out.
I think there is some custom cards you can use that can add templates to arbitrary cards, but not 100% sure.

#

What do you want to do with all 30 images? Display all of them simultaneously?

coarse remnant
#

My Camera is taking snapshots at certain events and is logging the eventtime into a database. i want to display the latest 10 events as a masonry, and maybe on another view all events in a table like fashion sorted by date.

tardy storm
#

I guess yes, a collection of template images is how I can imagine you could do that in core. There are probably more versatile custom cards/integrations.