I’ve been working on setting up a smart home automation system and have run into an interesting issue with persistent notifications. Whenever someone rings my doorbell, I want to receive a notification with a hyperlink to the full image URL captured by my camera. The setup works in theory, but there’s a strange behavior when I click on the link.
The first time I click the URL, it opens a blank window. However, if I refresh the browser, the image loads perfectly, which means the image is definitely published on the webserver. This is puzzling because the image is accessible, but the initial click doesn’t render it. I suspect it might be a caching issue or something related to how the browser handles the link.
Here’s a snippet of my current automation configuration:
yaml
-
data_template:
value: ‘{{ now().strftime(’‘%Y%m%d_%H%M%S’‘) }}’
entity_id: input_text.cam_snap_timestamp
service: input_text.set_value -
data:
filename: /config/www/camera/{{ states.input_text.cam_snap_timestamp.state }}_snap_voordeur.jpg
entity_id: camera.cam_voordeur
service: camera.snapshot -
data:
message: 'Er is iemand aan de deur: [foto voordeur](/local/camera/{{ states.input_text.cam_snap_timestamp.state }}_snap_voordeur.jpg)  ’
title: Deurbel
service: persistent_notification.create
I’m wondering if anyone else has encountered this behavior or has any suggestions on how to resolve it. It would be fantastic to get the image to load immediately upon clicking the link without the need for manual refreshing. Any insights or workarounds would be greatly appreciated!