I’m trying to create an Add-on that has access to the files in /media. (I have a usb hard drive mounted as /media/usb-sda1). I’m running Home Assistant OS on a raspberry pi 4.
From the docs, it looks like this can be done using “map” in config.json. See Add-On Configuration | Home Assistant Developer Docs
This doesn’t work for me. The docker container appears to have a /media folder available, but it contains subdirectories cdrom, floppy, usb.
Minimal working example to show the issue:
config.json
{
"name": "Test share media",
"version": "0.1",
"slug": "testapp",
"description": "Add-on that lists contents of /media to the log and exits",
"startup": "once",
"boot": "manual",
"options": {},
"schema": {},
"arch": ["amd64", "armv7", "armhf", "i386" , "aarch64"],
"map": ["media"],
}
Dockerfile
ARG BUILD_FROM=homeassistant/amd64-base:latest
FROM $BUILD_FROM
ENV LANG C.UTF-8
WORKDIR /
ENTRYPOINT ["ls","/media"]
LABEL io.hass.version="VERSION" io.hass.type="addon" io.hass.arch="armhf|aarch64|i386|amd64"
The log shows cdrom floppy usb
However if I ssh into homeassistant and run ls /media
it returns usb-sda1 usb-sda2
Does anyone know how I can access usb-sda1
from inside my Add-on?
Thanks!