Rants

In my previous post about unboxing and installing Raspberry PI I mentioned that I should develop my own application for controlling miscellaneous devices at my home. Since then I have realized that I don’t really have enough time to design and implement such an application, so I have reconsidered and chosen to go with openHAB instead.

The rest of this post will describe how to setup the openHAB server on Raspberry PI with the demo application. Let’s get started.

Update Raspberry PI

First, log on to the PI. I use SSH from my laptop with the following command:

ssh pi@raspberrypi

You will be promted for the password, so fill it in and hit enter. This will give you remote access to the terminal of the Raspberry PI.

"Pi shell"

Now, the first things we should do is make sure that the PI’s packages and firmware is up to date:

sudo apt-get update && sudo apt-get update
sudo rpi-update

You might be informed that a reboot is required for the updates to take affect. I you get such a notification, reboot the PI:

sudo reboot

Wait a while and then log in using SSH again.

Download packages

Next thing is to download all the packages we need. I will create a temp folder to download all the packages to:

mkdir temp

Move into that directory and start the downloads:

cd temp
wget https://bintray.com/artifact/download/openhab/bin/distribution-1.7.0-runtime.zip
wget https://bintray.com/artifact/download/openhab/bin/distribution-1.7.0-demo-configuration.zip

Since we are only installing the demo application at this point we only need the runtime and the demo-configuration zip-files.

Installation

Next we will create the installation directory. I’m using /opt as installation root:

sudo mkdir /opt/openhab

Now extract the downloaded zipfiles to the installation directory:

sudo unzip distribution-1.7.0-runtime.zip -d /opt/openhab
sudo unzip distribution-1.7.0-demo-configuration.zip -d /opt/openhab

Configuration

It’s time to configure openHAB. We won’t really do anything, but use the default configuration shipped with openHAB. To enable the default configuration we need to copy a file:

cd /opt/openhab
sudo cp configurations/openhab_default.cfg configurations/openhab.cfg

Start openHAB

Starting openHAB is as simple as executing a shellscript:

sudo ./start.sh

Access demo application

Now it is time to verify the installation. Open a browser on any device connected to the same network as the PI. Then go to:

http://raspberrypi:8080/openhab.app?sitemap=demo

Below is a couple of screenshots of the UI.

"openHAB UI"

"openHAB UI"