I am new to openHAB and have already run openHAB on three different platforms as I learn more about this home automation software. I am not new to the world of IT, though, which is where I make my daily living. openHAB has taken many days of work to learn, and to make things easier on myself, I have put together my own guides to make new installations easier.
I first ran openHAB within Windows to get familiar with it. Then, I ran it on a Raspberry Pi, which I had already purchased and was using while testing Samsung SmartThings. I dumped SmartThings due to the lags and the Samsung cloud service being down for quite a while a few days after I first set it up. Now, for several reasons, such as easier backup, snapshot protection for upgrades, etc., I have my primary openHAB installation running on a Debian VM in VMware Workstation. In the future, I may also continue to use the Raspberry Pi for running mochad for X10 integration so that I can keep it in a more desirable location central to the main breaker box in the house.
There are two guides below. One provides a complete basic installation of the Raspberry Pi and openHAB. The second provides the info needed to install Debian on a virtual machine (VM) and then use the steps from the Raspberry Pi guide to complete the install of openHAB, etc. I wanted to be able to use wifi with the Raspberry Pi and had too many difficulties with the openHABian image and wifi so I abandoned openHABian. Using NOOBS and Raspberry Pi made wifi usage very easy. These guides should make it fairly simple for most people to quickly set up the Raspberry Pi and/or a Debian VM for use with openHAB. They are not extremely detailed at present and expect that there is at least a basic familiarity with Linux and the openHAB primary documentation. In the future, more detail can be added, as needed. For me, at least, these guides consolidated the various sources of information in one simple to follow framework.
I have also found that the Raspberry Pi and the Debian VM can work well together as an openHAB backup from either one will work well being restored to the other. Therefore, if there were a major failure on one of the devices, the openHAB backup can quickly be restored to the other to allow the home automation software to be put back into production.
I have found that I was able to back up my openHAB configuration in the Debian VM that also had my Zooz S2 Stick installed and was running my Zooz and GE Z-Wave devices and move everything over to my Raspberry Pi running Raspbian Lite and it worked fine after restoring my openHAB backup file to the Raspberry Pi. Before restoring, I stopped the openHAB service. After restoring, I did a reboot. It is working great.
Raspberry Pi 3 B Plus with Raspbian Lite Setup Guide
Software:
- NOOBS Lite v3.0
- Raspbian Lite version Nov 2018
- Java 1.8.0_201
- openHAB 2.4.0
- Mochad 0.1.17
Steps:
- Use NOOBS to install Raspbian Lite with network cable plugged in.
- This allows easiest use of wifi. Openhabian is very problematic with wifi.
- Default username & password is “pi : raspberry”.
- Using “sudo raspi-config”
- Change memory split for the GPU to 16
- Set locale to en-US-UTF8
- Change hostname
- Enable ssh
- Configure wifi
- Update “/etc/hosts” with correct IP address for new host name using the command:
sudo nano /etc/hosts
- Run update and upgrade commands:
sudo apt-get update
sudo apt-get upgrade
- Install Java using the instructions at the below URL
- Install openHAB using the package repository method (see openHAB Linux install doc for “Apt Based Systems”)
- Set up Samba to share the config files (see openHAB Linux install doc section “Network Sharing”)
- Note that you will get an error when you run the following command because it includes the directories for the package repository and the manual installation methods. You can ignore the error.
sudo chown -hR openhab:openhab /etc/openhab2 /opt/openhab2/conf
- Install mochad 0.1.17 (for use with X10 devices)
sudo apt-get install libusb-1.0-0-dev
wget -O mochad.tgz https://sourceforge.net/projects/mochad/files/mochad-0.1.17.tar.gz/download
tar xzf mochad.tgz
cd mochad-0.1.17
./configure
make
sudo make install
- Install zip (needed for openHAB backup command)
sudo apt-get install zip
- Set additional permissions
sudo adduser openhab dialout
sudo adduser openhab tty
sudo adduser openhab audio
- Edit “/etc/default/openhab2” and update the following value:
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"
Debian VM Setup Guide
Software Versions:
- Debian 9.7 (stretch)
- Java 1.8.0_201
- openHAB 2.4.0
- mochad 0.1.17
Steps:
- Do base installation (no desktop environment)
- Use small installation image (e.g. - debian-9.7.0-amd64-netinst.iso)
- Enable ssh during the installation process
- Add packages using "apt-get install":
- open-vm-tools
- dnsutils
- net-tools
- htop
- build-essential
- sudo
- Add user account to sudo group.
- As root, enter command:
adduser [user name] sudo
- Verify group membership by logging in as the user above and then running the command:
groups
- The output should be something like:
richardw@openhab-vm01:~$ groups
richardw cdrom floppy sudo audio dip video plugdev netdev
- As root, enter command:
- Prompt sudo users to enter root password.
- As user root, enter command:
visudo
- Add a new line in the “Defaults” section of the file:
Defaults rootpw
- As user root, enter command:
- Follow other steps from my Raspberry Pi 3 B Plus with Raspbian Lite Setup Guide beginning with checking that the IP address is correct in the “/etc/hosts” file.
Zooz S2 Stick (Z-Wave) Configuration on Debian VM
Note - this should work the same way on the Raspberry Pi with Raspbian Lite (minus the first bit about VMware Workstation), but I have not tested it yet.
- Shows as “Sigma Designs USB Serial Device” in Windows 10
- Connect the “Sigma Designs USB Serial Device” to the Debian VM in VMware Workstation
- Install Z-Wave Binding in openHAB using Paper UI
- In Paper UI, go to Configuration > System and turn on “Simple Mode” Item Linking.
- Configure Zooz S2 Stick with openHAB:
- Go to Inbox
- Click the Add button (blue circle with +)
- Select the Z-Wave Binding
- Select Z-Wave Serial Controller
- Under “Configuration Parameters,” click the drop-down under Port Configuration.
- The Zooz S2 Stick will be the option that has “ACM” in the name. In my case, the proper selection is “/dev/ttyACM0”.
- Accept the other default settings and click the option to save and close the window.
- You will be brought to the Configuration > Things window in Paper UI.
- In Paper UI, go to Configuration > System and turn off “Simple Mode” Item Linking.
- Go back to the Inbox in Paper UI
- Click the Add button.
- Select Z-Wave Binding
- openHAB will search for new devices
- Initiate the “pairing” process on your device.
- Once the device is discovered, click the check mark button next to the device to add it as a Thing.
- Give it a meaningful name.
- Go to Configuration > Things
- Find your device in the list and click on the name.
- Go to the Channels section of the device settings.
- Click the blue circle button next to the Switch channel.
- A “Link channel” dialog box will open.
- Click the space under “Please select the item to link:”
- Click on “+ Create new item…”
- Find the Label parameter about half way down on the left and change the entry to be a meaningful name (e.g. - Hall Downstairs Switch).
- Note - I make the Name and Label parameters match. For example, Name = “HallDownstairs_Switch” and Label = “Hall Downstairs Switch”.
- You can now go to Control in Paper UI and test the device.