This worked a treat thanks.... I'm using my Nvidia Shield with ext HDD connected as my NAS, this now allows me to play my media and also save my camera snapshots externally to HomeAssistant saves bogging it down. Thanks
Another well explained tutorial Chris. Initially I was seeing 'No items' in HA under Media, but going through the comments I saw that a password with special characters causes issues, so I used a different one and that did the trick! Thank you...
Great tutorial! Everything explained well and clear. Although, I'm not convinced I like the idea of making mistake on purpose and revealing it only after the restart. Am I the only one doing changes as you go before the video reached its end? :)
Have you done a similar tutorial on mounting a USB drive into that media share Chris. I'm totally stuck. I have a 1Tb USB drive with all my music files on it. I plugged it into the Dell 3040 that hosts my standard HA installation but have no idea how I can make that drive visible.
interesting timing, since I also have a synology nas and am trying to setup media files recently. when you do these code intensive videos, do you have the code available somewhere to copy paste? thanks for posting this!
Chris I’m new to the whole HA world but I currently own a Synology NAS DS420 and would like to either create HA in there or to use a Pi for HA hub then to link it to my NAS for storage. What is your recommendation for HA hub based on easy to use/install. I’m a noob here, sorry in advance if is a dumb question
Being new, I wouldn't start by using the NAS for HA (you'd have to create a container to run it). It adds complication to the whole setup. Depending on how much stuff you are going to be adding to your ecosystem, I would start with a Pi4 as a cheaper way to start playing and learning. I started on a pi3 years ago and am currently running my production setup on an Odroid N2+.
hello, nice tuto! i dont know why but it doesn work for me, i am under Hassos and the only way to make it works is to mount in /mnt/myfiles then make a symlink with "ln -s /mnt/myfiles /media/myfiles". any idea please? and of course in my samba share, i dont have a folder "myfiles". i expect to have a folder"my files" in my share too. thanks!
Great and immersive explanation. I'm not quite familiar with cifs, i assume it is a protocol like NFS, samba etc. My question is if it is possible to use NFS or samba with a shell command to mount the directory instead? Edit: after further digging i found that cifs is based of or similar to smb. i will try to make it work.
Mounting using this method comes down to what you want to use it for, of course. Might not make sense in every situation but like you said, might come in handy at some point.
This is a great workaround. All well and good.. But what we want is a super easy way to navigate onto the samba share right from within the media browser. Same way we navigate to a upnp share.. For the life of me I can't understand why this isn't built into HA already. Any idea why not?
I can't answer as to why since I don't set the roadmap. Every year they have a WTH time when you can submit suggestions without creating a PR. That just happened a couple of months ago but in the meantime, hit up HA in social media and see if they can answer. I'll also ask them.
Hi Chris, Thanks for the video! I have mounted a drive to media in a different way using fstab, however HA sees the data as local then and it tries to back it up when taking what used to be called a snapshot. My question is, when mapping it in as you have done here with smb, does HA try to back up the data or does it leave it alone. My media drive was much bigger than my HA drive, so I had no back-ups and a bit of disk full crashing going on for a while.
thanks for the explanation. at first it didn't work for me. i recieved a 111 error. it turned out that SMB version 3.0 is not enabled by default on (some) synology devices (DSM 6.2). it must be enable in file services - advanced settings : maximum SMB protocol
Is your NAS connected directly to your HA machine, or is it a network NAS? I'm a noob when it comes to networking, so I have an SSD connected to my router as a NAS that contains all of my MP3s. Getting it to run through HA is my most recent 'gotta-have'.
Hi there! Many thanks for that video! I've got one more question... how to play multiple files (or make playlists?) I just want to play for example 15 mp3's one after one from specific folder... no click each other separately after each ends... kind regards!
I get an error "There are filesystem-specific -o flags." This is when I run the command on the command line of the home assistant server. I am running a virtual machine for HASS on Synology nas 218+ . And enabled SMB What am I doing wrong
Many years of scripting and pseudo programming I can tell you that spaces, and missing commas, and missing semi-colons, and all sorts of other very hard to see things happen. I'm not surprised.
Have you made a video on how to run VLC on home assistant. I am trying to view streaming video from a raspberry pi, on HA. When I open VLC on HA it asks for input media - I am stuck on entering some thing here that is acceptable to HA.
It is the exact same as Chris showed. I just used this in CLI (for testing) and can see my shared files. (Note: I couldn't get the password= to work probably because I have an ! in the password. Also, this is an SMB share on a Linux machine that I use to connect to from my Windows machine.): mount -t cifs -o vers=3.0,noserverino,username=ubuntu,domain=WORKGROUP //10.10.10.4/12tb /media/
Thanks Chris and all. This format worked/works for me: mount_my_music: mkdir -p /media/my_music;mount -t cifs -o username=scottGarver,password=MyPassword,domain=GarSys //192.168.1.18/N/Multimedia/Music /media/my_music Notes: I am on a domain. Actual shared folder on 192.168.1.18 is "N". The "Multimedia/Music" are directories below that.
I have easily mounted my WD MyCloud and can see my NAS media files with media player. I have also Logitech Media Server Add-on in HA. I can see there mounted folder 'nasfiles' but inside is 'Empty' Any idea why LMS does not see media files like Mediaserver?
My God! It worked! The folders are displayed perfectly. I also use a Plex add-on, the goal would be to be able to browse the network drive. Plex can also see the folder, but the Plex add-on indicates it is empty and does not scan it. Do you have an idea for this? Thank you so much for the video, it helped a lot
Excellent on the getting the folders to show. I don't use the Plex add-on so I'm not sure about that. I do know that the Frigate NVR add-on has issues accessing the mounted media folder because of where it stores things on the operating system. I wonder if Plex has the same issue.
Do you know if you can recursively mount folders? IE: I have a folder called Media and within that folder there are subfolders with movies / tv shows. Mounting each individual folder, especially for TV Show seasons, would mean using hundreds of shell commands.
If I remember, I think you can. Your sub folders would need to be accessible to the user that is connecting of course. Oh, and I assume you mean media folder on the NAS side.
@@mostlychris yes. Folder on NAS side. I've struggled a bit with the mounting folders thing using shell_cmand to be honest. I was hoping it would mount nicely in either media or share folders. I can sometimes get the media browser to find it, but can't seem to get motioneye to find it to write the cctv files to the base from the HA plugin
I am using Frigate, and I can't get Frigate to write to the media folder. That is an architectural issue with the way Frigate works and is a know thing. I wonder if motioneye suffers the same thing.
Thank you so much for this post. I am trying to mount a folder on a Synology DS920+. I have entered the command: shell_command: mount_nas_folder: mkdir -p /media/nasmedia; mount -t cifs -o vers=3.0,noserverino,username=XXXX,password=XXXX,domain=WORKGROUP //192.168.1.116/Media/Movies/ /media/nasmedia/ and I am still seeing the "No Files" message on the mount. I may be wrong, but I am assuming I should see the entire folder structure under the mount point with only media files displayed. Any ideas? Thanks again for the great video!!
@@mostlychris Thanks for the suggestion, but there is a space, and I tried it both with, and without the trailing slash, and no luck. I will play with it and update if I find the solution. Thanks again!
@@mostlychris I have confirmed the issue is caused by a permission problem and have been able to resolve it. Thanks again and keep making the great videos!
Hi, thanx for the video, i try to make works with my Homeassitant and my WD my cloud First Gen, when run a shell command, and validate the configuration works good but when i see the folder in the media browser has nothing, i hope you can help me
Success! The trick for mine was to make the unraid music directory "private" and add a new user "media" for access. Once I did this everything populated. Using username=anonymous did not work
Maybe?? This video is how I access my NAS files on Home Assistant. Not the other way around. If you are running your Plex server on HA as an add-on, you might be able to play from the NAS.
My understanding is that you can use the secrets file for this (I haven't tried but I should!). I did some searching and don't see much in the way of playlists in media browser. Maybe someone else can shed some light. Being a playlist and not an actual media file is probably the issue. I don't see any other non-media files in my media browser even though they are in the directory on the NAS.
@@mostlychris I tried the secrets file, but it did not work.. What will be the way to play multiple mp3 files, if m3u does not work? Is there another way to save a playlist to select for playing?
@@peterpc There is this thread community.home-assistant.io/t/m3u-playlists-in-media-browser/243231/11. It talks about using NodeRED to do some random playing of files from the media folder, among the whole discussion on playlists. I don't have experience with the m3u files so I can't help in this case. Hopefully that thread will give you some ideas.
Without knowing more detail about what NAS you are using, this sounds like it might be a permissions issue. Make sure you have set up your NAS to allow connections from your HA device.
@@arci3r3 This still sounds like either a permissions problem or the version of SMB is not the correct one for that NAS. Try specifying a different version of the connection.
This worked a treat thanks.... I'm using my Nvidia Shield with ext HDD connected as my NAS, this now allows me to play my media and also save my camera snapshots externally to HomeAssistant saves bogging it down. Thanks
Thanks for the tutorial, still works in 2023, if anyone is struggle (like me) in finding the media location, check inside local media folder
Another well explained tutorial Chris. Initially I was seeing 'No items' in HA under Media, but going through the comments I saw that a password with special characters causes issues, so I used a different one and that did the trick! Thank you...
Excellent! I think the password thing has tripped a few configurations.
Also, is it possible to show your yml in the description? I can't see, so I can't get it from the video itself. Thanks again.
Thank you for this. How is this different from using the storage option in system? Or was that option not available when this was made? Thanks again.
Great tutorial! Everything explained well and clear. Although, I'm not convinced I like the idea of making mistake on purpose and revealing it only after the restart. Am I the only one doing changes as you go before the video reached its end? :)
Have you done a similar tutorial on mounting a USB drive into that media share Chris. I'm totally stuck.
I have a 1Tb USB drive with all my music files on it. I plugged it into the Dell 3040 that hosts my standard HA installation but have no idea how I can make that drive visible.
interesting timing, since I also have a synology nas and am trying to setup media files recently. when you do these code intensive videos, do you have the code available somewhere to copy paste? thanks for posting this!
When I have time! I shoehorn them in with the rest of all the stuff going on. Here is the code. pastebin.ubuntu.com/p/HYKFbsBts2/
@@mostlychris that's perfect! thanks!
Great article. Will try it when the cider wears off !
Haha! Good luck.
Hi, great video. What is the chell command for unmount a folder?
Thanks
Been waiting on this. Thanks
Sure thing!
Thank you! This worked well with my Netgear ReadyNAS
You're welcome!
Chris I’m new to the whole HA world but I currently own a Synology NAS DS420 and would like to either create HA in there or to use a Pi for HA hub then to link it to my NAS for storage. What is your recommendation for HA hub based on easy to use/install. I’m a noob here, sorry in advance if is a dumb question
Being new, I wouldn't start by using the NAS for HA (you'd have to create a container to run it). It adds complication to the whole setup. Depending on how much stuff you are going to be adding to your ecosystem, I would start with a Pi4 as a cheaper way to start playing and learning. I started on a pi3 years ago and am currently running my production setup on an Odroid N2+.
@@mostlychris thank you for quick response. I’ll start on a Pi4 then and try to find a way to link the pi to my Nas server for storage
Great tutorial. Very easy to follow and understand. Thank you.
Thanks for watching!
This solved everything, thanks
hello, nice tuto! i dont know why but it doesn work for me, i am under Hassos and the only way to make it works is to mount in /mnt/myfiles then make a symlink with "ln -s /mnt/myfiles /media/myfiles". any idea please? and of course in my samba share, i dont have a folder "myfiles". i expect to have a folder"my files" in my share too. thanks!
Great and immersive explanation. I'm not quite familiar with cifs, i assume it is a protocol like NFS, samba etc. My question is if it is possible to use NFS or samba with a shell command to mount the directory instead?
Edit: after further digging i found that cifs is based of or similar to smb. i will try to make it work.
You'll probably have to do the CIFS route as you discovered.
@@mostlychris Yes , thank you. I forgot to give update on this, as I found out CIFS and SAMBA are kind of the same thing and it worked no problem.
Nice video. It might come in handy for a future setup. I don't do my mounts in HA. It had not occurred to me to do it there.
Mounting using this method comes down to what you want to use it for, of course. Might not make sense in every situation but like you said, might come in handy at some point.
This is a great workaround. All well and good.. But what we want is a super easy way to navigate onto the samba share right from within the media browser. Same way we navigate to a upnp share.. For the life of me I can't understand why this isn't built into HA already. Any idea why not?
I can't answer as to why since I don't set the roadmap. Every year they have a WTH time when you can submit suggestions without creating a PR. That just happened a couple of months ago but in the meantime, hit up HA in social media and see if they can answer. I'll also ask them.
Hi Chris, Thanks for the video!
I have mounted a drive to media in a different way using fstab, however HA sees the data as local then and it tries to back it up when taking what used to be called a snapshot.
My question is, when mapping it in as you have done here with smb, does HA try to back up the data or does it leave it alone.
My media drive was much bigger than my HA drive, so I had no back-ups and a bit of disk full crashing going on for a while.
What are you using for backups? I have excluded my media folder from backups so I don't inadvertently backup my NAS or in my case Frigate NVR stuff.
thanks for the explanation. at first it didn't work for me. i recieved a 111 error. it turned out that SMB version 3.0 is not enabled by default on (some) synology devices (DSM 6.2). it must be enable in file services - advanced settings : maximum SMB protocol
Good find! Thanks for the tip! It'll help others who have this problem.
@@mostlychris I keep getting the same 111 error but I'm on DSM 7.1 and the maximum SMB was already set to 3.0
@@CommittotheIndian Same here :-( @mostlychris
Thank you so much for this video. With some tweaking of the shell command I've got my OMV NAS mounted too. ;-)
Excellent!
Would you like to share your shell command?
@@milliethemini6369 I've tried, but RUclips immediately deletes my comment...
@@BebeMischa Put it in my discord server. That won't delete it.
@@mostlychris On which channel you wan't to have it? Sorry, Discord is still an unorganised madness for me :-D
Is your NAS connected directly to your HA machine, or is it a network NAS? I'm a noob when it comes to networking, so I have an SSD connected to my router as a NAS that contains all of my MP3s. Getting it to run through HA is my most recent 'gotta-have'.
My NAS is network connected. It is not in the same room as the HA box.
Hi there!
Many thanks for that video! I've got one more question... how to play multiple files (or make playlists?) I just want to play for example 15 mp3's one after one from specific folder... no click each other separately after each ends...
kind regards!
From what I've read, that isn't currently possible. I haven't found any way to do that. Hopefully that will change.
Can you write here your command? Still works?
Finally, someone posted it
Was there a wait for this one?
@@mostlychris in last stream a few people asked about it
@@yousaf.saleem Ahh ok. Yeah I remember that.
I get an error "There are filesystem-specific -o flags." This is when I run the command on the command line of the home assistant server. I am running a virtual machine for HASS on Synology nas 218+ . And enabled SMB
What am I doing wrong
I deleted the spaces before mount -t… and after my password.
I am suprised that this was the cause of the error.
Many years of scripting and pseudo programming I can tell you that spaces, and missing commas, and missing semi-colons, and all sorts of other very hard to see things happen. I'm not surprised.
Have you made a video on how to run VLC on home assistant. I am trying to view streaming video from a raspberry pi, on HA. When I open VLC on HA it asks for input media - I am stuck on entering some thing here that is acceptable to HA.
I have not tried this. Media player doesn't work for you?
Perfect timing. Any quick advice as to what the shell_command should be to connect to a Windows smb share?
Maybe something like this? Very similar to the command in the video.
mount -t cifs -o username= //WIN_SHARE_IP/ /mnt/win_share
It is the exact same as Chris showed. I just used this in CLI (for testing) and can see my shared files. (Note: I couldn't get the password= to work probably because I have an ! in the password. Also, this is an SMB share on a Linux machine that I use to connect to from my Windows machine.):
mount -t cifs -o vers=3.0,noserverino,username=ubuntu,domain=WORKGROUP //10.10.10.4/12tb /media/
Thanks for the info Derek. Figured it would be very close if not exact.
@@mostlychris could you give an example of mounting a windows share? I have tried many different ways and I am not getting anywhere
Thanks Chris and all. This format worked/works for me: mount_my_music: mkdir -p /media/my_music;mount -t cifs -o username=scottGarver,password=MyPassword,domain=GarSys //192.168.1.18/N/Multimedia/Music /media/my_music
Notes: I am on a domain. Actual shared folder on 192.168.1.18 is "N". The "Multimedia/Music" are directories below that.
I have easily mounted my WD MyCloud and can see my NAS media files with media player.
I have also Logitech Media Server Add-on in HA. I can see there mounted folder 'nasfiles' but inside is 'Empty'
Any idea why LMS does not see media files like Mediaserver?
I am not sure as I've not used LMS before. Maybe someone else has an idea. Anyone?
My God! It worked! The folders are displayed perfectly.
I also use a Plex add-on, the goal would be to be able to browse the network drive.
Plex can also see the folder, but the Plex add-on indicates it is empty and does not scan it. Do you have an idea for this?
Thank you so much for the video, it helped a lot
Excellent on the getting the folders to show. I don't use the Plex add-on so I'm not sure about that. I do know that the Frigate NVR add-on has issues accessing the mounted media folder because of where it stores things on the operating system. I wonder if Plex has the same issue.
@@mostlychris Any fix for add-ons not showing the contents of the mounted folder?
I have problem
Error running command: `mkdir -p /media/nasfiles;mount -t cifs -o username=homeassistant,password=\pk;KH,domain=WORKGROUP //synology/MEDIA_HA /media/nasfiles`, return code: 127
What's wrong ?
If '\pk;KH' is your real password try a password without special characters
Just what I need! Although I will be trying to tap into Unraid - I've no idea what sort of connection I would need haha!
I don't have that to play with so it'll be interesting to see how it works for you.
Do you know if you can recursively mount folders? IE: I have a folder called Media and within that folder there are subfolders with movies / tv shows.
Mounting each individual folder, especially for TV Show seasons, would mean using hundreds of shell commands.
If I remember, I think you can. Your sub folders would need to be accessible to the user that is connecting of course. Oh, and I assume you mean media folder on the NAS side.
@@mostlychris yes. Folder on NAS side. I've struggled a bit with the mounting folders thing using shell_cmand to be honest. I was hoping it would mount nicely in either media or share folders. I can sometimes get the media browser to find it, but can't seem to get motioneye to find it to write the cctv files to the base from the HA plugin
I am using Frigate, and I can't get Frigate to write to the media folder. That is an architectural issue with the way Frigate works and is a know thing. I wonder if motioneye suffers the same thing.
@@mostlychris could be. It definitely limits the way the motioneye add on works in HA. I'll have too keep playing with it.
🙂
Keep us posted.
Why do I need the automation if the command is in the configuration.yaml ?
Not sure what you mean.
Thank you so much for this post. I am trying to mount a folder on a Synology DS920+. I have entered the command:
shell_command:
mount_nas_folder: mkdir -p /media/nasmedia; mount -t cifs -o vers=3.0,noserverino,username=XXXX,password=XXXX,domain=WORKGROUP //192.168.1.116/Media/Movies/ /media/nasmedia/
and I am still seeing the "No Files" message on the mount. I may be wrong, but I am assuming I should see the entire folder structure under the mount point with only media files displayed. Any ideas?
Thanks again for the great video!!
It's hard to tell in your comment, but is there a space after /Media/Movies/ and /media/nasmedia? If so, try removing the trailing slash after Movies.
@@mostlychris Thanks for the suggestion, but there is a space, and I tried it both with, and without the trailing slash, and no luck. I will play with it and update if I find the solution. Thanks again!
Could be a permissions issue on the NAS side not allowing that directory to show anything for your connected user.
@@mostlychris I have confirmed the issue is caused by a permission problem and have been able to resolve it. Thanks again and keep making the great videos!
Outstanding! Good job.
Hi, thanx for the video, i try to make works with my Homeassitant and my WD my cloud First Gen, when run a shell command, and validate the configuration works good but when i see the folder in the media browser has nothing, i hope you can help me
I've seen a couple of people having issues with the WD cloud stuff. It might be beset to jump over to Discord and have a discussion there.
Hey Marco! Havec you got a solution? Thanks a lot!
Any luck including a Unraid Server for media files?
Success! The trick for mine was to make the unraid music directory "private" and add a new user "media" for access. Once I did this everything populated. Using username=anonymous did not work
Outstanding! Good tip for anyone else running this type of setup.
Hi does this mean you can link your media to plex?
Maybe?? This video is how I access my NAS files on Home Assistant. Not the other way around. If you are running your Plex server on HA as an add-on, you might be able to play from the NAS.
Does anyone have this working with a Buffalo TeraStation?
Can I use !secret for user name and password?
I also want to play m3u files, but they don't seem to work?
My understanding is that you can use the secrets file for this (I haven't tried but I should!). I did some searching and don't see much in the way of playlists in media browser. Maybe someone else can shed some light. Being a playlist and not an actual media file is probably the issue. I don't see any other non-media files in my media browser even though they are in the directory on the NAS.
@@mostlychris I tried the secrets file, but it did not work..
What will be the way to play multiple mp3 files, if m3u does not work? Is there another way to save a playlist to select for playing?
@@peterpc There is this thread community.home-assistant.io/t/m3u-playlists-in-media-browser/243231/11. It talks about using NodeRED to do some random playing of files from the media folder, among the whole discussion on playlists. I don't have experience with the m3u files so I can't help in this case. Hopefully that thread will give you some ideas.
Nice video. But I have an error. when HA tries to mount the NAS it return an error: "return code 255". Can you help me? thanks
Without knowing more detail about what NAS you are using, this sounds like it might be a permissions issue. Make sure you have set up your NAS to allow connections from your HA device.
Same problem, did you found solution? HA should access to NAS user have every permission to the folder.
@@FarkasAttilasd123 Nope, and i have all permission to the folder with that user
@@mostlychris i'm using open media vault, and use in HA an user that have all permission to the folder
@@arci3r3 This still sounds like either a permissions problem or the version of SMB is not the correct one for that NAS. Try specifying a different version of the connection.
Thank You
You're welcome
I don't understand the point of doing this....
No worries. Everyone has specific use cases for technology.
this Video starts at 3:40
Not sure what that means.