OpenHAB 2 and RaZberry

OpenHAB 2 and RaZberry

This article is about the installation of the OpenHAB 2 software interface into the Raspberry Pi 3 mini-computer with the Z-Wave RaZberry extension module.

Brief instructions

  • Formatting the Micro SD card
  • Downloading the image of the Raspbian operating system for the modified network version (OpenHABian), which contains the OpenHAB 2 software solution, and its writing to a memory card. The link for downloading is on the GitHub of the manufacturer on this link in the Downloads section.
  • Connecting the power supply for Raspberry Pi 3 and the Ethernet cable for the access into the local network and the internet.
  • Then the installation of the operating system itself is started, which takes 45-60 minutes depending on the speed of the internet and the used SD card.
  • Setting the Z-Wave binding and the correct serial port for RaZberry.

Instructions for preparing Raspberry Pi 3 for use with the Z-Wave RaZBerry adapter and the OpenHAB 2 software interface

Preparing and formatting of the SD card

Unfortunately, the manufacturer of this mini-computer has stopped supplying the Micro SD card from the second version and therefore it is necessary to provide for such a memory card with the capacity of at least 8 GB.

Then insert this card, using a suitable adapter, into the card reader and format it, e.g. by using the SDFormatter software. It is necessary to select the correct unit.

sdformatter

Writing the image of the operating system on the SD card

Then the image of the modified network version of the Raspbian operating system is downloaded that contains the OpenHAB 2 software solution, and its writing on the memory card. The link for downloading is on the GitHub of the creators of this image on this link in the Downloads section. This image file must be written on the memory card prepared by us, you can do it simply by using the Win32DiskImager programme. It is necessary to set the correct path to the image file and the correct unit of the memory card.

win32 disk

After the completed writing of the image insert the card into your Raspbery Pi 3, and connect the Ethernet cable. If you have a monitor you can connect it to Raspberry Pi 3 using the HDMI port and you can watch the progress of the network instalation of the operating system. Then connect the power supply that must have the parameters for the 5V DC output signal and at least 2A.

You can find out the IP address of Raspberry Pi 3 in a a number of ways, using the following:

  • the command line with the command arp –a (if you know the MAC address of the device)
  • the web interface of the router
  • the dedicated software, e.g. Advanced IP Scanner

advanced ip scanner

PuTTy

 

putty

Open the SSH client, PuTTY, insert the found IP address into the Host Name (or IP address) field. By default, the port is set to the value of 22 after the SSH connection. Click Open. A window with a warning pops out where you must click Yes. Then Raspberry asks you to log in, the default login data are: login: pi password: raspberry. After you have successfully logged in you can enter specific commands into the command line. The successful connection is showed in the figure below.

putty

Configuration of the OpenHABian operating system

openhabian

  • Enter the command sudo openHABian-config
  • Wait a minute for the execution of the command, then confirm by clicking OK and select "Update"
  • Wait a minute for the execution of the command and select "Basic Setup"
  • Wait a minute for the execution of the command and select "Serial Port" (use an asterix to mark all the options using the spacebar and confirm by pushing Enter). The figure shows the result.

openhabian

  • After these steps the output on the console should look like this.

openhabian

  • Then enter the command sudo rpi-update and then sudo reboot
  • Wait until RPi3 restarts and connect to the OpenHAB interface locally using the IP address of RPi3 (found out in the step above) and the 8080 port. For example 192.168.1.137:8080

The openHAB 2 web interface

As mentioned above, wait until RPi3 reboots and then enter the found IP address into the browser, do not forget to add the "8080 port behind it, which is typical for an HTTP protocol. For example, our IP address is 192.168.1.137:8080. Connect to the openHAB 2 web environment that asks you which configuration you want, we recommend you to enter EXPERT to have access to all the options of the interface. The interface will look like this after the configuration.

openhab2

We have chosen the PAPER UI interface for our setting - therefore the instructions for the setting of the RaZberry 2 serial port in the openHAB 2 interface are written for this interface. You can carry out the settings e.g. in this interface and then you can use another environment.

Setting the RaZberry 2 serial port for the communication with the openHAB 2 environment

  • Select the PAPER UI skin
  • Click the tab Add-ons -> Bindings into the search field o Z-Wave. Select the version 2.0.0 and click Install

openhab2

  • Then click Inbox -> button + -> click Z-Wave Binding -> Z-Wave Serial Controller. Enter -> /dev/ttyAMA0 into the serial port and save the changes by clicking on the tick.

openhab2

  • After clicking Configuration -> Things you can find out if the RaZberry 2 is ONLINE.

openhab2

Adding the Z-Wave devices (inclusion) into openHAB 2 in PAPER UI

Click Inbox -> + -> Z-Wave Binding ->  the so-called Learning mode is started that is used for adding the Z-Wave devices. Then it is necessary to push the dedicated button on the device you want to add to carry out the pairing. The paired device is displayed, confirm it. Then click the tab Configuration -> Things -> Clck the newly added devices and click the empty circle that is used to set the class and group of the devices, and for its subsequent adding into the basic DashBoardu click the tab Control.

openhab2

Setting the remote access

First, in the Paper UI interface you have the install the openHAB Cloud Connector item.

In the Paper UI graphic interface you can do it as follows:

Add-ons -> Misc -> search openHAB Cloud Connector -> Install

They you can configure it in the options ConfigurationServices where you can set the base URL and the devices you want to make available through remote access.

Go to the cloud solution http://my.openhab.com, where it is necessary to register. You will need the following data for the registration:

  • E-mail address
  • Password
  • openHAB UUID
  • openHAB Secret

openhab2

You will find out the openHAB UUID data as follows:

Using Putty and the SSH protocol, connect to RPi3, and there add the commands into the console:

  • cd /var/lib/openhab2/
  • nano uuid

And copy the UUII data into the registration form.

You will find the openHAB Secret data as follows:

Using Putty and the SSH protocol, connect to RPi3, and there add the commands into the console:

  • cd /var/lib/openhab2/openhabcloud/
  • nano secret

And copy the Secret data into the registration form.

Setting the application for a smartphone

Download the openHAB application from Google Play/Appstore. In the settings (Settings) fill in the data for openHAB URL – in fact, it is the local acces to the Z-Wave control set, enter the IP address of RPi3 with the RaZberry 2 module and do not forget the particular port for the HTTP protocol, e.g. 192.168.0.137:8080.

openHAB Remote URL – this is the remote access that is set to this URL address http://myopenhab.org  by default, but you can adjust it the Add-One openHAB Cloud Connector, that had been installed in the step above. Of course, for the Remote URL it is necessary to fill in the login data such as the e-mail address and the password.

 

1 Komentár

  • Tibor

    Tibor 05/22/2017 Odpovedať

    V najnovsej verzii openhabian (v1.2) je login: openhabian, password: openhabian

Zanechajte nám Váš názorZanechajte odpoveď

Vyhľadávanie v blogu

Najnovšie názory

Recently Viewed

No products

Menu

Compare 0