Installing OpenHAB
To install and run OpenHab on your Pi I am recommending you use the apt-get approach, these instructions are taken from the OpenHAB Wiki, so it may be more up to date and have additional options. I also contribute to changes in the wiki every now and then so this may get out of date but in general be correct. This page does highlight the addons needed for the guides on my site. Shopping List - things you need to do this.
Just a Raspberry Pi for this, I still use V1 B+ as I have not needed to get a V2 yet. This pack has everything you need to get started.
Install Java if 1.6 or higher is not already installed. The following will display your current Java version.
java -version
Add the openHAB Bintray Repositories key to the apt-keyring using wget:
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
or using curl:
curl 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
Add openHAB apt repository to the apt sources list (Note: the current openhab.list file will be overwritten)
echo "deb http://dl.bintray.com/openhab/apt-repo stable main" | sudo tee /etc/apt/sources.list.d/openhab.list
Resynchronize the package index
sudo apt-get update
Install the openHAB runtime
sudo apt-get install openhab-runtime
If you have more than one OpenHAB binding with a USB device (Z-Wave, RFXCOM, etc), refer to [[symlinks]]
Start openHAB - manually
Init based on sysVinit (e.g. Debian 7 / Ubuntu 14.x and earlier)
sudo /etc/init.d/openhab start sudo /etc/init.d/openhab status
Init based on systemd (e.g. Debian 8 / Ubuntu 15.x and higher)
sudo systemctl start openhab
Start openHAB - at system startup
Init based on sysVinit
sudo update-rc.d openhab defaults
Init based on systemd
sudo systemctl daemon-reload sudo systemctl enable openhab
Install the add-ons / bindings as you need them. To follow these guides install the addons below. Feel free to add any other you may need or want.
sudo apt-get install openhab-addon-${addon-type}-${addon-name}
Install these addons:
sudo apt-get install openhab-addon-binding-http sudo apt-get install openhab-addon-binding-ntp sudo apt-get install openhab-addon-binding-weather sudo apt-get install openhab-addon-binding-zwave sudo apt-get install openhab-addon-persistence-logging sudo apt-get install openhab-addon-persistence-rrd4j sudo apt-get install openhab-addon-binding-mqtt sudo apt-get install openhab-addon-binding-exec sudo apt-get install openhab-addon-binding-squeezebox sudo apt-get install openhab-addon-binding-xbmc
A list of all available packages can be retrieved with
sudo apt-cache search openhab
Configure your system as outlined here: configuration.
If you wish to use a USB zwave stick or other USB/serial device you will need to add the “openhab” users to the “dialout” group:
sudo usermod -a -G dialout openhab
and then reboot.
- Test it, point your browser to
http://localhost:8080/openhab.app?sitemap=yourname
and you should see your sitemap. Replace localhost with the IP of your Pi if you are running headless.