Looked for similar issue but can’t see them. I’m playing with my floorplan using a Picture-Elements card. When I replace an image on the Pi, the new image is not picked up. I’ve tried restart Home-Assistant, rebooting, refreshing the browser cache (ctl-f5). But old the image is still used. The only solution I’ve found is to use a new name for the image - however as there’s a fair amount of trial and error that gets old fast - especially when many entities share the same image.
How does one force HA to refresh the cached images?
I get this happening a lot in various places; mostly with my z-wave network diagram or the fact that lovelace keeps asking to remember my login when I login (after saying yes.) No amount of cache flushes, forced-refreshes, etc make any difference.
However, that being said, when I try in a different browser (not Chrome) it seems to work fine. Starting to lose faith in Chrome to be honest; black screens, forced refresh does nothing, etc etc etc. I should try without any addons (never thought of it until now) such as HTTPS Everywhere, Privacy Badger and ABP.
I should have asked before I began my incoherent rambling – are you using Chrome?
Hi,
you can enforce refreshing the image by “faking” a version parameter to the url. Its a common practice to change the filename from e.g. /local/mypic.png
to /local/mypic.png?v=1
and so on…
My setup is a lovelace picture glance card with an image to my /local/ dir.
When my front door opens, an automation is making a picture of the frontdoor and places that in the /local/ folder, like: camera.frontdoor.jpg
I know I can set up a fake querystring here using the ?.. but this is fixed also.
I want somthing like: ?{{timeticker}}
So everytime you load the page, the file gets newly loaded.
Can this be done?
Can anybody elaborate a bit more on this? I too am having an issue with the front end not loading a more recent image.
For my setup, I have a driveway sensor that detects when cars enter my driveway which triggers a snapshot automation, saving the snapshot, sending a notification and shows the image in a picture elements card in Lovelace. Being able to force a refresh of that file is ideal but I’m unsure on how to do it.
So I have found a work around and it actually works pretty slick so I thought I would share it. My automation takes a snapshot and saves it to the www (/local/) directory like so…
This camera file_path should match the location of where the automation saved the picture to. What this camera setup does is continually check this file and will update it live as if it was a camera feed. So in the next step when we add it to a picture card in lovelace, as the automation creates the new picture, the camera local_file will automatically update the card with the new pic! So here’s the card setup…
Then in your dashboard YAML use the value of that name: variable for your camera_image: entry. So in the above example the name is camSnap1frontdoor and that makes the corresponding entity camera.camsnap1frontdoor. So my dashboard card YAML ended up as:
elements: []
type: picture-elements
camera_image: camera.camsnap1frontdoor
title: Most recent still image capture
All that is probably obvious to everyone on this thread, but I’m new to this so it took me some head scratching and searching – maybe that’ll help another beginner some day.
Hello.
Just to say many thanks for the tip. I have an outdoor Blink cam and I made a dashboard card where the picture is uploaded. But I found an issue. The picture showed is not the last one, but the last but one.
I checked the file in save folder, and it is not the last taken picture whereas on the blink app, the last picture is OK
yeah I know this is old. But I got directed here by a google search and wanted to share a slightly different solution - different use case mind you - but it might work otherwise.
In my case I use card_mod to set a background image from a url with a unix timestamp that refreshes on its own. image automatically updates itself in the background. the beauty of this is you don’t need a camera entity, and you can apply this to virtually any other card.