I am unable to configure the the snapshot image and show it in the notification on my android with using the media_source as source. It was working using the www folder, but saw in the documentation that media_source is recommended (I also like having the snapshot in the media browser inside HA.).
what am i doing wrong? any help would be appreciated. thank you!
Here is my config:
alias: AI Detect - Delivery
description: ""
triggers:
- type: turned_on
device_id: ecd294118f7c02e4666772cff6193335
entity_id: ab9a5682ec6988623d56248f1c0f2ec4
domain: binary_sensor
trigger: device
conditions:
- condition: sun
before: sunset
after: sunrise
actions:
- action: camera.snapshot
metadata: {}
data:
filename: /media/snapshot-delivery-front-left.jpg
target:
entity_id:
- camera.rlc_frontleft_fluent
enabled: true
- action: ai_task.generate_data
metadata: {}
data:
task_name: Analyze the image
instructions: >-
Analyze the image for the following two conditions:
Is there a white van located in the image (only interested in white
vans?
Is there a person present anywhere in the image?
If, and only if, both of these conditions are definitively true, respond
with a short confirmation sentence and include True in double curly
braces at the end of the response. Otherwise, respond with False in
double curly braces at the end of the response.
attachments:
media_content_id: media-source://media_source/local/snapshot-delivery-front-left.jpg
media_content_type: image/jpeg
metadata:
title: snapshot-delivery-front-left.jpg
thumbnail: null
media_class: image
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://media_source
response_variable: response
- if:
- condition: template
value_template: "{{ '{{True}}' in response.data }}"
then:
- action: notify.mobile_app_pixel_6a
metadata: {}
data:
data:
image: >-
media-source://media_source/local/snapshot-delivery-front-left.jpg?{{now().timestamp()
}}
entity_id: camera.rlc_frontleft_fluent
actions:
- action: URI
title: Open stream
uri: /lovelace/nvr
title: Probably a delivery detected
message: test
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
mode: single