Play media files from your NAS using Home Assistant

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 135

  • @wighty9244
    @wighty9244 Год назад

    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

  • @andreescocard
    @andreescocard Год назад

    Thanks for the tutorial, still works in 2023, if anyone is struggle (like me) in finding the media location, check inside local media folder

  • @thierry3610
    @thierry3610 2 года назад

    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...

    • @mostlychris
      @mostlychris  2 года назад

      Excellent! I think the password thing has tripped a few configurations.

  • @SuperUtterChaos
    @SuperUtterChaos 6 месяцев назад

    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.

  • @SuperUtterChaos
    @SuperUtterChaos 6 месяцев назад

    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.

  • @robertroszak4955
    @robertroszak4955 Год назад

    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? :)

  • @ansomeBob
    @ansomeBob Год назад

    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.

  • @DesertGardenPrepper
    @DesertGardenPrepper 3 года назад +1

    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!

    • @mostlychris
      @mostlychris  3 года назад +1

      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/

    • @DesertGardenPrepper
      @DesertGardenPrepper 3 года назад +1

      @@mostlychris that's perfect! thanks!

  • @davebareham1075
    @davebareham1075 3 года назад

    Great article. Will try it when the cider wears off !

  • @AlbiOnTube
    @AlbiOnTube Год назад

    Hi, great video. What is the chell command for unmount a folder?
    Thanks

  • @Kev7274
    @Kev7274 3 года назад

    Been waiting on this. Thanks

  • @mattbrumelow9303
    @mattbrumelow9303 2 года назад

    Thank you! This worked well with my Netgear ReadyNAS

  • @Jaime_diaz
    @Jaime_diaz 3 года назад +1

    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

    • @mostlychris
      @mostlychris  3 года назад +1

      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+.

    • @Jaime_diaz
      @Jaime_diaz 3 года назад +2

      @@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

  • @GregGranito
    @GregGranito Год назад

    Great tutorial. Very easy to follow and understand. Thank you.

  • @matfen7978
    @matfen7978 8 месяцев назад

    This solved everything, thanks

  • @POPOL2999
    @POPOL2999 Год назад

    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!

  • @Coldphoenix44
    @Coldphoenix44 Год назад

    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.

    • @mostlychris
      @mostlychris  Год назад +1

      You'll probably have to do the CIFS route as you discovered.

    • @Coldphoenix44
      @Coldphoenix44 Год назад

      @@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.

  • @jmr
    @jmr 3 года назад

    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.

    • @mostlychris
      @mostlychris  3 года назад +1

      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.

  • @wapphigh5250
    @wapphigh5250 Год назад

    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?

    • @mostlychris
      @mostlychris  Год назад

      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.

  • @sirgoodenough65
    @sirgoodenough65 2 года назад

    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.

    • @mostlychris
      @mostlychris  2 года назад

      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.

  • @ivo-g
    @ivo-g 3 года назад +2

    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

    • @mostlychris
      @mostlychris  3 года назад

      Good find! Thanks for the tip! It'll help others who have this problem.

    • @CommittotheIndian
      @CommittotheIndian 2 года назад +1

      @@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

    • @constantdevries7100
      @constantdevries7100 2 года назад

      @@CommittotheIndian Same here :-( @mostlychris

  • @BebeMischa
    @BebeMischa 3 года назад +1

    Thank you so much for this video. With some tweaking of the shell command I've got my OMV NAS mounted too. ;-)

    • @mostlychris
      @mostlychris  3 года назад +1

      Excellent!

    • @milliethemini6369
      @milliethemini6369 2 года назад

      Would you like to share your shell command?

    • @BebeMischa
      @BebeMischa 2 года назад

      @@milliethemini6369 I've tried, but RUclips immediately deletes my comment...

    • @mostlychris
      @mostlychris  2 года назад +1

      @@BebeMischa Put it in my discord server. That won't delete it.

    • @BebeMischa
      @BebeMischa 2 года назад

      @@mostlychris On which channel you wan't to have it? Sorry, Discord is still an unorganised madness for me :-D

  • @TedZ58
    @TedZ58 3 года назад

    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'.

    • @mostlychris
      @mostlychris  3 года назад

      My NAS is network connected. It is not in the same room as the HA box.

  • @radeklorenc9713
    @radeklorenc9713 3 года назад

    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!

    • @mostlychris
      @mostlychris  3 года назад

      From what I've read, that isn't currently possible. I haven't found any way to do that. Hopefully that will change.

  • @fabion9744
    @fabion9744 Год назад

    Can you write here your command? Still works?

  • @yousaf.saleem
    @yousaf.saleem 3 года назад

    Finally, someone posted it

    • @mostlychris
      @mostlychris  3 года назад

      Was there a wait for this one?

    • @yousaf.saleem
      @yousaf.saleem 3 года назад

      @@mostlychris in last stream a few people asked about it

    • @mostlychris
      @mostlychris  3 года назад

      @@yousaf.saleem Ahh ok. Yeah I remember that.

  • @jeekasutube2918
    @jeekasutube2918 Год назад

    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

    • @jeekasutube2918
      @jeekasutube2918 Год назад

      I deleted the spaces before mount -t… and after my password.
      I am suprised that this was the cause of the error.

    • @mostlychris
      @mostlychris  Год назад

      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.

  • @neilausten9404
    @neilausten9404 2 года назад

    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.

    • @mostlychris
      @mostlychris  2 года назад

      I have not tried this. Media player doesn't work for you?

  • @scottgarver
    @scottgarver 3 года назад

    Perfect timing. Any quick advice as to what the shell_command should be to connect to a Windows smb share?

    • @mostlychris
      @mostlychris  3 года назад

      Maybe something like this? Very similar to the command in the video.
      mount -t cifs -o username= //WIN_SHARE_IP/ /mnt/win_share

    • @d_sellers1
      @d_sellers1 3 года назад

      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/

    • @mostlychris
      @mostlychris  3 года назад +1

      Thanks for the info Derek. Figured it would be very close if not exact.

    • @paulv9286
      @paulv9286 3 года назад

      @@mostlychris could you give an example of mounting a windows share? I have tried many different ways and I am not getting anywhere

    • @scottgarver
      @scottgarver 3 года назад +1

      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.

  • @antsratsep398
    @antsratsep398 2 года назад

    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?

    • @mostlychris
      @mostlychris  2 года назад

      I am not sure as I've not used LMS before. Maybe someone else has an idea. Anyone?

  • @TheStevePappa
    @TheStevePappa 2 года назад

    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

    • @mostlychris
      @mostlychris  2 года назад

      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.

    • @HtikeAungKyaw
      @HtikeAungKyaw 2 года назад

      @@mostlychris Any fix for add-ons not showing the contents of the mounted folder?

  • @MrAdi1308
    @MrAdi1308 2 года назад

    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 ?

    • @janboerenjr
      @janboerenjr Год назад

      If '\pk;KH' is your real password try a password without special characters

  • @Roedy_Coedy
    @Roedy_Coedy 3 года назад

    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!

    • @mostlychris
      @mostlychris  3 года назад +1

      I don't have that to play with so it'll be interesting to see how it works for you.

  • @EsotericArctos
    @EsotericArctos 3 года назад

    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.

    • @mostlychris
      @mostlychris  3 года назад +1

      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.

    • @EsotericArctos
      @EsotericArctos 3 года назад +1

      @@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

    • @mostlychris
      @mostlychris  3 года назад

      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.

    • @EsotericArctos
      @EsotericArctos 3 года назад

      @@mostlychris could be. It definitely limits the way the motioneye add on works in HA. I'll have too keep playing with it.
      🙂

    • @mostlychris
      @mostlychris  3 года назад

      Keep us posted.

  • @sethreeder4264
    @sethreeder4264 2 года назад

    Why do I need the automation if the command is in the configuration.yaml ?

  • @gotelldonn
    @gotelldonn 3 года назад

    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
      @mostlychris  3 года назад

      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.

    • @gotelldonn
      @gotelldonn 3 года назад

      @@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
      @mostlychris  3 года назад

      Could be a permissions issue on the NAS side not allowing that directory to show anything for your connected user.

    • @gotelldonn
      @gotelldonn 3 года назад

      @@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!

    • @mostlychris
      @mostlychris  3 года назад

      Outstanding! Good job.

  • @macosiro
    @macosiro 3 года назад

    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

    • @mostlychris
      @mostlychris  2 года назад

      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.

    • @fournieremile8876
      @fournieremile8876 2 года назад

      Hey Marco! Havec you got a solution? Thanks a lot!

  • @Ghcotti71
    @Ghcotti71 3 года назад

    Any luck including a Unraid Server for media files?

    • @Ghcotti71
      @Ghcotti71 3 года назад

      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

    • @mostlychris
      @mostlychris  3 года назад

      Outstanding! Good tip for anyone else running this type of setup.

  • @mattjdlewis
    @mattjdlewis 3 года назад

    Hi does this mean you can link your media to plex?

    • @mostlychris
      @mostlychris  3 года назад

      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.

  • @dhebard1
    @dhebard1 Год назад

    Does anyone have this working with a Buffalo TeraStation?

  • @peterpc
    @peterpc 3 года назад

    Can I use !secret for user name and password?
    I also want to play m3u files, but they don't seem to work?

    • @mostlychris
      @mostlychris  3 года назад

      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.

    • @peterpc
      @peterpc 3 года назад

      @@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?

    • @mostlychris
      @mostlychris  3 года назад

      @@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.

  • @arci3r3
    @arci3r3 3 года назад

    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

    • @mostlychris
      @mostlychris  3 года назад

      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.

    • @FarkasAttilasd123
      @FarkasAttilasd123 3 года назад

      Same problem, did you found solution? HA should access to NAS user have every permission to the folder.

    • @arci3r3
      @arci3r3 3 года назад

      @@FarkasAttilasd123 Nope, and i have all permission to the folder with that user

    • @arci3r3
      @arci3r3 3 года назад

      @@mostlychris i'm using open media vault, and use in HA an user that have all permission to the folder

    • @mostlychris
      @mostlychris  3 года назад

      @@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.

  • @eldmaster
    @eldmaster 2 года назад

    Thank You

  • @MattTube
    @MattTube 2 года назад

    I don't understand the point of doing this....

    • @mostlychris
      @mostlychris  2 года назад +1

      No worries. Everyone has specific use cases for technology.

  • @cassio2999
    @cassio2999 2 года назад

    this Video starts at 3:40