Downloader configuration issue

Hi,

I have a running instance of Kuna lights that is working & wanted to test the functionality if video stream can be downloaded when motion is detected. So getting mixed results as follows:

downloader:
  download_dir: videos

==> the videos are downloaded in this folder but I would like to download video clips using an absolute path that is outside the folder structure of HA installation. I am running HA supervised on a Debian machine where HA is installed at /usr/share/hassio/homeassistant

So I tried two options:

downloader:
  #download_dir: videos
  download_dir: /root/a

==> got the error even though the path seems absolute and folder /root/a exists with root privileges (same as the HA folders)
droot

Tried a relative path to /usr/share/hassio/homeassitant directory

downloader:
  #download_dir: videos
  download_dir: ../a

==> this time got a different error even though folder /usr/share/hassio/a exist with same privileges as HA folders
da

Can someone post a good example of using absolute path for downloader or point me to the error in above two examples?

Thanks!

Does your HA run under the root user?
Did you try with, e.g., “/tmp” to rule out permission issues?

@koying thanks for the suggestion. I am not sure if it is running as root, I just checked the folder permission in supervised install and guessing.

So after I changed the configuration to:

downloader:
  #download_dir: videos
  download_dir: /tmp

There is no error so seems like the permission issues are eliminated but no recordings shows up even after two days, where as if I switch back to “download_dir: videos” then the files starts appearing literally within few seconds.

Just to be sure we’re on the same page, you don’t see anything in /tmp in your docker container, right?

Any path specified here will be from docker container perspective.
If you’d want the videos stored somewhere else than in the HA directory, you’d have to “map” that directory from the Host to the HA docker container…

1 Like

So I logged into console of docker container but did not look like there are any files in /tmp

root@athena:~# docker container exec -it 00f924061ad9 /bin/bash
bash-5.0# pwd
/config
bash-5.0# ls
0-Archives                deps                      known_devices.yaml
appdaemon                 groups.yaml               scenes.yaml
automations               home-assistant.log        scripts.yaml
automations.yaml          home-assistant_v2.db      secrets.yaml
blueprints                home-assistant_v2.db-shm  themes.yaml
configuration.yaml        home-assistant_v2.db-wal  tts
custom_components         image                     videos
customizations            integrations
bash-5.0# cd /tmp/
bash-5.0# ls

.....nothing listed....

Could I be looking in the wrong container? Here is a list of complete containers.


root@athena:~# docker container ls -a
CONTAINER ID   IMAGE                                                      COMMAND                  CREATED        STATUS                    PORTS                                                                                                                          NAMES
00f924061ad9   ghcr.io/home-assistant/qemux86-64-homeassistant:2021.6.5   "/init"                  2 hours ago    Up 2 hours                                                                                                                                               homeassistant
2d13eceec3a1   homeassistant/amd64-hassio-supervisor                      "/init"                  40 hours ago   Up 40 hours                                                                                                                                              hassio_supervisor
adab5726c076   ghcr.io/home-assistant/amd64-hassio-observer:2021.06.0     "/init"                  2 days ago     Up 2 days                 0.0.0.0:4357->80/tcp, :::4357->80/tcp                                                                                          hassio_observer
b077b77de50d   ghcr.io/home-assistant/amd64-hassio-dns:2021.06.0          "/init"                  2 days ago     Up 2 days                                                                                                                                                hassio_dns
ff743dda24db   ghcr.io/hassio-addons/appdaemon/amd64:0.6.2                "/init"                  4 days ago     Up 4 days                 0.0.0.0:5050->5050/tcp, :::5050->5050/tcp                                                                                      addon_a0d7b954_appdaemon
bae9f47d46c2   ghcr.io/hassio-addons/tasmoadmin/amd64:0.15.0              "/init"                  7 days ago     Up 7 days                 0.0.0.0:9541->9541/tcp, :::9541->9541/tcp                                                                                      addon_a0d7b954_sonweb
42aa948db61c   danmed/tasmobackupv1:1.04.13                               "/usr/local/bin/dock…"   12 days ago    Up 12 days (healthy)      80/tcp                                                                                                                         addon_9409ee68_tasmobackup
926281a38dd4   ghcr.io/sebclem/hassio-nextcloud-backup/amd64:0.16.1       "/init"                  12 days ago    Up 12 days                                                                                                                                               addon_229cc4d7_nextcloud_backup
427af5e221ee   homeassistant/amd64-addon-ssh:9.1.3                        "/init"                  12 days ago    Up 12 days                                                                                                                                               addon_core_ssh
9835eaa62c86   ghcr.io/hassio-addons/vscode/amd64:3.4.1                   "/init"                  12 days ago    Up 12 days                                                                                                                                               addon_a0d7b954_vscode
18416ebf14f9   homeassistant/amd64-addon-mosquitto:6.0.1                  "/init"                  12 days ago    Up 12 days                0.0.0.0:1883-1884->1883-1884/tcp, :::1883-1884->1883-1884/tcp, 0.0.0.0:8883-8884->8883-8884/tcp, :::8883-8884->8883-8884/tcp   addon_core_mosquitto
6cc3a46e142a   homeassistant/amd64-hassio-multicast:2021.04.0             "/init"                  12 days ago    Up 12 days                                                                                                                                               hassio_multicast
1819bd71b5a7   homeassistant/amd64-hassio-cli:2021.05.1                   "/init /bin/bash -c …"   12 days ago    Up 12 days                                                                                                                                               hassio_cli
1a0fe16c9946   homeassistant/amd64-hassio-audio:2021.04.0                 "/init"                  12 days ago    Up 12 days                                                                                                                                               hassio_audio
d1d8e49d5adf   homeassistant/amd64-addon-check_config:3.6.0               "/init"                  2 months ago   Exited (0) 2 months ago                                                                                                                                  addon_core_check_config
89e3297de80a   hello-world                                                "/hello"                 2 months ago   Exited (0) 2 months ago                                                                                                                                  flamboyant_mirzakhani
c45864d62534   hello-world                                                "/hello"                 2 months ago   Exited (0) 2 months ago                                                                                                                                  vigorous_kirch

It’s been a long time since the OP, but I recently had the same problem (HA Supervised on Debian 11). I wanted to use a Samba share (mounted to a local folder using cifs) with the Downloader integration.

Folder structure:

ls /usr/share/hassio/ -lh --group-directories-first
total 108K
drwxr-xr-x  6 root       root 4.0K Feb 15 21:32 addons
drwxr-xr-x  3 root       root 4.0K Feb 15 21:30 apparmor
drwxr-xr-x  4 root       root 4.0K Feb 15 21:31 audio
drwxr-xr-x  2 root       root 4.0K Feb 27 12:12 backup
drwxr-xr-x  2 root       root 4.0K Feb 27 12:15 dns
drwxr-xr-x 10 root       root 4.0K Feb 27 13:26 homeassistant
drwxr-xr-x  2 root       root 4.0K Feb 15 21:30 media
drwxr-xr-x  7 root       root 4.0K Feb 27 11:46 share
drwxr-xr-x  2 root       root 4.0K Feb 16 22:11 ssl
drwxr-xr-x  3 root       root 4.0K Feb 27 11:17 tmp

The root path of HA seems to be “/usr/share/hassio/”, so I placed the mounted folder inside the share directory. Apparently using something like “…/share/nas_downloads” or “…/share/nas_downloads” for a folder located just outside the config folder does not work.

This was the final config that worked:

#Donwloader config
downloader:
  download_dir: /share/nas_downloads

You can use this configuration with a folder mounted to any directory you want in the host file system.