Show camera snapshot when alarm to HA app

Hi, may i know how can i push the snapshot into HA app notification whenever my home alarm is triggered? I have multiple Xiaomi Dafang and Foscam camera.

Thanks in advance.

Sorry I’m not home so i won’t be able to format this use
service camera.snapshot
entity_id: camera.mycamera
filename: www/snapshots/mypic.jpg
then send it with
service notify.mobile_app
data:
image: ‘https://mywebaddress/local/snapshots/deck.jpg
message: This is my picture

Lots of good info on how to do this here: https://companion.home-assistant.io/docs/notifications/notification-attachments

That’s a nice information, serves my need. Now, i just need to figure out where will my camera store the image.

You define that in the camera.snapshot service call: https://www.home-assistant.io/integrations/camera#service-snapshot

I can’t seem to be able to get images to show up in notifications, doesn’t matter what I try.

This is my code (using nabu casa):

    action:
      - service: camera.snapshot
        data:
          entity_id: camera.hikvision_cam
          filename: '/config/www/images/frontdoor.jpg'
      - service: notify.mobile_app_sm_j530y
        data:
          message: "Motion detected at door {{now().strftime('%H:%M %d-%m-%Y')}}"
          data:
            image: "https://someid.ui.nabu.casa/local/config/www/images/frontdoor.jpg"

Any ideas? It works fine with other external (non-nabu casa) links…

            image: "https://someid.ui.nabu.casa/local/images/frontdoor.jpg"

the www folder in your config directory is just local so no need for the extra part

I think you can use relative paths, so you can also use:

image: "/local/images/frontdoor.jpg"

This avoids it loading the image from the external URL when you are on the local WiFi.

you can, I was just pointing out what was wrong with the URL :slight_smile: its also documented on the site that I linked to up above

Awesome - thank you. I know it’s something simple but after a few thousand lines of yaml over a couple of years it’s something I never picked up…

Can you send multiple images in the same notification? i.e. I have 8 cameras and would like to send all 8 snapshots when the alarm goes off but I am only able to send one at a time.

only 1 at a time

Thought that might the case, thanks