Stopped because an error was encountered

I set up my first automation and get the following error.

Stopped because an error was encountered at 13. Dezember 2023 um 15:14:27 (runtime: 0.09 seconds) expected dict for dictionary value @ data[‘data’]

Here the yaml code

alias: Klingel Pushover mit Bild
description: ""
trigger:
  - platform: state
    entity_id: event.hm_sen_db_pcb_neq0956897_ch1
condition: []
action:
  - service: camera.snapshot
    target:
      device_id: e83c47ed5f31c6b5bc3074086874f8bb
    data:
      filename: /tmp/camera/snap.jpg
  - service: notify.pushover
    data:
      data: /tmp/camera/snap.jpg
      message: es hat geklingelt
mode: single

Try putting quotes around the file names.

i added quotes.

Now i get an new error:

Stopped because an error was encountered at 13. Dezember 2023 um 17:16:20 (runtime: 0.00 seconds)

Error rendering data template: Result is not a Dictionary

Based on the error, and looking at the HA Pushover docs the issue is the line data: /tmp/camera/snap.jpg. That data key expects a dictionary of key-value pairs not a filepath…

alias: Klingel Pushover mit Bild
description: ""
trigger:
  - platform: state
    entity_id: event.hm_sen_db_pcb_neq0956897_ch1
condition: []
action:
  - service: camera.snapshot
    target:
      device_id: e83c47ed5f31c6b5bc3074086874f8bb
    data:
      filename: "/tmp/camera/snap.jpg"
  - service: notify.pushover
    data:
      data: 
        attachment: "/tmp/camera/snap.jpg"
      message: es hat geklingelt
mode: single

I edited the yaml:

alias: Klingel Pushover mit Bild
description: ""
trigger:
  - platform: state
    entity_id: event.hm_sen_db_pcb_neq0956897_ch1
condition: []
action:
  - service: camera.snapshot
    target:
      device_id: e83c47ed5f31c6b5bc3074086874f8bb
    data:
      filename: "/homeassistant/tmp/camera/snap.jpg"
  - service: notify.pushover
    data:
      message: es hat geklingelt
      data:
        attachment: "/homeassistant/tmp/camera/snap.jpg"
mode: single

Now i get the error:

Cannot write /homeassistant/tmp/camera/snap.jpg, no access to path; allowlist_external_dirs may need to be adjusted in configuration.yaml

my configuration.yaml:

homeassistant:
 allowlist_external_dirs:
 - /homeassistant/tmp/
 - /homeassistant/tmp/camera/

also tried:

 
allowlist_external_dirs:
 - /homeassistant/tmp/
 - /homeassistant/tmp/camera/