[ One Mans Attempt @ Anxiety Relief ]

August 6, 2018

Raspberry Pi Home Assistant Install and Setup

Create a Hub for your Smart Home 


home automation raspberry pi

Raspberry Pi Home Assistant Overview

Make sure if you don’t have your Raspberry Pi setup with SSH enabled, and running on the proper power supply. Check out our Raspberry Pi Installation if not.
We are going to install in a virtual environment, which will have minimal
overhead. Firstly, you’ll need Python 3.5.3 or later installed, which is fine if
you have Raspbian Stretch.

Raspberry Pi Home Assistant Setup


Steps Taken
1.) Install Dependencies
2.) User and Directory Configuration
3.) Create Virtual Environment
4.) Install Home Assistant
5.) Final Touches

Raspberry Pi Installation of Dependencies

$ ssh <pi@raspberrypi.local>  
$ sudo apt-get update  
$ sudo apt-get upgrade -y  
$ sudo apt-get install python3 python3-venv python3-pip

User and Directory Configuration

Now we will add an account for Home Assistant called
homeassistant
This will only be used for running Home Assistant so we will use the extra arguments of
-rm to create a system account and home directory. -G dialout,gpio, adds the
user to dialout and the gpio group. Zigbee and Z-Wave controllers need
dialout, and gpio is used for the GPIO Pins on the Raspberry Pi.
$ sudo useradd -rm homeassistant -G dialout,gpio
Now we will create a directory on the Raspberry Pi to install Home Assistant
into. Also we need to change the owner to homeassistant.

$ cd /srv
$ sudo mkdir homeassistant
$ sudo chown homeassistant:homeassistant homeassistant

Create Virtual Environment 

Now we need to create and change to our virtual environment for Home Assistant.
This will need to be done in our homeassistant account.

$ sudo -u homeassistant -H -s
$ cd /srv/homeassistant
$ python3 -m venv .
$ source bin/activate

After you have activated your homeassistant virtual environment, we will need
to run a command to install a required python package.
(homeassistant) homeassistant@raspberrypi:/srv/homeassistant $ python3 -m pip install wheel

Install Home Assistant

Once you have installed the required python package it is now time to install
Home Assistant!

(homeassistant) homeassistant@raspberrypi:/srv/homeassistant $ pip3 install homeassistant

Final Touches

Now to our final step to Start Home Assistant for the first time. This will
complete the installation, create the .homeassistant configuration directory in
the /home/homeassistant directory and install any basic dependencies.
(homeassistant) $ hass

You can now reach your installation on your Raspberry Pi over the web interface
on http://ipaddress:8123.

You can find your ip address using this command
$ ipconfig




When you run the hass command for the first time, it will download, install
and cache the necessary libraries/dependencies. This procedure may take
anywhere between 5 to 10 minutes. During that time, you may get “site cannot
be reached” error when accessing the web interface. This will only happen
for the first time, and subsequent restarts will be much faster.

Share:

0 Comments:

Post a Comment

Please take a moment, Drink your coffee, and get to know us! We would like to help or discuss any issues, or suggestions you may have!



About Me

My photo
Cannabis Cultivar & 420Magazine News-Hawk

Featured Post

๐Ÿ”ฅ DIY Unleash the Power of Biochar: The Secret Weapon for Life, Odor, and Pest Control! ๐ŸŒฑ

    BioChar Activation ๐Ÿ”ฅ Activate and Unleash the Power of Biochar: The Secret Weapon for Life, Odor, and Pest Control! ๐ŸŒฑ Ever wondered ab...