Sending Picture Image when doorbell rings

Hi together,

I have an automation which sends a message including a picture to my cell phone when someone rings the doorbell.

This works quite well so far with two exceptions:

  1. the message arrives sometimes extremely delayed. Mostly it comes 10-15 seconds after the bell was pressed. Maybe even faster. Sometimes it takes up to 10 minutes. Once I even got the message only after half an hour.
    What could be that?
  1. I have set the automation so that the doorbell camera takes a snapshot and attaches it to the message. This worked fine for quite some time. However, lately I always get the same snapshot in the message.
    If I look in the “config/www” where the snapshot should be stored temporarily everything fits. There is always the most current image to see. Only to the message some older one is attached.
    Can you explain this to me?

Here is the automation:

alias: Benachrichtigung an Handy wenn jemand an der TĂĽr klingelt
description: >-
  Es wird eine Benachrichtigung an mein Handy geschickt wenn jemand an der TĂĽr
  klingelt und beim anklicken der Nachricht wird ein Livestream geöffnet
trigger:
  - type: turned_on
    platform: device
    device_id: a8dd4b07084a04045e5465169b4f6bd0
    entity_id: binary_sensor.tuerklingel_visitor
    domain: binary_sensor
condition: []
action:
  - service: camera.snapshot
    data:
      filename: /config/www/tmp/snapshot-tuerklingel.jpg
    target:
      entity_id: camera.tuerklingel_sub
  - service: notify.mobile_app_galaxy_s10
    data:
      message: Da ist jemand an der HaustĂĽr
      title: TĂĽrklingel wurde gedrĂĽckt
      data:
        image: https://url-to ha/local/tmp/snapshot-tuerklingel.jpg
        entity_id: camera.tuerklingel_sub
        actions:
          - action: URI
            title: Ă–ffne Kameras
            uri: https://url-to-ha/dashboard-testseite/0
mode: single

Thank you a lot
Joe

Don’t post your HA URL here!
Anyone can see your picture and go to your Login!

1 Like

Why you getting the picture externaly? Does below not work?

image: /local/tmp/snapshot-tuerklingel.jpg

Maybe try to implement tiny delay between action snapshot and send notify command.

Or try to add below in the data part of the notify

ttl: 0
priority: high

Thank you,

didn´t thought about that… :frowning:

Does the local URL work for an external message?

BTW. Could you pleas change my external URL? I forgot about that…

Thank you

Try it :wink: Mine is working.

Sorry, I removed it

Hi
thanks again. I actually forgot to remove my URL… :frowning:

I took your suggestion and programmed it accordingly. But with the same result.
I still get an old image. What makes me wonder. It is always the same picture.
Is there possibly some cache or so???
Joe

Maybe you can try change it to;

/local/tmp/snapshot-tuerklingel.jpg

Good question about the cache thing…don’t know. You can rule that out on mobile side to delete app cache.

I can’t match this one because HA is simply catch the snapshot, stores it and then sends the file.

It’s always a caching problem if the filename does not change.
Try somrthing like this:

  - alias: notification_door_motion
    trigger:
      - platform: state
        entity_id: binary_sensor.door_motion
        to: 'on'
        variables:
          tstamp: "{{ as_timestamp( now()) | timestamp_custom('%Y%m%d_%H%M%S') }}"
    action:
      - service: camera.snapshot
        entity_id: camera.foscam
        data:
          filename: >-
            /config/www/tmp/door_{{tstamp}}.png
      - service: notify.mobile_app
        data:
          message: "Door {{tstamp}}"
          data:
            attachment:
              content-type: png
              hide-thumbnail: false
              url: http://<URL>:8123/local/tmp/door_{{tstamp}}.png

Not testet!
You have to cleanup your picture folder from time to time.

Hello,
I also have this automation but the following problem. Sometimes HA just sends me pieces of the photo to my cell phone. Sometimes the entire image is displayed and sometimes only the top part. The photo is always completely in the media folder in HA. Does anyone have an idea why this could be?