Image on notification not showing

I have an automations that takes a snapshot from my camera and saves it to the local media folder. afterwards it will create a notification showing this image. For some reason this automation has stopped working and I can figure out why. The notification pops up but the image comes with and error message saying: “response status code was uacceptable: 404”

Does anyone have any idea of what could be wrong?

Here is my code:

action:
  - data:
      filename: /media/Sec_home_temp_bagh.jpg
    target:
      device_id: 3aa2a495c014725914a36a519b51aea7
    action: camera.snapshot
  - data:
      message: Bil registreret i indkørslen
      title: ALARM!
      data:
        url: unifi-protect://
        image: /media/local/Sec_home_temp_bagh.jpg
        actions:
          - action: DISABLE_ALARM
            title: Slå alarm fra
        push:
          sound:
            name: default
            critical: 1
            volume: 0.2
    action: notify.notify

Hi dkvistgaard,

So my first thought is to make sure where notify is looking for the image, that there is an image there. It is not clear that the image you named in this 2x is in the same path both times.

Other than that, it would help anyone looking this over greatly if you could reformat that to the format suggested in the site FAQ. Since indentation is everything for YAML, that format does not show the spacing and we are just guessing here.

This link should help you edit that for us.

How to help us help you - or How to ask a good question.

Thank you for answer :slight_smile:

The image is there in the folder, sp the first part of the script where is creates the snapshot is working fine, the issues is with Notify. According to the dokumentation about the image notifikations you should add the /local/ part to the path inorder for it to work. I have also tries without that part but then I don’t even get an error message, there is just now image.

You are ofcourse right about the formatting, sorry about that. I have updated mu post so that the YAML is showed correctly. :slight_smile:

Using the local part of your path does necessarily mean literally add the work local…
Setting up local media sources - Home Assistant.
and
Media source - Home Assistant

Thank you for the links, they where very useful :slight_smile: It seems like fore some reason I at some point have added the media_dir to be /media instead of the default /local, in the konfiguration.yaml. That seemed to solve the issue.

Thank you.

1 Like