Skip to content

Instantly share code, notes, and snippets.

@mintbird
Created September 7, 2020 10:14
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 mintbird/12a2645ef6c10b37f55240e2aff75434 to your computer and use it in GitHub Desktop.
Save mintbird/12a2645ef6c10b37f55240e2aff75434 to your computer and use it in GitHub Desktop.
Script for Installing Home Assistant for Raspberry Pi Zero / Zero W
#!/bin/bash
# Createed from instruction on this page
# https://www.home-assistant.io/docs/installation/raspberry-pi/
# Update library
sudo apt-get update
sudo apt-get upgrade -y
# Install required library
sudo apt-get -y install python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev autoconf build-essential
# Add an account for Home Assistant Core
sudo useradd -rm homeassistant -G dialout,gpio,i2c
# Create a directory for the installation
cd /srv
sudo mkdir homeassistant
sudo chown homeassistant:homeassistant homeassistant
# Create and change to a virtual environment for Home Assistant Core
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate
# Install a required Python package
python3 -m pip install wheel
# Install Home Assistant Core
pip3 install homeassistant
# Run Home Assistant
hass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment