Having trouble sending a local file

I’ve been using the telegram bot to send snapshots of pictures from my ip cameras (via web address) but there are times where it takes a while and by the time a snapshot is taken, whatever it was that triggered a motion event has long gone.

I am however saving all events as jpgs and can store them anywhere. I’ve got a number of images in my config/www folder that I can access in the lovelace file using ‘/local/XXX.jpg’

I incorrectly assumed I could do the same in my automations file:

  • service: notify.telegram
    data:
    title: “Send an images”
    message: “That’s an example that sends an image.”
    data:
    photo:
    - file: ‘/local/XXX.jpg’

but am getting this msg in the logs:

'/local/XXX.jpg' are not secure to load data from!

I’ve read that there could be some trusted directory permissions issue at hand but given that folder is accessible for lovelace I don’t see how that is the case.

any ideas?

1 Like

Try:

  - file: '/config/www/XXX.jpg'
1 Like

perfect. why the inconsistencies between how to access local files? seems a little strange

/local for urls, /config/www for file path configs. /local is only mapped by the web server.

1 Like

gotcha. thanks again!

Hi,

I have configured like you advised. Using ‘Call service’ function under developer tool, not an issue. But When i try to run any automation with that, It’s not working. I am not sure what is the problem.
Also I have noticed that I am unable to access the file using http://ip:8123/local/xx.jpg (shows 404). Pls note that I am using Ngnix reverse proxy to access HA outside of the network. not sure if that’s causing this issue