Point media_dirs: at NAS share?

Hello @insajd

i have install portainer and create /mnt/nvrubuntu in homeassistant container
if i mount like this in portainer :

mount -t cifs -o username=xxxxxxx,password=xxxxxxxxxxxxxxxxxx,domain=WORKGROUP //192.168.1.33/nvrubuntu /mnt/nvrubuntu

i can see my data under /mnt/nvrubuntu

and my config in HA is :

  media_dirs:
    recording: /mnt/nvrubuntu

so i have create a folder “recording” in media under windows with samba share on HA and expect to see my data, but nothing.

I can see under portainer homeassisant but not under folder “recording” in my samba share.

What i am doing wrong please?

with homeassisant portainer If i delete / create a folder under /media i can see it in samba share of HA under windows. if i mount under portainer in this media folder, i cant see anything in samba share too, but data is good under /media folder in portainer. Sure im missing something…thanks

I simply do not understand how to add a remote share as a medir_dir…
Failed to find a COMPLETE instruction how to do it.
There are just small pieces of info & mainly for “nerds”)).

Using HA in container.
There are lots of shares like “smb://192.168.0.2/Music/”.
This code

homeassistant:
  media_dirs:
    music: "smb://192.168.0.2/Music/"

or

    music: "smb://USERNAME:[email protected]/Music/"

gives an error
ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Invalid data for call_service at pos 1: Not a directory for dictionary value @ data[‘media_dirs’][‘music’]

Probably I need to make available this share for a HA container - by no idea how to do it(((.
Assume I have a LOCAL folder “/home/media” - then I may “add” this folder to a container by

-v /home/media:/media

but do not know how to add a REMOTE folder.

I saw smth about using a “mount” command in this thread.
Probably I need to:
– mount the remote share as a local folder,
– then add this mounted folder into the container,
but I do not understand how to mount a remote share…

HA added official support for this. I haven’t tested it out maybe have a look there:

I do not have these features in my setup )))))
These “add storage” things just absent here.
Also, it was clearly said there - “This long and highly requested feature is now available when running the Home Assistant Operating System”. And not many people use HAOS…

Sorry I couldn’t help you then. But just to be clear, HAOS is the main installation method others are using, which is why I suggested a solution for it:

Meanwhile it turned out that my guess was correct:
if you need to add a remote share as “media_dir” to HA in Docker, you need to:

1.Mount a remote share to OS.
Found a great detailed manual.
Result - I have a “/mnt/music_on_nas” folder.

2.Mount this folder into the HA container - use this option in “docker run” command:

-v /mnt/music_on_nas:/music_on_nas

Result - the “music_on_nas” folder is visible for HA.

3.Add the folder as a “media_dir”:

homeassistant:
  media_dirs:
   music_on_nas: /music_on_nas

May be this is not the best way, I am not a Docker or *nix expert.
For me, that manual I mentioned is a very clear & detailed info.