Open grzestel opened 10 months ago
Hey @grzestel ! In this example I add an timestamp to the camera still URL to avoid this cache problem:
alias: Motion notification
trigger:
- type: motion # For the trigger, I selected my camera device on the UI, and it had an option for 'Motion started detecting motion'
platform: device
device_id: [device_id]
entity_id: [device_id]
domain: binary_sensor
condition: []
action:
- service: notify.tvoverlaysample
data:
message: Motion detect at Front door!
data:
image: >-
[home_assistant_external_url]{{ state_attr('camera.[CAMERA]',
'entity_picture')+'&time='}}{{as_timestamp(now())}}
# home_assistant_external_url is my https url for my home assistant.
# entity_picture is a parial url to the camera still image, like '/api/camera_proxy/camera.[CAMERA}?token=XXX'.
# I added a timestamp simply to avoid the image being cached.
color: "#B00020"
largeIcon: mdi:motion-sensor
smallIcon: mdi:camera
seconds: 10
mode: single
I'm thinking in a way to add an optional way to disable cache
My automation is capturing camera stream and oversaving as a file and then sending notification but by your integration displays only one cached picture, telegram notify and Notifications for android TV works fine