Media folder location?!

With Docker, if you write to a path that’s not mounted, the file will be located within the Docker container. If you run sudo docker exec -it homeassistant ls /media (or sudo docker exec -it homeassistant /bin/sh then ls /media), you’ll see them. On a default Docker installation on Debian using overlay2 (which is the default unless you explicitly change it to use something fancy like ZFS), they’ll be somewhere in /var/lib/docker/overlay2/.

Note that storing files within the container itself is a bad practice. They’re expected to be ephemeral, and things like docker compose down and upgrading the Docker image will remove the entire container, including any files within it.

1 Like

can you please guide how to change the path of the media folder. I am running homeassistant supervised on raspberry pi 4 with a debian 11 OS

Two years later and I’m trying to figure this out… I don’t understand the use of the new Media section if all media is root.

I’ve created ‘/config/media’ and added the following to my config file…

  media_dirs:
    local: /config/media

I’ve tried ‘/media/local/fam.png’ as path.

In checking paths via ‘ls’ in Terminal, my pics added to ‘Media/My media’ folder still show on root. If I’m not to use the Media section to link pictures to from within the Frontend (Dashboard card), do I need to manually upload them? So confusing.

1 Like

Not only that, but one is in quotes and the other is not.

Sooooooo painful. Talk about putting all your geekery into question, this took me a long time to get right. HAdevs need to spend less time making nice thermostat cards. and spend more time on this.

Anyway, just wanted to say thanks. This worked for me. HAcore running on a HABlue Odroid. iOS notifications with image attachments - check.

Can you tell me what I’m doing wrong?
Configuration error!!!

Not a directory for dictionary value @ data[‘media_dirs’][‘media’]

my configuration.yaml for my home assistant core

# Loads default set of integrations. Do not remove.

default_config:


# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

homeassistant:
  media_dirs:
    media: /config/media

folder structure

Your configuration.yaml works fine for me… not sure what’s wrong. Maybe make sure your indentations are spaces, not tabs.

Found a solution to my problem for my Home Assistant Core on synology nas.

  1. media pack path
media_dirs:
    media: /volume1/@appdata/homeassistant/config/media/
  1. Set permissions to the folder via ssh with the command

chmod 755 media

chmod 644 file1.txt file2.txt file3.txt

if that works for you, that works and maybe you don’t want to futz with it anymore. understandable…

it feels wrong tho. exposing abstractions of the nas that you shouldn’t.

if it’s helpful to you, this is what i have for my config to my nas:

homeassistant:
  media_dirs:
    media: "/media"
    photos: /media/cc_haimages
    

i have cc_haimages mounted as a samba share w/ usage==media in system->storage

and i refer to it in an image card like this:

type: custom:media-source-image-card
image: |
  media-source://media_source/photos/test.jpg
entity_id: input_boolean.testbool

i think that’s everything i have in my config that’s relevant.

also, @shony28 , welcome to the community… folks are definitely here to help each other. your issue here is related but not the same as the original post. in those cases, you should start a new thread. that lets the original thread stay clean, and to your benefit your post gets marked as “new” and can help get a resonse faster.