Create a Hub for your Smart Home

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.
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
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 calledhomeassistantThis 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 theuser to
dialout
and the gpio
group. Zigbee and Z-Wave controllers needdialout, 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 Assistantinto. 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 needto 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 installHome 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 willcomplete 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 interfaceon 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.
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.
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!