What is Home Assistant Supervised?
Home Assistant is a full UI managed home automation ecosystem that runs Home Assistant Core, the Home Assistant Supervisor and add-ons. It comes pre-installed on Home Assistant OS, but can be installed on any Linux system. It leverages Docker, which is managed by the Home Assistant Supervisor plus the added benefit of dozens of add-ons (think app store) that work natively inside the Home Assistant environment.
- Discussion thread
There are a few ways to install Home Assistant. The following has is an adaptation of installing on a debian os, which in turn is an adaptation of the nowdays not supported installer. However, installing homeassistant like this works, it runs and so forth. Alas, I have not been able to get any headway of usb access etc, but one step at the time.
There might be more users out there who wish to utilize their CoreELEC box a bit more and Supervised Home Assistans might be one.
I have adapted this dockerscript into this:
#!/usr/bin/env bash
set -e
function error { echo -e "[Error] $*"; exit 1; }
function warn { echo -e "[Warning] $*"; }
ARCH=$(uname -m)
DOCKER_BINARY=/usr/bin/docker
DOCKER_REPO=homeassistant
DOCKER_SERVICE=docker.service
URL_VERSION="https://version.home-assistant.io/stable.json"
URL_HA="https://raw.githubusercontent.com/home-assistant/supervised-installer/master/files/ha"
URL_BIN_HASSIO="https://raw.githubusercontent.com/home-assistant/supervised-installer/master/files/hassio-supervisor"
URL_BIN_APPARMOR="https://raw.githubusercontent.com/home-assistant/supervised-installer/master/files/hassio-apparmor"
URL_SERVICE_HASSIO="https://raw.githubusercontent.com/home-assistant/supervised-installer/master/files/hassio-supervisor.service"
URL_SERVICE_APPARMOR="https://raw.githubusercontent.com/home-assistant/supervised-installer/master/files/hassio-apparmor.service"
URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt"
# Check env
command -v systemctl > /dev/null 2>&1 || error "Only systemd is supported!"
command -v docker > /dev/null 2>&1 || error "Please install docker first"
command -v jq > /dev/null 2>&1 || error "Please install jq first"
command -v curl > /dev/null 2>&1 || error "Please install curl first"
command -v avahi-daemon > /dev/null 2>&1 || error "Please install avahi first"
command -v dbus-daemon > /dev/null 2>&1 || error "Please install dbus first"
#command -v nmcli > /dev/null 2>&1 || warn "No NetworkManager support on host."
#command -v apparmor_parser > /dev/null 2>&1 || warn "No AppArmor support on host."
# Check if Modem Manager is enabled
if systemctl list-unit-files ModemManager.service | grep enabled; then
warn "ModemManager service is enabled. This might cause issue when using serial devices."
fi
# Detect if running on snapped docker
#if snap list docker >/dev/null 2>&1; then
# DOCKER_BINARY=/snap/bin/docker
# DATA_SHARE=/storage/docker/hassio/
# CONFIG=$DATA_SHARE/hassio.json
# DOCKER_SERVICE="snap.docker.dockerd.service"
#fi
# Parse command line parameters
while [[ $# -gt 0 ]]; do
arg="$1"
case $arg in
-m|--machine)
MACHINE=$2
shift
;;
-d|--data-share)
DATA_SHARE=$2
shift
;;
-p|--prefix)
PREFIX=$2
shift
;;
-s|--sysconfdir)
SYSCONFDIR=$2
shift
;;
*)
error "Unrecognized option $1"
;;
esac
shift
done
PREFIX=${PREFIX:-/storage/hassio}
SYSCONFDIR=${SYSCONFDIR:-/storage/hassio/etc}
DATA_SHARE=${DATA_SHARE:-$PREFIX/share/hassio}
SBIN=${SBIN:-$PREFIX/sbin}
SERVICE=${SERVICE:-$SYSCONFDIR/systemd/system/}
CONFIG=$SYSCONFDIR/hassio.json
# Generate hardware options
case $ARCH in
"i386" | "i686")
MACHINE=${MACHINE:=qemux86}
HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant"
HASSIO_DOCKER="$DOCKER_REPO/i386-hassio-supervisor"
;;
"x86_64")
MACHINE=${MACHINE:=qemux86-64}
HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant"
HASSIO_DOCKER="$DOCKER_REPO/amd64-hassio-supervisor"
;;
"arm" |"armv6l")
if [ -z $MACHINE ]; then
error "Please set machine for $ARCH"
fi
HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant"
HASSIO_DOCKER="$DOCKER_REPO/armhf-hassio-supervisor"
;;
"armv7l")
if [ -z $MACHINE ]; then
error "Please set machine for $ARCH"
fi
HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant"
HASSIO_DOCKER="$DOCKER_REPO/armv7-hassio-supervisor"
;;
"aarch64")
if [ -z $MACHINE ]; then
error "Please set machine for $ARCH"
fi
HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant"
HASSIO_DOCKER="$DOCKER_REPO/aarch64-hassio-supervisor"
;;
*)
error "$ARCH unknown!"
;;
esac
if [ -z "${HOMEASSISTANT_DOCKER}" ]; then
error "Found no Home Assistant Docker images for this host!"
fi
if [[ ! "intel-nuc odroid-c2 odroid-n2 odroid-xu qemuarm qemuarm-64 qemux86 qemux86-64 raspberrypi raspberrypi2 raspberrypi3 raspberrypi4 raspberrypi3-64 raspberrypi4-64 tinker" = *"${MACHINE}"* ]]; then
error "Unknown machine type ${MACHINE}!"
fi
### Main
# Init folders
if [ ! -d "$DATA_SHARE" ]; then
mkdir -p "$DATA_SHARE"
fi
if [ ! -d "$SYSCONFDIR" ]; then
mkdir -p "$SYSCONFDIR"
fi
if [ ! -d "$SBIN" ]; then
mkdir -p "$SBIN"
fi
if [ ! -d "$SERVICE" ]; then
mkdir -p "$SERVICE"
fi
# Read infos from web
HASSIO_VERSION=$(curl -s $URL_VERSION | jq -e -r '.supervisor')
##
# Write configuration
cat > "$CONFIG" <<- EOF
{
"supervisor": "${HASSIO_DOCKER}",
"homeassistant": "${HOMEASSISTANT_DOCKER}",
"data": "${DATA_SHARE}"
}
EOF
##
# Pull supervisor image
echo "[Info] Install supervisor Docker container"
docker pull "$HASSIO_DOCKER:$HASSIO_VERSION" > /dev/null
docker tag "$HASSIO_DOCKER:$HASSIO_VERSION" "$HASSIO_DOCKER:latest" > /dev/null
##
# Install Hass.io Supervisor
echo "[Info] Install supervisor startup scripts"
curl -sL ${URL_BIN_HASSIO} > "/storage/hassio/sbin/hassio-supervisor"
curl -sL ${URL_SERVICE_HASSIO} > "/storage/.config/system.d/hassio-supervisor.service"
sed -i "s,%%HASSIO_CONFIG%%,${CONFIG},g" "${PREFIX}"/sbin/hassio-supervisor
sed -i -e "s,%%DOCKER_BINARY%%,${DOCKER_BINARY},g" \
-e "s,%%DOCKER_SERVICE%%,${DOCKER_SERVICE},g" \
-e "s,%%HASSIO_BINARY%%,${PREFIX}/sbin/hassio-supervisor,g" \
"${SYSCONFDIR}/systemd/system/hassio-supervisor.service"
chmod a+x "${PREFIX}/sbin/hassio-supervisor"
systemctl enable hassio-supervisor.service
#
# Install Hass.io AppArmor
#if command -v apparmor_parser > /dev/null 2>&1; then
# echo "[Info] Install AppArmor scripts"
# mkdir -p "${DATA_SHARE}/apparmor"
# curl -sL ${URL_BIN_APPARMOR} > "${PREFIX}/sbin/hassio-apparmor"
# curl -sL ${URL_SERVICE_APPARMOR} > "${SYSCONFDIR}/systemd/system/hassio-apparmor.service"
# curl -sL ${URL_APPARMOR_PROFILE} > "${DATA_SHARE}/apparmor/hassio-supervisor"
#
# sed -i "s,%%HASSIO_CONFIG%%,${CONFIG},g" "${PREFIX}/sbin/hassio-apparmor"
# sed -i -e "s,%%DOCKER_SERVICE%%,${DOCKER_SERVICE},g" \
# -e "s,%%HASSIO_APPARMOR_BINARY%%,${PREFIX}/sbin/hassio-apparmor,g" \
# "${SYSCONFDIR}/systemd/system/hassio-apparmor.service"
#
# chmod a+x "${PREFIX}/sbin/hassio-apparmor"
# systemctl enable hassio-apparmor.service
# systemctl start hassio-apparmor.service
#fi
##
# Init system
echo "[Info] Run Hass.io"
systemctl start hassio-supervisor.service
##
# Setup CLI
echo "[Info] Install cli 'ha'"
curl -sL ${URL_HA} > "${PREFIX}/bin/ha"
chmod a+x "${PREFIX}/bin/ha"
You need to:
chmod +x hassio-install.sh
(My config above)
mkdir -p /storage/hassio/etc/
touch /storage/hassio/etc/hassio.json
mkdir -p /storage/hassio/sbin
touch /storage/hassio/sbin/hassio-supervisor
mkdir -p /storage/hassio/etc/systemd/system
touch /storage/hassio/etc/systemd/system/hassio-supervisor.service
Also, you maybe need this fix.
Let ./hassio-install.sh -m odroid-n2
do its thing
(valid -m are: intel-nuc odroid-c2 odroid-n2 odroid-xu qemuarm qemuarm-64 qemux86 qemux86-64 raspberrypi raspberrypi2 raspberrypi3 raspberrypi4 raspberrypi3-64 raspberrypi4-64 tinker. )
Then: /storage/hassio/sbin/hassio-supervisor
which should pull what remains and start it up at you corelecIP:8123
check content of above hassio-supervisor & hassio-supervisor.service match.
N.B: The following are historic ramblings:
It pulls and does itâs thing when I:
/storage/hassio/sbin/hassio-supervisor
But, it chokes on:
20-08-06 06:37:34 INFO (MainThread) [supervisor.plugins.dns] No CoreDNS plugin Docker image homeassistant/aarch64-hassio-dns found. 20-08-06 06:37:34 INFO (MainThread) [supervisor.plugins.dns] Setup CoreDNS plugin 20-08-06 06:37:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/stable.json 20-08-06 06:37:34 WARNING (MainThread) [supervisor.updater] Can't process version data: 'aarch64' 20-08-06 06:37:34 WARNING (MainThread) [supervisor.plugins.dns] Error on install CoreDNS plugin. Retry in 30sec
Which is strange, as itâs there: https://hub.docker.com/r/homeassistant/aarch64-hassio-dns
Suppose itâs iptables related. (edit: it was not, see below)