I have created an automation for the alarm that if it detects motion in X sector, it takes a capture of the nearest camera and saves it in /config/www/media_security/images_security/cam_01 or cam_02 etc…
The goal is that when the alarm is triggered, a notification arrives with the warning and when I click on that notification it shows me the captured image according to the movement.
In the practical case, let’s suppose I pass 3 times by the same place, then it takes 3 captures with the same name (therefore the previous image is replaced).
And when I create a picture card but it returns a wrong image (I assume it must be because of cache), sometimes it shows me the first capture, I close and open the app again and it shows me the second capture, and other times the correct one, but it is very random… I have looked for a solution in HACS but I have not found anything that returns me the last images of a specific folder, does anyone have notions of something like that?