These are the relevant parts of the automation. No, it isn’t a sensor value.
- alias: Google Generative AI Analyze
service: google_generative_ai_conversation.generate_content
metadata: {}
data:
image_filename: /config/www/snapshots/driveway.jpg
prompt: >-
Explain briefly what you see in the picture, focus only on the driveway.
Try to describe people in particular. Your message should be short
enough to fit in a phone notification. Do not describe fixed objects.
Ignore animals, trash can, or lawn.
response_variable: answer
and to send the text as notification to my phone, I have:
Thanks for sharing. First time asking a question here.
Here is the YAML. My previous comment was only basically missing the top part. I want it to not send me a notification if “answer” includes “empty driveway and grass.”
alias: Snapshot Driveway
trigger:
- platform: state
entity_id:
- binary_sensor.driveway_motion
to: "on"
condition: []
action:
- alias: Take Snapshot
service: camera.snapshot
metadata: {}
data:
filename: /config/www/snapshots/driveway.jpg
target:
entity_id: camera.driveway_fluent
- alias: Google Generative AI Analyze
service: google_generative_ai_conversation.generate_content
metadata: {}
data:
image_filename: /config/www/snapshots/driveway.jpg
prompt: >-
Explain briefly what you see in the picture, focus only on the driveway.
Try to describe people in particular. Your message should be short
enough to fit in a phone notification. Do not describe fixed objects.
Ignore animals, trash can, or lawn.
response_variable: answer
- service: notify.mobile_app_asads_iphone
metadata: {}
data:
data:
image: /api/camera_proxy/camera.driveway_fluent
actions:
- action: URL
title: View
url: fb1675493782511558://
title: Driveway
message: "{{ answer.text }}"
enabled: true
Yes, I’m able to receive the image and description in my notifications.
This is unrelated to this post, but the only issue remaining now is that home assistant takes the snapshot a few seconds late, so sometimes the notification is an empty driveway. However, the snapshots from the camera itself (that are emailed to me—enabled emails to test), are at the perfect time.
If only there was a way to get snapshots from Reolink and import them to home assistant.