Receiving camera snapshots as a notification in the IOS app

Indeed. Working again! Thanks!

I been struggling with this with no luck.
I now get pictures taken, saved and sent with SMTP but not to my Iphones
Can someone please paste a working code for a automation that sends a picture as a attachment.

here is my just edit your url

  id: 3866009ee7414a7790b683a8b1d692bd
- id: doorbell_alert
  alias: Doorbell Alert
  trigger:
  - entity_id: binary_sensor.wyzesense_778d71d2
    platform: state
    to: 'on'
  condition:
  - condition: template
    value_template: '{{ (as_timestamp(now()) - as_timestamp(state_attr(''automation.doorbell_alert'',
      ''last_triggered'') | default(0)) | int > 5)}}'
  action:
  - data:
      entity_id: camera.wyze1
      filename: /config/www/intruso.jpg
    service: camera.snapshot
  - data:
      data:
        attachment:
          url: https://your_url/local/intruso.jpg
        push:
          sound: Doorbell.wav
      message: Someone has pressed the doorbell.
    service: notify.mobile_app_iphone
2 Likes

Thanks !!
But is that picture attached ? Looks like you just get a link to the picture ?
I am looking for the same feature as in SMTP where the picture is attached to the message.

Hi There,

is there anyone, who got this to work?
I am strubbling quite some time now, but I don’t get the snapshot to pushed to my iphone.
When someone presses the doorbell, the snapshot is made, and I receive a pushmessage that there is someone at the door, but the snapshot is not attached.

And I followed this scritp to the letter.
anyone, any ideas?

The attachment url should be using your external url either nabu cash or duckdns if you are using those.

If you put the attachment url into your web browser when not connected to your home wifi can you seen the snapshot?

I got it working, but like @greg is saying, you need to open your router and enable portforwarding to your server where the snapshots are.
I would like you have them as a attachment like it can be done in Domoticz but I didnt get that to work in HA

You should still provide your config… even though you “followed it to the letter” it is possible something he has isn’t the same for you, a directory etc… also check the logs after it fires to see if it provides any information… it’s also possible depending on your system that the file hasn’t finished being saved by the time the message is being sent… lots of possibilities. Are you using the identical filename or a timestamp filename?
either way, your config would be helpful.

Hi guys,

thanks for the quick response.

This is how is setup in my automation.yaml.
I tried to make the automation through the menu. (settings -> automation)

this is the result:
"- id: ‘1587465219735’
alias: Deurbel (doorbell, I’m dutch)
description: ‘’
trigger:

  • entity_id: switch.deurbel
    from: ‘off’
    platform: state
    to: ‘on’
    condition: []
    action:
  • data:
    filename: /config/www/cam_captures/voordeur_{{ now ().year }}{{ now ().month
    }}{{ now ().day }}_{{ now ().hour }}.{{ now ().minute }}.jpg
    entity_id: camera.uvc_g3_dome
    service: camera.snapshot
  • data:
    message: Er staat iemand voor de deur (someone at the door)
    service: notify.mobile_app_iphone_van_j_w
  • data:
    data:
    attachment:
    content-type: jpeg
    url: https://hassio.jwmaijers.nl/local/cam_captures/voordeur_{{ now ().year
    }}{{ now ().month }}{{ now ().day }}_{{ now ().hour }}.{{ now ().minute
    }}.jpg
    message: Er staat iemand voor de deur."

It is like I said, the picture is taken and written away in the /config/www/cam_captures folder, with date and time stamp. And I am receiving the pushmessage that someone is at the door, but without the picture.

when I put the attachment url directly in my browser I also get an error: "404: Not Found.
And also when I enter the intern IP adress of my server.
Getting the feeling, this might be the problem!

I am running home assistant behind a reversed proxy, so there are no ports open in my router.
but the reversed proxy traefik is working like it should.
My Home assistant is available at https://hassio.jwmaijers.nl. this url is working.

Any ideas?

A few things for you:

  1. please format your code when posting it so we can assess it correctly
  2. don’t share your public url. Anybody seeing it might want to try hacking you
  3. the time might change between saving the file and sending it. Best is to save the file twice. One with timestamp and one with generic name like “latest” which you can use for notifications
  4. last but not least, if you’re going to use templates in your actions, you need to replace data: with data_template:

Good luck

Hi guys,

I’m having the same issue as many others, it seems. I’m only getting the text in the notification, no thumbnail, and nothing but the text if I 3D press / swipe. Am I missing something in the automation? The URL to the jpg image works when I use the browser to check it.

- id: '1586022249478'
  alias: 'Person detected'
  trigger:
  - event_type: sighthound.person_detected
    platform: event
  action:
  - data:
      message: 'Person detected'
      #title: Person upptäckt
      data:
        attachment:
        - url: "https://xxx/local/sighthound_kamera_baksidan_latest.jpg"
          content-type: jpeg
    service: notify.mobile_app_iphone
1 Like

I have started having the same issue. The notification comes through but the image/thumbnail does not.

As a test, when I call the notify.mobile_app_xxx service through the service dev tool using the following I get the message but not the thumbnail or image. The url shows the image when accessed through the browser.

message: "Test!"
 data:
  attachment:
    url: "https://github.com/home-assistant/home-assistant-assets/blob/master/logo-round-192x192.png?raw=true"
    content-type: png
    hide-thumbnail: false

Any suggestions would be greatly appreciated.

Is this problem already solved. I am having exaclty the same problem. Using my internal url(which shows the picture in my browser), updated HA on my docker today but still no image in the notification. Only the message.

this would not work as you’re pointing to an html page instead of the picture.
Try at least to replace the URL with:
https://raw.githubusercontent.com/home-assistant/assets/master/logo-round-192x192.png

Ik tried the image(http://192.168.1.181:8123/local/frontdoor.jpg) on my HA which is working via a browser. This is http so that’s why i tried just a random https picture on the internet.
This is the code now but unfortunatly it’s not working(the image). I added also a sound and this is working. No errors shown in HA.

- id: 1594823936411
  alias: Test
  description: ''
  trigger: []
  condition: []
  action:
  - data:
      data:
        attachement:
          content-type: png
          hide-thumbnail: false
          url: 'https://www.deliberation.nl/wp-content/uploads/https.png'
        push:
          sound: US-EN-Daisy-Front-Door-Motion.wav
      message: Hello
    service: notify.mobile_app_jorans_phone

I installed HA on a docker on my NUC. Versio 0.112.4. Don’t know where to look now to be honest.
The stream on my phone is working in my attachement so it’s only the image(url) which is not working.

1 Like

You have a typo in your action, specifically attachement instead of attachment.

I feel a bit ashamed but it was the typo. Thank you so much and I checked it so many times but still…

any chance you can post the details of the two SVC: nodes?

Thanks for this! I was able to use your example code to fix my notification!

hi everyone i have been using this integration for a long time and it has always worked, but since i upgraded to ios14 and home assistant 0115.2, the notifications arrive on the iphone but no image, if i press and hold the notification, the camera image is displayed . the snapshots of notifications are displayed without problems on the apple watch. the problem affects only the iphone. in the log I see notification errors, does it happen to you too?