hi, i’m sorry, i’ve been trying for hours and nothing i find online is working for me - please help?
i’m running HA container and want to play music stored on the same intelNUC as docker/HA.
i want to be able to stream the music from any networked device - i’m assuming this is possible?
for the avoidance of doubt i can ftp to srv/music
i’m not exactly clear how this is supposed to work, i think (please correct me!):
in docker-compose.yaml i map a real location to the HA container
in HA configuration.yaml i declare media_dirs
done.
or maybe i need to add a whitelist for external dir, so i did that too but still no media or new folders in media browser…
i’ve tried a load of ways, but the most recent attempt looked like this:
HA configuration.yaml:
default_config:
whitelist_external_dirs:
/srv/music
media_dirs:
media/music: srv/music
These physical to docker virtual to home assistant mappings require a good dose of and/or . So I use docker run not docker compose, so a bit different syntax there.
Be careful of you use or lack of use of ‘slashes’ in your directory specification, this is significant and you seem to be combining directories that start with a slash and directory references that do NOT start with a slash…
On this Ubuntu box, I have physical directory /media where a mount all the ‘shares’ that I want exposed. Then in Docker, I give the container a map to this physical directory to a identical virtual directory in the container named and located the same /media
So the Docker container has a /media directory as well as a /config directory that are mapped to physical /media and physical /home/user/homeassistant
so if I shell into my HA Docker container via Portainer (you can do similar with Docker commands without Portainer) and move to the ‘root’ directory that the container sees. There are the two physical directories exposes as the Docker virtual counterparts and described above, see picture:
Now in HA, you use the virtual directory paths in configuration.yaml
So in the whitelist section, I give access to the ‘root’ of the container, I think the ‘/tmp’ might be unneeded.
Then under this ‘root’ create these nice alias names for the ‘Media Sources’ part of Home Assistant.
I hope I got this correct, and hope it is not too foggy. Good hunting!
I just got into bed (and used my new aqara button to switch my lights ) but I’ll check it out tomorrow…
BTW I notice your media_dirs is nested under network, I haven’t seen that before - is it how it has to be, or are you doing it differently for some reason?
I do not use my music archive any more and I am addicted to streaming audio services. However, yes my video library and home security camera video archives are stored on a Synology NAS and old Linux base RAID device. The machine that hosts the Home Assistant Docker container, does not have any of these files local, yes they are network mounts in the /media local directory. When I bring down the Home Assistant system for maintenance, yes there is a set of steps, some automated, some not that I go thru before starting HA. The check that the network volumes are mounted is one of these.
Hope I helped and did not confuse, good luck. So far the media stuff has worked well for me in HA. As I said once I got a basic understanding of the three parts: physical local, Docker virtual and Home Assistant .yaml mapping of locations, things were good.