Hey everyone, I feel like I’m really close, I just need a little help getting over the finish line. I am running Home Assistant OS on a Raspberry Pi 4 and trying to mount my Synology Diskstation’s music folder.
Here are the steps I took so far:
- Setup
configuration.yaml
like below. Trusted network IP is that of the Synology Diskstation. media_dirs
is commented out right now because it doesn’t exist yet. If you do not comment out the media_dirs
the code will not validate. Replace myusername and mypassword with your own credentials. Domain is set to WORKGROUP by default in Synology > Control Panel > File Services, screenshot below shows where the settings are.
homeassistant:
# media_dirs:
# music: /mnt/media2
auth_providers:
- type: trusted_networks
trusted_networks:
- 192.168.1.26
shell_command:
mount_synology_nas: "mkdir -p /mnt/media2;mount -t cifs -o username=myusername,password=mypassword,domain=WORKGROUP //192.168.1.26/music /mnt/media2"
-
Do a full system reboot of the Raspberry Pi, not just the OS. After Home Assistant came back up I went to Developer Tools > Services and called the service Shell Command: mount_synology_nas. I clicked the button a couple of times, there doesn’t seem to be any indicator of anything happening. I went into Home Assistant’s Terminal within the left side navigation and typed ls
, but did not see the media2 directory like I had expected.
-
Now I uncomment the media_dirs
lines within configuration.yaml
. It now looks like this & validates!
homeassistant:
media_dirs:
music: /mnt/media2
auth_providers:
- type: trusted_networks
trusted_networks:
- 192.168.1.26
shell_command:
mount_synology_nas: "mkdir -p /mnt/media2;mount -t cifs -o username=myusername,password=mypassword,domain=WORKGROUP //192.168.1.26/music /mnt/media2"
- Restart the OS, I did not do a full reboot of the Pi this time. Upon starting back up, I can see media2 is the default folder, but nothing is appearing.
Within Home Assistant OS I checked Supervisor > System > Core logs and saw this:
ERROR (MainThread) [homeassistant.components.shell_command] Error running command: `mkdir -p /mnt/media2;mount -t cifs -o username=myusername,password=mypassword,domain=WORKGROUP //192.168.1.26/music /mnt/media2`, return code: 111
NoneType: None
Does anyone know what error code 111 means? I believe I’ve created the media2 directory but the Synology is failing to mount, so that’s why media2 appears empty. If I can figure this out I plan on doing a YouTube video tutorial to help everyone else out.
UPDATE 1: I found a post about error code 111 and tried adding -o sec=ntlmv2
to my shell command. So now the shell command looks like:
shell_command:
mount_synology_nas: "mkdir -p /mnt/media2;mount -t cifs -o sec=ntlmv2 username=myusername,password=mypassword,domain=WORKGROUP //192.168.1.26/music /mnt/media2"
Restarted Home Assistant OS, called the service, checked the core logs, and now I’ve got another error message:
2021-03-07 13:32:17 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: `mkdir -p /mnt/media2;mount -t cifs -o sec=ntlmv2 username=myusername,password=mypassword,domain=WORKGROUP //192.168.1.26/music /mnt/media2`, return code: 1
NoneType: None
Still unsure how to solve this.
UPDATE 2: I had to reboot the Pi after other unrelated changes I made, and Home Assistant booted into safety mode because when rebooting the media2 folder that I had created no longer existed and the configuration.yaml
was referencing that folder. I used the built in file editor, commented out those lines, and started back up safely. I now see the need for using portainer to create the directory. I used these instructions on setting up my new folders. After rebooting the Raspberry Pi, these folders are still not appearing. Any suggestions as to what I am missing?