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.