I have a camera that when triggered saves an image with a timestamp and sends it to my phone as a notification, this is done with an automation. What I’m having trouble with is displaying just the latest image on my dashboard.
This is part of the automation code that sets the input text helper to the current time, and then saves the picture on in the folder using the timestamp
action:
- service: input_text.set_value
target:
entity_id: input_text.crowboxtimetext
data:
value: '{{ now().strftime("%Y%m%d-%H%M%S") }}'
- service: camera.snapshot
data:
filename: >-
/config/www/crows/timestamps/{{ states('input_text.crowboxtimetext')
}}.jpg
target:
entity_id: camera.crow_cam
I’ve created a camera in my config file, but it doesn’t show the latest picture, just broken picture icon or nothing. I’m thinking because its using the states(‘input_text.crowboxttimertext’) in the path. When I put that path in the Templates section in the developer tab it shows the correct formatting for the path.
- platform: local_file
name: crowbox_latest
file_path: /config/www/crows/timestamps/{{ states('input_text.crowboxtimetext') }}.jpg
I’ve tried the Refreshable picture card, and the Config Template Card from HACS.