Home Assistant is an Open source home automation tool that is constantly being updated and enhanced through contributions from a large DIY community. Home Assistant is perfect to run on a Raspberry Pi or a local server to bring together various different technologies for a cohesive ecosystem, create automation and rules and integrate with your smart speaker.
This article is targeted to those who are planning to set up Home Assistant using Hassio for the first time. Refer to my Instruction video here or follow the detailed instructions below:
What will you need:
- Raspberry Pi: https://amzn.to/3Qr7U3d
- Power Supply (make sure the power supply is sufficient to avoid issues): https://amzn.to/3P2ZbD9
- At least an 8GB microSD card: https://amzn.to/3zDplXf
- USB memory stick (if using WiFi)
- Ethernet Cable (if using Ethernet)
Step 1 – Determine which type of the Home Assistant build is correct for you.
Home Assistant is the program which we will be using and can pretty much be built to work on most key operating systems. However, there are a couple of different builds that are available depending on the technology and purpose for automation including:
- Hass.io – Hass.io aka Hassio is an appliance (locked down) version of Home Assistant and is recommended for beginners.
- Hassbian – Raspbian Linux flavor, Debian on Pi, preconfigured for HomeAssistant. This is recommended for advanced users or people who wish to do more on their Raspberry Pi.
For the purposes of this article, we will be using Hassio. The Hassio site has a detailed installation instructions within their webpage however, there are a few steps that are unclear which are further explained below.
Step 2 – Determine the correct image
Determine which device to which you will be deploying Hassio. For this guide, we will be installing onto a Raspberry Pi 3 Model B and have selected the Raspberry Pi 3 Model B and B+ 32bit image at the following link. Commence download of the file as it will take some time depending on your download speed.
Step 3 – Download and install flashing software
You will need software to install the Hassio image onto your MicroSD card. I recommend using Etcher which is a free, open source software to flash devices.
Step 4 – Flash Hassio image to MicroSD card
Use your preferred software to flash the image downloaded in Step 2 onto a MicroSD card.
Step 5 – Install the WiFi connectivity instructions
If you are planning to use WiFi on your Hassio build, then you will need to create a file on a USB memory stick and plug it into the Raspberry Pi before you boot it up.
- Format the USB stick in FAT32 format
- Create a folder called Network and a file called hassos-wifi within the Network folder (i.e. \network\hassos-wifi).
- Edit the file and include your network configuration instructions and update the ‘address1’ to align to an IP address that is in the range of your router
- Some people have noted that saving the file using Notepad is fine, however others have noted that a program such as Notepad++ is required to save the file with encoding as ANSI and line ending to UNIX
I’ve used the following config:
[connection]
id=my-network
uuid=72111c67-4a5d-4d5c-925e-f8ee26efb3c3
type=802-11-wireless
[wifi]
mode=infrastructure
ssid=**SSID Name**
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=**WIFI Password**
[ipv4]
method=manual
address1=192.168.1.190/24,192.168.1.1
dns=8.8.8.8;8.8.4.4;
Where **SSID Name** and **WIFI Password** are your own network details
Step 6 – Start up the Raspberry Pi
After inserting the MicroSD memory card and the USB memory stick, power on your Raspberry Pi and connect to an HDMI monitor if you wish to view the boot up sequence.
Step 7 – Connect to your Hassio installation
If all has gone well, you should now be able to connect to your Hassio installation through your browser. If your router supports mDNS then it will be accessible through http://hassio.local:8123 or if you have used my configuration in Step 5, then it will be accessible through the static IP
http://192.168.1.190:8123.
The Hassio installation may still be setting up and you will see the following “Preparing Hass.io” screen.
Wait a while and then refresh until it is accessible to then allow you to create an initial account with a password.
You should then be presented with the initial state screen and potentially some devices that have automatically been detected on your network.
Step 8 – Install Samba share add-on
You may already have some devices discovered, however you will need to get access to the configuration files to add additional devices and sensors. An easy way to do this is to add the Samba share add-on.
- Go to the Hass.io link in the left-hand side navigation panel
- Click Add-on store in the tool-bar
- Click Samba share and click Install
- Edit the config and click Save and include the following details:
Config
{
“workgroup”: “WORKGROUP”,
“username”: “*****“,
“password”: “*****“,
“interface”: “wlan0”,
“allow_hosts”: [
“10.0.0.0/8”,
“172.16.0.0/12”,
“192.168.1.0/16”
]
}
Make sure you update the “username” and “password” to your required details and “interface” should be eth0 if you are using ethernet or wlan0 if you are using wifi and allow hosts to be updated to align to the IP range you selected in Step 5.
- Click Start to enable Samba share
- If you are having any issues, view the log at the bottom of the screen for more details. The log will say “Waiting for connections” when it is ready to access.
Step 9 – Edit your configuration files
Your configuration files should now be accessible through Windows Explorer e.g. \\192.168.1.190\config (depending on what static IP you selected in the config in Step 5.
The key configuration files are:
- automations.yaml – Used to specify your automations and the underlying scripts that are executed. These can also be added from within the Hassio interface
- configuration.yaml – The key configuration file which is where you will add your components and key configurations
- customize.yaml – Used to add a friendly/custom name to the entity_id for supported entities. This will be updated if you customize names from within the Hassio interface
- groups.yaml – Used to allow the user to combine multiple entities into one
- scripts.yaml – Used to specify a sequence of actions to be executed by Home Assistant when turned on
- secrets.yaml – Used to store your user names, passwords, APIs and other sensitive information to avoid disclosing via the configuration.yaml file
Additional Hints:
- I use Visual Studio Code to edit my files as it helps maintain the strict formatting for the configurations and is free and open source.
- If you make changes to your configuration files, you can run a validation over the files to check if you have made any errors. Go to Configuration > General.
- You can map your network drive for easy access to your configuration files.