Add Java 8, OpenHAB and Z-Wave on a Synology DiskStation OS 6.1 Virtual Machine
The following acticle describes the process of installing Java 8, OpenHAB2, Aeon Labs Z-Stick Gen5 and a Fibaro Door/Window sensor on a Synology DiskStation OS 6.1 running as VirtualBox VM.
Using a Synology DiskStation to control a home automation environment is a good choice, since it usually runs 24 hours a day. However - as cautious as I am - I would first like to use a test environment to allow the experience gained there to be used into the later installation. In particular, problems can be identified in advance. This all results in a bunch of requirements.
A very interesting controller software for home automation is OpenHAB. The advantage of OpenHAB is, on the one hand, the possibility to run it on a DiskStation and on the other hand the large number of supported home automation protocols (bindings). It is written in Java and based on the OSGi framework (Equinox) (Requirements: Install Oracle Java 8, OpenHAB).
My choice for a wireless communications standard that unites the sensors and actuators in a common network fell due to the large number of available components on Z-Wave. As a controller, the Aeon Labs Z-Stick Gen5 USB stick will be used. A Fibaro Door/Window sensor will be integrated to complete a small home automation scenario (Requirements: Install Aeon Labs Z-Stick and Fibaro Door/Window sensor).
- This article assumes a Synology DiskStation DSM version 6.1 running in a VirtualBox VM
- For the ip address of your disk station the value 192.168.100.100 is assumed. You should replace this value with the actual value of your installation.
- You are logged into the DiskStation and have access via SSH and the web interface
One way to meet the prerequisites is to follow the installation procedure described in this article: Set up a Virtual Machine running Synology DiskStation OS 6.x
sudo -i, and then enter the password of
the account used to log in.
Besides any other workarounds spread on the internet you can do the following to log into disk station via SSH:
Create a RAID Group and a Volume
- Storage Manager RAID Group Create
- Select "RAID Group for single volume or iSCSI LUN (Block Level)" Next
- RAID Type: Basic Next
- Drag your 2nd HDD (>=8GB) to the RAID Group Next OK
- Perform disk check: Yes/No Next Apply OK
- Storage Manager Volume Create
- File system: ext4 OK
Install Oracle JAVA 8
- Refer to
pcloadletter.co.ukfor detailed instructions
- Create a shared folder named "public" and assign r/w permissions to user group "users"
- File Station Upload
jce_policy-8.zipto folder "public"
- Package Center Settings Package sources Add values
- Package Center Settings General Trust level Any publisher (includes setting for manual install later on) OK
- Package Center Community Refresh Java SE Embedded 8 Install
- Due to various hints throughout the web, "Unlimited Strength JCE Policy" should be chosen when requested to select "Java Cryptographic Strength Selection" policy Next Apply OK
- Note the DSM version (6.1) to download the proper OpenHAB version
- Create shared folders
- Package Center Manual Install Choose File Select the previously downloaded openHAB .spk file (at the
time of this writing:
OpenHAB-2.1.0.004-SNAPSHOT-DSM6-syno-noarch-0.001) "Run after Installation"If you like to take a closer look of what happens while installation of OpenHAB2, download
openhab-syno-spk-2.0.0.001-DSM6.zip, extract the files and inspect file
/script/installer.sh. The next steps depend on what is already set and done after OpenHab is installed. At the time of this writing the following steps had to be executed to get a configured system. This might change in the future.
Although the installation announces to use the folder
/volume1/public/openHab2/confto store configuration files if it exists, this folder is empty after the installation. In order to take advantage of having configuration files in the public folder, we mount the folders manually:
- Go to the Web Interface Control Panel Group and check if groups
uucpexist. If not, go to the command line and enter:
- Open the OpenHAB dashboard:
http://192.168.100.100:8080You should see the "Welcome to openHAB 2 - Initial Setup" page
- Go ahead and configure basic settings in OpenHAB (e.g. choosing "Recommended Setup" and "Paper UI " is a good start)
Install AeonLabs Z-Stick Gen5
- If you haven’t already, plug your controller into your Host-PC
- To pass-through the Z-Stick to your virtual machine, go to the VM guest window menu Devices USB and click on "Sigma Designs, Inc." to share the device
- The Diskstation should integrate the Z-Stick as
/dev/ttyACMxdevice (where x is a number, e.g.
/dev/ttyACM1, ...), hereinafter referred to as
/dev/ttyACM0. You can check the attached device by entering
ls -l /dev/ttyACM*
- Create UDEV rules and a start up script to set Z-Stick device permissions on each startup (you can find a readable version of the script at the end of this article). At command line enter (most probably you'll copy and paste):
- Wait while the DiskStation reboots and login again via ssh
Install Z-Wave binding and controller in OpenHAB
- Open the OpenHAB dashboard:
- Open "Paper UI" Add-ons Bindings Z-Wave Binding Install
- Open "Paper UI" Configuration Things Add Things Z-Wave-Binding Z-Wave Serial Controller
- In field "Serial Port" enter
Install Fibaro FGK101 Door Opening Sensor
- Prepare sensor as decribed in the manual
- Open "Paper UI" Things Z-Wave Node 2: FGK101 Door Opening Sensor
- Location Enter some informational text
- Set value of "3: Visual LED indications" to 0 to save battery
- Open "Paper UI" Things Z-Wave Node 2: FGK101 Door Opening Sensor (Click on the title)
- Activate channel "Door Sensor" by clicking on the blue radio box on the left
- Create a new item: Enter some text at "Label" and/or "Category"
- Open "Paper UI" Control Check sensor status by opening and closing the sensor the corresponding status ("Open"/"Closed") should be displayed
Start up script (readable)
Enter Karaf command line from remote
- Edit file
- Change entry
sshHost=0.0.0.0.Please be aware, that the console will now be accessible from all devices in your subnet and is only secured by the password defined in users.properties (same path). You should thereby change the password.
From OpenHAB - The Console
- Try to login at command line as follows
- Checkout some commands:
Usefull commands and infos
- Path to OpenHAB2:
- Take a look at the
- Path to Z-Wave node config xml files :
- DSM commands:
- Oracle Java SE Embedded Downloads
- Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8 Download
- OpenHAB latest release
- Using Karaf console from remote host
- OpenHAB - The Console
- [German] Grundlegende Befehle auf der Kommandozeile
- Z-Stick Gen 5 user manual