Picture not updating

Hi guys, have been searching the forum over and out but can still not understand why my picture is not updating.

I’m utilizing lovelace and have put my photo within /config/www/images/pic.jpg and it displays correct, so the path is working and it displays the photo correct. However I have replaced the pic.jpg with another photo and the old one is still displayed…even tried to removed the pic.jpg and it displays a gray area so the pic is removed but when adding the new photo again it displays the old one…
I have restarted the hass and restarted my pi with the power plug several times.

- type: picture-entity
  show_name: false
  image: /local/images/pic.jpg

Is there any cache or something else I can delete?

Try renaming your pic to pic_1 and point it to that. Yes it is a cache issue.

I’m asing the same problem here, also restarted and rebooted Hassio and the Pi. So I already was thinking this was a cache problem.

Even cleared the cache on my Chrome browser :stuck_out_tongue:

But isn’t there a workaround, instead of keeping to rename the files? Isn’t there a possibility to clear or reload the cache in Hassio?

I found this post while having the same problem… in the end I solved it by combining a picture with with a camera entity.

In configuration.yaml:

camera:
  - platform: generic
    name: my_image
    still_image_url: "http://<my_has_ip>:8123/local/<image_name>.jpg"
    verify_ssl: false

and in lovelace:

  - type: picture-entity
    entity: camera.my_image
    camera_image: camera.my_image
    show_state: true
    show_name: false
    aspect_ratio: '1.0'
1 Like

…2 years later I felt on this thread. I was trying to get my picture-entity (and -glance. I suppose) updated. The method in the last message, with the trick of setting the picture as a camera would work. It work, but then I could not use state_image parameter to change the picture in realtime depending on state of an enity :frowning:

Well, finally after some tests I have the perfect configurarion. Picture updated, realtime and using different states.

Applying the camera trick when also changing image by state_image, doesn’t work for me. So, here is my recipe: using the camera trick, but change picture using Ian Richardson’s great ‘config-template-card’ here: GitHub - iantrich/config-template-card: 📝 Templatable Lovelace Configurations

Sample of use:

ONE CAMERA FOR EACH PICTURE in my cameras.yaml

- platform: generic
  name: camara_sosa_1mes
  still_image_url: "http://<homeassistant_IP>:<port>/local/materias_primas/sosa_1mes.png"
  verify_ssl: false

- platform: generic
  name: camara_sosa_3meses
  still_image_url: "http://<homeassistant_IP>:<port>/local/materias_primas/sosa_3meses.png"
  verify_ssl: false
  
  [etc]

IN MY INPUT_SELECTS.YAML

grafica_sosa:
  name: SOSA
  options:
    - 1mes
    - 3meses
    - 6meses
    - 1year
    - 2years
    - 5years
    - 10years
  initial: 3meses
  icon: mdi:finance

(the input_select states match the end of each image filename used in cameras)

Finally the really short and simple card config:
CARD in lovelace (using Ian’s config-template-card):

type: custom:config-template-card
entities:
  - input_select.grafica_sosa
card:
  entity: input_select.grafica_sosa
  camera_image: ${'camera.camara_sosa_'+states['input_select.grafica_sosa'].state}
  show_name: false
  show_state: false
  type: picture-entity

…guess what. It updates perfectly, real time, without any cached images problem and changing picture when changing the input_select states :wink:

Hope it helps somebody!.
1 Like

Shame the image property doesn’t support injecting a little dynamic querystring.

image: /local/images/pic.jpg?ts={{ now().strftime('%H%M%d') }}

1 Like

Hi,

I had the same problem … the cache … I know it is an old post but as i found it at the end of 2023 maybe others will do also and it can help them also.

I have added this “?v={{now().timestamp()|int }}” at the end of the path in order to force the picture version … and instantly this worked. See below my example:

  • type: horizontal-stack
    cards:
    • type: picture
      image: /local/CCTV_Snapshots/009.jpg?v={{now().timestamp()|int }}
    • type: picture
      image: /local/CCTV_Snapshots/010.jpg?v={{now().timestamp()|int }}
10 Likes

Same issue - but your fix works brilliantly. Thanks!

2 Likes