Linux openHAB Configuration

We will use a directory in our user account for our openHAB configuration. This will avoid using sudo so much. So first open a terminal and then cut and paste the following commands into the terminal (screen shot of the process ).

First we download the configuration files:

 wget -O

Then we unzip the files, delete the zip file, and enter the directory:

rm -f
cd openhab_starter_config/
Now we copy the files to the actual server configuration:
sudo cp -af * /etc/openhab/configurations/

Next start the server:

sudo /etc/init.d/openhab start

Now open a web browser and go to:


You should see this:

 Wahoo! (Okay if it didn't work go to openHAB Troubleshooting)

 Now let's do our first small customization by editing the site map file, use your favorite editor or do this:

gedit sitemaps/engimusing.sitemap &

So here is what the file looks like. So we will change the heading on the top of the web page from "Engimusing Home Automation" to "My Home Automation" (see the high lighted text). So edit the line to what you want for your home automation system.

 And after the change.

 We save the file and then we need to transfer it to the server:

sudo cp -af * /etc/openhab/configurations/

The server will re-read the file every few seconds. So if we reload the page in the browser we see that the title has changed.

 Okay cool so far. We have deployed a full blown web server! This is not just installing an app on your phone.

Speaking of your phone, let's set it up. openHAB is compatible with both iOS and Android. The set up is the same for an iPhone as it is on my Android phone. So go to the App Store or the Play Store, search for "openhab" and install the app.

When you open the openHAB app you will see the following screen. This is the openHAB demo application. You can play around with it if you want. 


But since we want to control our own system we need to change some settings. On an Android the settings come up by pressing the left control button below the screen. On an iPhone (or iPad) you will see the "Settings" in the top right. You should see a screen like this next one. See the "Demo Mode" entry? Turn it off and go out of settings.

The app will then search for an openHAB server on your network. If you are lucky today you will soon see your own system just like below.


If it couldn't find the server we need to put in the address of your machine. It is probably a good idea to do this even if it found your machine. So let's go back to settings to set up the "openHAB URL". It expects a URL in the form of http://machine_name:8080 or http://ip_address:8080. If it works with the machine name that is ideal so we will try that first. If you don't know your machine name type hostname into the command line. So put in your URL like in the following example.

Then go out of settings and see if it worked. If so wahoo! If not type hostname -i to find your IP Address and go to settings and put it in like in this example.

 Go out of settings and try again. Wahoo! You should be able to control your very own home automation system from your smart phone now. (Okay if it didn't work go to openHAB Troubleshooting)