Generative AI camera snapshot notification

When I try to edit the Automation in yaml or the blueprint in using the home assistant app, I do not see anything like the code snippet you provided.

UPDATE:
My bad, instead I tried using file editor add-on and browse to the location of the blueprint yaml file. I see what you’re saying now.

I took the first 5 and the last line of my example straight out of the - only - file called ai_camera_motion_notification.yaml from the folder called \blueprints\automation\mcinnes01.

No idea why yours would look different - unless you downloaded a previous version of the blueprint that didn’t have these lines (yet), which is hard to imagine because it holds the info for the notification that’s sent to your mobile.

1 Like

I had to play around with the indentation for a bit since File Editor was complaining. This is what I ended up with that cleared the formatting errors.
But after a new trigger from the camera, the notification Channel is still ‘General’ and not using the new Low channel

sequence:
      - device_id: !input notify_device
        domain: mobile_app
        type: notify
        title: '{{ motion_name }} Detected'
        message: '{{ generated_content[''text''] }}'
        data: '{% set android_data = {"image": snapshot_access_file_path} %} {% set
          ios_data = {"attachment": {"url": snapshot_access_file_path, "content_type":
          "JPEG"}} %} {{ ios_data if is_ios else android_data }}

          '
      data:
        channel: Low
mode: single

This needs to be at one level lower than the data entry above, i.e. two spaces further to the right.
Apologies, my spacing might not have been correct in the example.

1 Like

So should I ignore this formatting error file editor is complaining about?

duplicated mapping key (125:9)

 122 |           "JPEG"}} %} {{ ios_data if is ...
 123 | 
 124 |           '
 125 |         data:
---------------^
 126 |           channel: Low

It still looks like it’s not intended far enough - it needs to be on the ‘next level down’ from the ‘data’ above, i.e. 10 spaces in.

1 Like

Yep I have the same.

Oddly every type of this I have the same. Image and “ai” is the previous event.

This is what I have now for channel and delay, file editor still complaining about indentation though:

      sequence:
      - device_id: !input notify_device
        domain: mobile_app
        type: notify
        title: '{{ motion_name }} Detected'
        message: '{{ generated_content[''text''] }}'
        data: '{% set android_data = {"image": snapshot_access_file_path} %} {% set
          ios_data = {"attachment": {"url": snapshot_access_file_path, "content_type":
          "JPEG"}} %} {{ ios_data if is_ios else android_data }}

          '
          data:
            channel: Low
      - delay: 60
mode: single

Notification comes in under General notification Channel and not Low.

I just sent a message through formatted like this and it created the channel ‘Low’ in my app:

          data:
            ttl: 0
            priority: high
            channel: Low
1 Like

I updated the yaml to:

      - device_id: !input notify_device
        domain: mobile_app
        type: notify
        title: '{{ motion_name }} Detected'
        message: '{{ generated_content[''text''] }}'
        data: '{% set android_data = {"image": snapshot_access_file_path} %} {% set
          ios_data = {"attachment": {"url": snapshot_access_file_path, "content_type":
          "JPEG"}} %} {{ ios_data if is_ios else android_data }}

          '
          data:
            ttl: 0
            priority: high
            channel: Low 
      - delay: 60
mode: single

And the notifications still arrive in General notification channel…

WAIT! Do I have to redeploy the blueprint after editing the blueprint yaml or does my existing automation inherit the blueprint yaml edits?

Bummer - I’m out of ideas now :frowning:

My understanding is that you run the risk of overwriting the manual changes you made if you redeploy the blueprint.

1 Like

That was my understanding as well. I’ll continue to play around with indentation. But I’m hoping the creator @mcinnes01 of this blueprint could incorporate notification Channel in the next version.

Added the blueprint, added the entities but it doesn’t work. Am I missing something?

The automation “Camera Snapshot, AI & Notification on Motion” (automation.camera_snapshot_ai_notification_on_motion) has an unknown action: google_generative_ai_conversation.generate_content.

This error prevents the automation from running correctly. Maybe this action is no longer available, or perhaps a typo caused it.

Have you configured Google Generative AI integration?

New to HA - just setting up my HA Green - and wanted to show the wife something ‘smart’ and this blueprint is great. I have the notifications working to my iPhone and whilst the AI message received correctly describes the image from my Ring camera, the actual image received with the iPhone notification is a baseline image not showing the cause of the motion. Any ideas? TIA

This blueprint is great and makes setting it up so easy.

Is there anyway of getting the notification and image sent to pushover at all?

Thanks

Did you figure this out? Mine does the same on all of my cameras. The description is correct, but the image is not.

UPDATE: RESOLVED
I was able to change which of the 3 screenshots it sends in the notification.

  1. Use the Blueprint to create your automation
  2. Edit the YAML of the newly created automation
  3. Change code line 62 (at least it’s 62 for me, but I added persistent notification code as well, so it may be different for you, but at least near 62).
  4. Change snapshot1 to snapshot3
  snapshot_access_file_path: /local/snapshots/{{ camera_path }}_snapshot3.jpg
1 Like

I love the descriptions but I can’t get my images to be recent. The description appears to be of the recent event but the image is from days ago. I am using this with my Eufy T8213 doorbell.

This doorbell has two images when I view it in devices. One is tied to Sensor Camera with entity ID camera.doorbell. The other one is tied to Sensor Event Image with entity ID image.doorbell_event_image.

The image that is saved to the www folder is 3 snapshots from entity ID camera.doorbell. The images are recent in the folder yet the notification I received is from days ago. I can’t figure out where this image is being pulled from. Any ideas?

I have this working! I sometimes get a snapshot from either before or after the motion, but I can live with that for now.

But - going back to the author’s first post in this thread, my notifications look the same when I swipe down from the top:

The PROBLEM is that I can’t read all the text (after the three dots). And when I touch the notification, Home Assistant opens, but no text there.

Has anyone overcome this issue?

2 Likes

I’m trying to work this out currently too.

2 Likes