Jinja in local_file camera not working - trying to template to get a responsive camera image

In order to get around the slow update of the local_file camera component I’m trying to add a ?v=4324323 timestamp to the end of the file URL to ‘trick’ home assistant and/or the user’s browser into downloading an up to date image.

  - platform: local_file
    file_path: "{{'/config/www/images/image.jpg'+'?v='+states['sensor.incoming_call_timestamp'].state}}"
    name: caller

I’ve also tried

  - platform: local_file
    file_path: '{{"/config/www/images/image.jpg"+"?v="+states["sensor.incoming_call_timestamp"].state}}'
    name: caller

I’m using the above configuration template which shows correctly in jinja but doesn’t work at all in Home Assistant itself, it shows as

file_path: {{'/config/www/images/image.jpg'+'?v='+states['sensor.incoming_call_timestamp'].state}}

any tips?!

Try this:

  - platform: local_file
    file_path: "/config/www/images/image.jpg?v={{states('sensor.incoming_call_timestamp')}}"
    name: caller

Thanks - but just gives (in dev view)

file_path: /config/www/images/image.jpg?v={{states('sensor.incoming_call_timestamp')}}

I think there’s a bug with this at the moment…

I don’t have any experience with the local_file integration. Based on a search of the community forum, I found examples of templating the file_path option. Not sure why it isn’t working in this instance.

Looks like a bug to me. @robmarkcole and @pickeld and @khaimong seem to have investigated this approach in the past, don’t know if they’re still using and could confirm/deny. I guess it would depend on what version of HA they are running. I’m one version behind current.