Ah, I see. So, that docs say that templates are supported for the URL. Did your example above not work? Is the filename of the jpg predictable or random?
Got it. So, I’m not an expert, but I think this happens because there is no state change forcing the template to re-evaluate. This is briefly mentioned here:
Note that templates that depend on time (now()) and do not use any entities will not be updated as it only happens on entity state changes. For more information and examples refer to template sensor documentation
The docs recommend a different approach based on the time_date platform. I was able to replicate your template, although I have no way to test it. The page gives an example at the bottom, but here is what I did to match yours:
nope, this solution not working still. i solved it, by sending last file name my mqtt, making mqtt sensor in ha and tied it together in generic camera template. anyways - thank you.