How to access a file in tmp directory?

Hi, very new to Home Assistant here so apologies in advance if the answer to my question is too obvious.

From the Call Service node, I was able to call a Camera Snapshot and just to know that it works, I as somehow able to create the test jpg file in the /config/tmp directory.

Now I’m just trying to see if the .jpg file is the right file I want so I went to http://homeassistant.local:8123/config/tmp/mytestpic.jpg and according to all the documentation I find, it should work.

But it doesn’t. I have also tried http://homeassistant.local:8123/tmp/mytestpic.jpg without luck.

I’ve also added:

homeassistant:
   allowlist_external_dirs:
   - /config/tmp

to no avail.

I’ve seen some other posts where people spoke about “www” directory but I don’t seem to have it in my setup.

Can someone help me with this?

Many thanks in advance.

Thanks for explaining about HTTP.
Ideally I just want the files to be accessible internally by node-red so a ‘/config/tmp/’ is sufficient.
Can that be done without installing http?

I believe to view a media file, by adding it to the local address in HA, it needs to be stored in /config/www folder

It’s already installed

The http integration serves all files and data required for the Home Assistant frontend. You only need to add this to your configuration file if you want to change any of the default settings.

I missed this the first time around, just create it. If you use vs code or the other file editor, at the top there is a add folder button. Then I think you need to restart for any files in there to be available.

Thanks, your screenshot is not familiar with me. I use the “terminal” mode so I created the www directory manually. But I’m trying to figure out how to access the path in a function.
E.g. just as a test, I made the snapshot to save to a .jpg file in the /media directory and I can see the file there. But I can’t get it to show in a Call Service like “http://192.168.x.x:8123/media/snapshot.jpg” (just shows blank).

So I figured there’s obviously some security restricting the picture from being retrieved?

I don’t want to complicate things by turning on http because it says anybody and everybody will be able to access the www directory.

1 Like

So I save my snapshots in config/www/tmp/ to access it I use

https://x.x.x.x:8123/local/tmp/snapshot.jpg

Substitute your duckdns, or what ever service you use, for outside access.

Thanks! “local/tmp”? Interesting…I’ll give it a shot.

I’ve since found that the snapshot is not real time - it takes a copy from my Ring camera’s cache and is the same as me referencing to “…/api/proxy_camera/…?token=…” so even if it worked, it still doesn’t want do what I want…

But I’ll give it a go. Thanks very much for your help!