I have an automation set up to push notify.notify of camera.snapshot from a local_file camera. In this, I have two snapshots taken, one for the notification that is a static path and another taken with a dynamic path with the now()function passed as the file name.
I would like to have the picture card that references the notification file point to the dynamically created snapshot file path instead of the static (this is to keep multiple notifications point to the snapshot that is pushed to the preview of the notification.
The automation.
action:
- service: camera.snapshot
target:
entity_id:
- camera.<entity_name>
data:
filename: /media/<path-to>/person-notification-image-reolink.jpeg
- service: camera.snapshot
target:
entity_id:
- camera.<entity_name>
data:
filename: >-
/media/<path-to>/reolink_{{now().strftime('%Y%m%d_%H%M%S')
}}.jpeg
- service: notify.notify
data:
message: Someone was seen at the door!
title: A person was detected!!
data:
image: >-
api/camera_proxy/camera.<entity_name>?token={{state_attr('camera.<entity_name>','access_token')
}}
entity_id: camera.<entity_name>
actions:
- action: URI
title: View Camera Feed
uri: /lovelace/<path-to>
- action: URI
title: View Snapshot
uri: /lovelace/<path-to>
The camera
camera:
- platform: local_file
name: <entity_name>
file_path: "/media/<path-to>/person-notification-image-reolink.jpeg"
- platform: local_file
The picture card
show_state: true
show_name: true
camera_view: live
type: picture-entity
image: >-
/api/camera_proxy/camera.<entity_name>?token={{state_attr('camera.<entity_name>','access_token')
}}
aspect_ratio: 1920 x 1650
entity: camera.<entity_name>
I am pretty sure there is a way to do this but havent been able to figure it out. Maybe if someone has come across something similar?
Does anyone have any suggestions?