Local file camera not updating when using "local_file.update_file_path"

I have created a camera entity using the “local file” integration and I am using a picture entity card to display this camera.
Here is the relevant code from the dashboard:

show_state: false
show_name: false
camera_view: live
type: picture-entity
entity: camera.wallpaper

Now when I update the file path using the action “local_file.update_file_path” (for example in an automation) the picture entity card does not always update immediately. It usually takes a few minutes or even a manual update.
The entity itself updates correctly, as I use card_mod to dynamically set the font-color depending on the background image. If the file is prefixed with “dark”, I use a white font, else I use a black font.
Now the font-color updates immediately, while the image stays the same, which results in unreadable text.

is there anything wrong with my configuration?

1 Like

As a workaround or maybe even as the final solution, I am now using card_mod with a template for background_image. The template is updated immediately on change.
One problem with this is, that you need to give it a path instead of a camera entity and there only /local files, which are located in /config/www are accessible.
My solution for this is to use a input_text helper which stores the current file path.
This path is updated in an automation, using the folder integration to retrieve a random path from /config/www/background. To use this path in the frontend, I have to replace /config/www with /local and everything works fine.

Template:
{{ state_attr('sensor.background_folder', 'file_list') |random | replace('/config/www', '/local') }}