A Look at HASSbian: Raspberry Pi for Home Automation

A Look at HASSbian: Raspberry Pi  for Home Automation

One of the things that I really love about the Raspberry Pi and other pi boards is their ability to support all kinds of custom home automation solutions. You can make it interface will all sorts of things today, from your living room lights to your Plex server. I came across the HASSbian operating system for the Raspberry Pi, and had a look at it running my Raspberry Pi 3.

HASSbian is a Raspberry Pi image based on Raspbian that has been customized for an easy installation of the Home Assistant software. Home Assistant is open source software for automating actions in response to defined trigger events detected on your home network or internet services. Home Assistant supports connecting to a wide range of services and devices, which is all customized through a configuration file. Some of the more interesting components of Home Assistant for me include monitoring Plex, Chromecast, and FireTV, interaction with IFTTT, Amazon Echo, MQTT, and Kodi media player, and support for EcoBee, Nest, and GPIO for the Raspberry Pi.

Install HASSbian and Home Assistant

Getting HASSbian with Home Assistant set up and ready for your customization is as easy as writing the system image to your microSD card and booting up the Pi.  The system image is availabe for download from the Home Assistant installation page.  I recommend using Etcher to write the image to the microSD card.  Once that is done, put the microSD card into the Pi, connect up Ethernet and power.

The system will automatically resize the filesystem and reboot the system.  When the system first boots up, HASSbian automatically downloads and installs the latest release of Home Assistant, so allow for approximately 5 fives for this prior to doing anything else.  At the hassbian login, you can type the username pi with password raspberry in order to log in to the system.  Open your browser and navigate to http://hassbian.local:8123 to access the Home Assistant web application.  The web application enables you to see your monitored services and interact with your configured devices.

In user pi’s home directory is a directory called hassbian-scripts. This includes scripts for installing Mosquitto MQTT server, Samba (Windows file sharing server), CEC support, OpenZWave, and the install script for Home Assistant.  To run any of the scripts, do as follows in a terminal:

sudo ./<scriptname>

I installed Samba using the provided install script. This downloaded, installed, and configured Samba.  The Samba configuration makes the hassbian directory accessible over your network,  providing easy access to your configuration.yaml file.

Adding Devices, Triggers, and Actions

Setting up devices and interactions with these devices and internet services are done by editing the configuration.yaml file.  It is curious that configuration changes are not possible through the web application, but the configuration changes can be rather easy. For example, if you copy and paste the Plex service configuration snippet into the configuration.yaml, restart Home Assistant, and you have Plex running, it will automatically discover Plex and provide you with a widget in the web application.  As you want to do more complex things with Home Assistant, then the configuration edits you make will get more complicated.  The Home Assistant web site does provide rather good samples and examples are not hard to find with some Googling.

After you make any configuration changes, you will need to restart the Home Assistant server.  You can do this through the web application or in a terminal with the following command:

sudo service home-assistant@homeassistant restart

Thoughts

HASSbian makes getting a Home Assistant up and running on a Raspberry Pi a rather trivial activity, and it is great way to get started with home automation.  Being essentially a customized Raspbian operating system, there are no issues with the system working correctly on your Raspberry Pi and there is no shortage of support available.  The Home Assistant web site provides good information on setting up your devices and service, while the online samples can help to get you started quickly.  Altogether, HASSbian makes it easy to get started on your custom home automation solution.  If you are interested in doing a home automation project, then HASSbian is something worth a try.