Introduction: HABmin on Raspberry Pi, (An OpenHAB Admin Console)

About: I am a life long biz owner. I've been fortunate enough to have a successful business and a fun life.
HABmin is a nifty little (point and click, drag and drop) interface for performing openHAB administrative tasks. In order to work it requires version 1.4 or above of openHAB. HABmin is constantly being updated and new features have been added frequently It supports multiple languages and currently at the time of this writing it can do the following:



• General configuration (openHAB.cfg)
• Configure bindings
• Configure items
• Configure mapping
• Configure sitemaps
• Configure ZWave network
• Configure rules and notifications
• Query and graph data from persistence stores
• View OSGi binding status
• View log files


As stated on the wiki, "HABmin is an open source project. It makes use of a number of libraries under GPL license. Business users can take a piece of open source software and tweak it to suit their needs. Since the code is open, it's simply a matter of modifying it to add the functionality they want. Don't try that with proprietary software!"


Step 1: Issues

There are two methods for installing HABmin on your Pi. I followed both installation methods in order to understand each process. The recommended process (Step 3) was extremely fast but yielded some issues. The alternative method (Step 4) was a bit more taxing but worked like a charm.

The issue I had with the recommended install was that my status did not want to change from offline to online.The alternative method simply took a few seconds longer to load after accessing the interface home page.

Take your pick and feel free to ask any questions. If you need to remove openhab you can follow the next instructions, otherwise proceed to the next step

****READ THE FOLLOWING ONLY IF YOU ARE REMOVING HABMIN****

You can easily remove any files in order to try a different install approach. You can erase the entire habmin folder by doing the following:

rm -rf /opt/openhab/webapps/habmin

Then you will need to remove the two .jar files. Go to the "addons" folder.

cd /opt/openhab/addons

Open the folder to look for the two SNAPSHOT .jar files. Copy the name of the zwave-snapshot.jar file then remove it.

rm name_of_zwave_snapshot.jar (replace with the name of your jar file)

Scroll back up to the addons list and copy the name of the habmin-snapshot.jar file then remove it.

rm name_of_habmin_snapshot.jar (replace with the name of your jar file)

Step 2: Installation Option #1 (recommended)

In case you are interested in getting the latest release you con go here and copy the link address for the zip file.

https://github.com/cdjackson/HABmin/releases/lates...

Using this method your Pi will put the addons in the correct "addons" folder. As for the remaining files, it will create a "habmin" folder in the "`webapps" folder and dump the files there

Let begin by stopping openHAB. Assuming you followed my previews ible on how to automatically start openHAB on boot , you should have a file called openhab in your /etc/init.d directory. If not no worries, you do not ave to stop openHAB you will simply have to restart openHAB after completing this step.(find it here)


/etc/init.d/openhab stop

Go to the openHAB main directory to download the release there.

cd /opt/openhab

wget https://github.com/cdjackson/HABmin/releases/download/0.1.3-snapshot/habmin.zip

Unzip the file


unzip habmin.zip

Go ahead an restart openHAB


/etc/init.d/openhab start

Thats it. Pretty simple.


However for those of you that have problems with this install you can go the alternative route. For those instruction please proceed to the next step otherwise skip step 4.

Step 3: Installation Option #2 (alternative)

This is the process I ultimately took for installing HABmin. The other method was much faster, but for some reason my status remained offline.

First you will want to stop openHAB from running. Assuming you followed my previews ible (find it here) on how to automatically start openHAB on boot, you should have a file called openhab in your /etc/init.d directory. If not no worries, you do not ave to stop openHAB you will simply have to restart openHAB after completing this step.

/etc/init.d/openhab stop

Then go to your openHAB folder

cd /opt/openhab

Download the HABmin master zip file

wget https://github.com/cdjackson/HABmin/archive/master.zip

Unzip the file. This will create a new file called HABmin-master in your openHAB folder.

sudo unzip master.zip

Remove/erase the zip file as you will no longer need it.

rm master.zip

You will need to make a file called habmin. This file should be located inside the "webapps" folder. If you are already in the openhab folder it should look like this:

mkdir webapps/habmin

You will want to relocate the contents of the HABmin-master folder to the webapps folder. Assuing you are in the openhab folder...

mv HABmin-master/* webapps/habmin/

This will move the contents of the HABmin-master folder into the webapps/habmin folder, but it will leave the original folder (empty) in your openhab folder. You should erase it it.

rm -rf HABmin-master

Go to your "habmin" folder to be sure all the files are there.

cd webapps/habmin

Upon moving the contents of the HABmin-master folder to your webapps/habmin folder you should notice that there is an "addons" folder that was moved there as well. We should put the contents of that folder in its proper location which should be /opt/openhab/addons.

mv addons/* ../../addons/

Erase the now empty "addons" folder

rm -rf addons

You are done! Start openHAB and check out the next step for accessing the interface.

/etc/init.d/openhab start

Step 4: Accessing the Control Panel

Now you are ready to access the HABmin control panel. As long as you did not modify the server port for your openHAB and you are running it locally then you should simply be able to go to your localhost and provide the port openHAB is running on along with "/habmin/index.html" to access the control panel.

i.e. http://localhost:8080/habmin/index.html

After accessing the home page you will notice that your status is registered as "offline". If you wait a moment it should change to "online". You should see a little popup appear as in the image provided.

Have fun!

Step 5: Backing Up Your Files (optional)

The rsync utility is used to keep copies of a file on two computer systems the same for the purpose of synchronizing files and directories. We are simply going to use it for making a back up of our files located in the www, opt and root folders. This will come in handy in the event that we really mess things up while trying to configure our openHAB program.

This will make a copy every night and place them in your "mnt/sd" folder.

rsync -avzO /var/www/* /mnt/sd/backup_www
rsync -avzO /opt/* /mnt/sd/backup_opt
rsync -avzO /root/* /mnt/sd/userhome


You should be able to rest easy knowing that you hav backups of all the important folders. This applies not only to openHAB but to all the files and folders located inside of the www, opt and root folder. Now go and have some fun with openHAB and your new HABmin control panel. :)