Dynamically change the image attribute of a picture glance card

I would like to configure a picture glance card to display an image taken from a camera the last time motion was detected. I have an automation running that saves (and over writes) a .jpg file each time motion is detected, but would like to know how to get the picture glance card to refresh the image when motion is detected.

I am considering this option rather than streaming a live video stream to the picture glance card, as I am sure it would be less demanding on the Rpi as I have 4 cameras, and it would make the card more meaningful as it would display an actual event.

make a local file camera that points to the file:

  - platform: local_file
    name: my_fake_camera
    file_path: /config/www/motion/my_last_motion.jpg

Then use that camera in lovelace:

          type: picture-glance
          camera_image: camera.my_fake_camera
          name: Last Motion
          entities:
            - entity: sensor.somesensor
1 Like

Works like a charm. Thank you very much.