Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderofsalvation/be4377a1ab28a18e8f9133ab75a569bf to your computer and use it in GitHub Desktop.
Save coderofsalvation/be4377a1ab28a18e8f9133ab75a569bf to your computer and use it in GitHub Desktop.
installing home-assistant server on android

installing home-assistant server on (rooted) android

$ wget
https://gist.githubusercontent.com/coderofsalvation/be4377a1ab28a18e8f9133ab75a569bf/raw/27b579e31ed0b190318a41fc1d480e3220a568c6/installhass.sh
$ chmod 755 installhass.sh
$ ./installhass.sh
#!/bin/bash
set -e
set -x
export TIMEZONE=Europe/Paris
export UID=1001
export GUID=1000
export MAKEFLAGS=-j4
export VERSION=0.103.6
export PLUGINS="frontend|http"
curl "https://raw.githubusercontent.com/home-assistant/home-assistant/${VERSION}/requirements_all.txt" > /tmp/requirements_all.txt
grep hass /etc/passwd || adduser -h /data -D -G hass -s /bin/sh -u ${UID} hass && \
grep hass /etc/group || addgroup -g ${GUID} hass
apk add --no-cache git python3 ca-certificates libffi-dev libressl-dev nmap iputils && \
pip3 install --upgrade --no-cache-dir pip==19.0.3 && \
apk add --no-cache --virtual=build-dependencies build-base linux-headers python3-dev tzdata && \
cp "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime && echo "${TIMEZONE}" > /etc/timezone && \
sed '/^$/q' /tmp/requirements_all.txt > /tmp/requirements_core.txt && \
sed '1,/^$/d' /tmp/requirements_all.txt > /requirements_plugins.txt && \
egrep -e "${PLUGINS}" /requirements_plugins.txt | grep -v '#' > /tmp/requirements_plugins_filtered.txt && \
pip3 install --no-cache-dir -r /tmp/requirements_core.txt && \
pip3 install --no-cache-dir -r /tmp/requirements_plugins_filtered.txt && \
pip3 install --no-cache-dir homeassistant=="${VERSION}" && \
apk del build-dependencies && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
hass --open-ui --config=/data
# wait a bit..and browse to http://{your-ip}:8123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment