Raspberry Pi 3 B+ with Raspbian Lite, Debian VM, and Zooz S2 Stick Setup Guides

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
  • 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
  • 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.
7 Likes

Hi Richard,

Thanks for the write up! It’s always good to have something quick to reference from start to finish.

I also hadn’t considered that the zip and unzip tools might not be installed by default on some Linux distributions. We should probably recommend those packages so that they automatically install when openHAB is installed right? I created https://github.com/openhab/openhab-linuxpkg/issues/141 to track.

Same for adding groups: https://github.com/openhab/openhab-linuxpkg/issues/140

@Benjy Sounds good to me. Thanks!

Thanks for the write up and contribution.
It would be even greater to post these directly into a thread of their own instead of a PDF.

Thanks again

Yes, I would like to just post it in the thread and still have edit capabilities, but trying to figure out how to format it was going to take too much time. When I get some time, I will work on figuring out how the formatting works in this forum. :grinning:

Look up md formatting
There are some online tools.
VS Code has a plug in

1 Like

Sounds good. Thanks for the info!

@vzorglub Done! :+1:

1 Like

I added information for configuring a Zooz S2 Stick (Z-Wave) to my guides above.

I added this to the first post above.

Hey Richard. Been thinking of getting a Zooz S2 Stick instead of the Aeotec. Rumor has it the libraries in the Aeotec are dated. Curious why you turned on Simple Mode as part of your setup? I’ve been told turning it on even briefly can cause future configuration problems. To date I haven’t had to do that for any other device so curious.

Thanks.

JR

I have not had any “problems” from using simple mode. I use it to quickly add things for which I am not concerned about the naming scheme. I normally keep it off and add things and items myself so that I can name them how I want. I really wish that it were possible to rename all items in the GUI. I would like to have to do less tedious things manually and then spend time on those things that would need thought and work, such as scripts, etc. Anyway, so in this case, I just use Simple Mode to allow the channels/items/etc for the Zooz Z-Wave S2 Stick to be configured automatically. Once it is added, I turn it off to then have control over the adding of the Z-Wave things and items, such as the light switches and outlets, etc.

Thanks Richard. I tend to just use VS Code and right click add all items but on a different note, what made you go with the Zooz unit over Aeotec considering up till now Aeotec seems to be the main unit most people buy?

Thanks.

JR

I have read many reviews of many different Z-Wave products, and the Zooz devices seem to be rated highly. They are also using the latest preferred Z-Wave chip and features. The pricing was good through thesmartesthouse.com. The Zooz devices are working well for me. I have also installed several items at my parents’ home, as well, and they have been working well there also. I have recently ordered a few more Zooz switches. I may also try one of their motion sensors in the near future. The price and quality have been very good so far, but I have not had the products long so it remains to be seen what the longevity will be like. I have X10 switches and devices that have been working well for many years.