What to refresh a picture in a picture card?

Hi there,

I have some picture cards on my dashboard reading pictures (produced by camera snapshots) in the www local folder.
The camera snapshots ARE updating the snapshot files in the www local, but the dashboard’s picture cards are not updated, keeping the old pictures in it.

Is that normal bevior ? I use that on a tablet running Fully Kiosk, but how Can I force the picture card to re-read the latest pictures posted on the www local folder ?
I assume it has to do with cache memory but … ??

 - title: Home
    cards: []
    visible:
      - user: 6c0f22e61daf4f799222ab1f2942f2af
      - user: 32a7bac7e6e0440183f6fefbc62b37ae
      - user: 1a22f3b4ca2f4c4c84db909d9ba20c60
    type: sections
    sections:
      - type: grid
        cards:
          - type: heading
            heading: Image 1
            heading_style: title
          - type: picture
            image: /local/Camera-snapshots/doorbel-snapshot2.jpg
      - type: grid
        cards:
          - type: heading
            heading: Image 2
            heading_style: title
          - type: picture
            image: /local/Camera-snapshots/doorbel-snapshot1.jpg

Man Thanks !!

You want to see a static image (periodically updated), not a live camera?
Try “image” entity.

exact … not a live camera, but a picture (same filename) which is updated every time a new camera snapshot is taken.
So not in a picture card you mean ?

Image entity in picture card.
Check docs for picture card.

I checked the docs …
but I think you are talking about this below, but my picture is not a camera or picture entity, but a snapshot which was taken via doorbell :

As I said - use “image” entity.
If you do not have it - it should be created for a particular file path.
Try this way, may be then you will get an automatically updated picture on a card.

I appreciate you r help but do not get you.
I SEE this option of image entity … but in that case I need to use one of the available entities, which is NOT what I want to do.

I want to display a calera snapshot (file) saved every time someone rings the bell.
My files are located here :

… and there is no way I can use those filenames as “entities” right ?
Or do I somehow need to “transform” those 3 files I have as entities ??

So, you need a functionality - but do not want to create an “image” entity.

If it works, I’d like to be able to do so … but It is the first time I hear I can create an image entity from a snapshot.
How can I do that ?
For the moment, the only image entities I see are for the persons of my family …

Not surprised. Everything happens 1st time.

https://www.google.com/search?q=image+entity+home+assistant

ok - now got it - sorry English to French translation … “Picture entity card”, and not “Picture card” which I was using.
I will give it a try tomorrow, many Thanks !!

ok - just tested it with picture entity card and the images are still not refreshed.
;-(

I have set it up like this :

Camera view “auto” or “live” doesn’t change anything

;-(

Sometimes the browser have a say too.
In this case the browser might read the html code and see that the URL is the same as before, so it decides to use a caches picture instead of wasting bandwidth getting the picture again.

With URLs you usually add ?tine=, where timestamp is the actual timestamp inserted dynamically through your code.
This will make sure that the browser thinks it is a new file every time.
However, I do not know if the image path you provide us actually an URL, so I am not sure if that trick works here. The issue might still be the same though. It is just the solution that does not work.

Another way is to turn off browser caching completely, but that have to be done in the browser and on all devices and browsers then.
In general I would advise to at least turn off browser caching for your primary browser used for editing the dashboards. It will prevent you from the same issue there.

1 Like

Exact Wally, and I am investigating this solution with adding a variable at the end of my URL.
For the moment I try this :
/local/Camera-snapshots/doorbel-snapshot1.jpg?v=‘{{now().strftime(’%Y/%m/%d %H:%M:%S’)}}’

… but it doesn’t translate into the timestamp being added to the URL, instead the URL that is send is just the same :

https://ha.xxx.be/local/Camera-snapshots/doorbel-snapshot1.jpg?v='{{now().strftime('%Y/%m/%d%20%H:%M:%S')}}%27

Trying to find the correct syntax to be able to use the “now()” into the URL and have it translated into the correct, current time

Now() should be enough.
It is just a timestamp in milliseconds since January 1. 1970.

I will open a separate thread (https://community.home-assistant.io/t/how-to-use-a-helper-or-function-in-a-url-path-to-make-it-dynamic/851815) for this as this is specific on using a variable / function in a URL.
We can close the discussion on the path URL format in this thread.