Whitelist folder inside share for automation

HI all,

I followed this post to set up notification on movement with my cameras.

Problem is that I can’t use it if gifs are inside share folder. Can someone help me with it?

Here’s my config for whitelisting folder:

homeassistant:
  packages: !include_dir_named packages
  whitelist_external_dirs:
    - '/share/gifs'

Then here’s the automation that use files inside gifs folder

  • alias: Notifica movimenti in balcone cucina
    trigger:
    • platform: state
      entity_id: sensor.balcone_cucina
      condition:
    • condition: state
      entity_id: ‘binary_sensor.dss_alarm_giorno_attivo’
      state: ‘on’
    • condition: state
      entity_id: ‘binary_sensor.dss_alarm_notte_attivo’
      state: ‘on’
      action:
    • service: notify.telegrammarco
      data:
      title: “Videosorveglianza”
      message: “Rilevati movimenti nel balcone in Cucina”
      data:
      video:
      - file: share/gifs/{{ states.sensor.balcone_cucina.state }}
      caption: “Rilevati movimenti nel balcone in Cucina”

do file path is correct?

Thank you in advance

First, you need to make sure you properly format your code for the forum so can more easily see syntax/indent errors.

second and at least one likely problem is that you need to use “data_template” instead of “data” in the action service call.

  1. I tought code was correctly formatted sorry. Can you suggest me where the error is?

  2. if i manually mount the folder /gifs within docker contaier (and change the info in automation accondinly )data works, but i’ll check with data template to see if something change.