For my frontdoor I’m working on a way to see who rang the doorbell. First I set an input_datetime and use this to store the image and to display the image.
service: input_datetime.set_datetime
target:
entity_id: input_datetime.deurbel_history_1
data:
timestamp: '{{ now().timestamp()|int }}'
service: camera.snapshot
target:
entity_id: camera.voordeur
data:
filename: >-
/config/www/camera_voordeur/voordeur_{{
(state_attr("input_datetime.deurbel_history_1","timestamp")) }}.jpg
Images are stored locally with the timestamp. An example of an image is:
https://XXXXXX.duckdns.org:8123/local/camera_voordeur/voordeur_1620338171.0.jpg
So far everything is working.
I was trying to get a picture entity card to display the latest image. Unfortunately I can’t seem to get the template working. It works in developer tools but it will not in a picture entity card.
type: picture-entity
image: >-
/local/camera_voordeur/voordeur_{{
(state_attr("input_datetime.deurbel_history_1","timestamp")) }}.jpg
entity: input_datetime.deurbel_history_1
show_name: false