Picture not showing in companion app (android)

Hello,

I’ve created a very simple automation that saves a snapshot to the /media directory upon motion detection by a doorbell (eufy E340), and then sends this snapshot to the Companion App on my Android smartphone.

The code looks like this:

alias: Eingang Person
description: ""
triggers:
  - type: motion
    device_id: ac7fcf99317ff623628eb635b61d4771
    entity_id: 2e132be66ec485eb6acbbcac99abd024
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - action: image.snapshot
    metadata: {}
    data:
      filename: /media/eingang.jpg
    target:
      entity_id: image.haupteingang_event_image
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - action: notify.mobile_app_pixel_10_pro_xl
    metadata: {}
    data:
      message: Person am Eingang
      title: Eingang
      data:
        image: "/media/eingang.jpg"
mode: single

The first part works flawlessly. The snapshot is correctly created and saved under /media.
The push notification also arrives, but without the image. :confused:
If I remove the quotation marks, i.e.,

image: /media/eingang.jpg

nothing changes (which was expected).

Other images from /media also don’t work.

However, other images from an external source, such as:

image: "https://design.home-assistant.io/images/brand/logo.png"

work perfectly fine.

Read permissions are available for /media and for the image itself.

I hope someone can help me figure out what I’m missing. Thanks.

Hello ElCattivo,

When I want to store media, I want to be able to easily not back it up, so I do this. The backup integration has a specific button to exclude the media folder.
For me in configuration.yaml

homeassistant:
  media_dirs:
    local: /media

Then the /media path becomes part of /local .
And put the mp3 in a folder in HA under

/media/mp3

(The media folder already exists, you would want to add a sub folder to that, or at least I did, to keep your OCD happy.)
When I want to use an MP3, the path is

media-source://media_source/local/mp3/Ships_Bell_4.mp3

Adjust as you desire, but that is a basic version of mine. Works for all media.
Longer version in here: HA Config

1 Like

Thank you for this hint which I will follow.
But this doesn’t solve the issue I was describing :neutral_face:

So you’ve tried it and when you address the media-source path it doesn’t help here?
That’s interesting.
Have you restarted HA after editing the configuration.yaml?

Unfortunately, that’s correct.

Check this out…

media_source (recommended)

The media_source integration has the advantage that access requires authentication headers (which Home Assistant provides to the companion app). This means the content is not publicly available.

You can use relative URLs in the format /media/local/direct.jpg with this integration.

info

A file stored in /media/file.jpg on-disk is represented by /media/local/file.jpg in the notification. Note the addition of the local part of the path.