NAS folders on Home Assistant

Here is my working config.

HA is supervised on Intel dedicated machine, NAS is OMV 6 quiet basic setup. No RAID and that kind of stuff, no virtual machines involved on both sides.


# Mount NAS drives
shell_command:
  mount_nas_music: mkdir -p /media/NAS/Music;mount -t cifs -o username=XXXXX,password=XXXXX,domain=WORKGROUP //192.XXX.XXX.XX/Media/Music /media/NAS/Music
  mount_nas_movie: mkdir -p /media/NAS/Movie;mount -t cifs -o username=XXXXX,password=XXXXX,domain=WORKGROUP //192.XXX.XXX.XX/Media/Movie /media/NAS/Movie
1 Like

That was it, I was missing the destination at the end of the mount…

I swore I copied his code exact?!?

Thanks.

1 Like

Has anyone gotten this to work on Home Assistant Operating System? I just get permission denied errors. I’ve tried NFS and SMB/CIFS.

i used the simpler version of the above command
mount -t cifs -o username=XXXXX,password=XXXXX //192.XXX.XXX.XX/blabla /media/NAS

but I don’t need this share anymore, how to UNMOUNT this folder, what is the proper syntax for that?

umount /media/NAS

that worked, thanx!

What if I want to use my router’s shared folder?

\Keenetic-4001\01d8cdb07a47e5a0

Just tried this. I can see mounted folder contents in terminal, but not in Media storage. Am i doing something wrong here?

What do you mean “media storage”

What was your mount command?

I solved my issue, but will describe the cause here for others.

I basically copied the command above with create dir + mount, to shell_command.
Shell command was failing with “error 111”.
Same command in Terminal/SSH add-on was partially successful: folder created, NAS mounted, and contents are visible with “ls” command.
But despite the created folder itself was visible in “Media” menu under “Local Media”, it was empty.
I checked, that it’s actually same dir. I uploaded some photo inthere from Media browser, and checked that photo is visible in Terminal (while NAS is unmounted). It was.

Then I tried to remove folder creation from shell_command, leaving only mount part.
And voila, it worked.

I guess, there’s 2 problems:

  1. No permissions to create folders from shell command.
  2. Some drivers issue, that doesn’t show mounted content, if it was mounted AFTER Media browser initialization.

this just worked fine with a Zyxel NAS, but since I started using a new TrueNAS server I can’t figure out the right command for mounting it

can’t even check logs for errors, because I don’t know where to find them…

any suggestions?

Thx much!!! This worked for me.