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.

 

9 Comments

  • 3movs

    3movs 10.11.2019 Reply

    I haven t had time to look at the code in depth, and would be very interested in your response. What would it take to add a driver for a bespoke application (using a BLE or ANT ANT+) dongle?
    • SmarterHOME Team

      SmarterHOME Team 12.11.2019 Reply

      Hello,
      here is binding provides support for generic Bluetooth devices - https://www.openhab.org/addons/bindings/bluetooth/

      Thank you.
      Have a nice day.

      SmarterHOME
  • Robert

    Robert 25.01.2019 Reply

    Dobry den,

    rozmyslam nad z-wave technologiou, zatial pre riadenie vykurovania (vyhladovo viaczonove), neskor chcem doplnit stmievace svetiel a dalej sa uvidi. Sucasny plynovy kotol nema OpenTherm, ma iba on/off spinanie a momentalne je riadeny 7-dnovym programovatelnym termostatom.
    Chcel by som pouzit Z-Wave.Me modul RaZberry, termostat a spinac Secure SRT322, neskor hlavice Eurotronic Spirit. Videl som niekde na videu, ze prave takato konfiguracia v OpenHAB (alebo to bolo v Z-Way??) funguje.
    Potreboval by som vytvorit skript na riadenie kurenia, ktory by akceptoval podmienku WiFi Presence (nie Geofence) pre zvolene pevne IP adresy. Konkretne: ak aktualna teplota merana stenovym termostatom je nizsia ako "pohodova teplota" a z-wave hub zaregistroval, ze v sieti je aktivna niektora zo zvolenych IP adries, tak sa nastavi/zmeni hodnota pre zopnutie termostatu na "pohodovu teplotu". Pohodova teplota moze byt napr. urcena z tabulky rozvrhu kurenia (ako najblizsia vyssia teplota v rozvrhu).
    Neskor by som chcel implementovat riadenie kurenia podla kratkodobej predpovede (vyrazne ochladenie ci oteplenie). Zatial nemam jasno, aku heuristiku zvolit na kotle, ktory ma len on/off riadenie.

    Chcel by som sa opytat:
    1. Ake prostredie mam zvolit? Z-Way ci openHAB?
    2. Ma zmysel riadit kurenie podla prepovede pocasia?
    3. Existuje skript/heuristika ako riadit kurenie podla predpovede?
    4. Pojde to ovladat hlasom? Napr.: Alexa, increase temperature in living room by two degree!

    Programovat viem, Rasberry mam, linux pouzivam.

    Dakujem za odpoved.
    • SmarterHOME

      SmarterHOME 28.01.2019 Reply

      Dobrý deň,

      v princípe môžete vyskúšať obidva softvérové rozhrania, či už Z-Way alebo OpenHAB2 na Raspberry Pi s RaZberry modulom.

      Podpora jednotlivých zariadení závisí od softvérových riešení nakoľko niekedy je nutné riešiť kompatibilitu nie len na hardvérovej úrovni ale aj softvérovej.

      Spomenuté zariadenia so:
      - Z-Way rozhraním sú kompatibilné
      - OpenHAB2 nemusia byť kompatibilné odporúčam vopred kompatibilitu overiť cez google / OpenHAB2 fórum

      1. Ake prostredie mam zvolit? Z-Way ci openHAB?
      Je to na Vás vyskúšať môžete viacero či už Z-Way, OpenHAB, HomeAssistant, Domoticz alebo iné.
      Z-Way je najviac plug-and-play ale nemusí poskytovať také široké možnosti ako by ste potreboval.

      2. Ma zmysel riadit kurenie podla prepovede pocasia?
      To závisí od konkrétneho typu použitia, veľa kotlov integruje už ekvitermické riadenie. Avšak to má možno hlavne zmysel pri temperovaní a vyšší výkyvoch vonkajšej teploty.

      3. Existuje skript/heuristika ako riadit kurenie podla predpovede?
      Či existuje nejaký skript neviem, pravdepodobne áno. Samozrejme, že si takýto skript viete vytvoriť a napísať sám.
      Napr. pre HomeAssistant
      https://partofthething.com/thoughts/a-fancy-home-assistant-automation-that-checks-the-weather-and-figures-out-when-to-turn-on-your-heater/

      4. Pojde to ovladat hlasom? Napr.: Alexa, increase temperature in living room by two degree!
      Veľa zariadení je možné integrovať napr. osvetlenie, zásuvky, scény. S kúrením bývajú problémy, ale napr. s HomeAssistantom je to možné.
      https://community.home-assistant.io/t/simple-script-to-enable-amazon-echo-alexa-to-set-the-temperature-on-a-climate-thermostat-device-via-the-emulated-hue-component/7924

      Prajeme pekný deň.
  • marek

    marek 01.11.2018 Reply

    Da se z open hab ovladat toto zarizeni? https://smarterhome.sk/cs/bezdratove-ovladani-zaluzii-rolet-markyz-bran/qubino-ovladac-zaluzii-plus-zmnhcd1-203.html
    • SmarterHOME Team

      SmarterHOME Team 05.11.2018 Reply

      Zariadenie by malo pracovať pod OpenHab 2 ale je potrebné po inclusion procese (pridaní zariadenia do OpenHab) urobiť kalibráciu žalúzií/roliet.

      Viac info:
      https://community.openhab.org/t/unable-to-rotate-venetian-blinds-via-rules-z-wave-qubino-flush-shutter/16690/43

      Pekný deň.
  • Robert

    Robert 09.11.2017 Reply

    Zaujímalo by ma,ako sa dá rozbehať v "HABMIN scheduler" (nereaguje tlačítko new a nedaju sa tým časovače naprogramovať) ..vie niekdo poradiť ? Ď
    • SmarterHOME Team

      SmarterHOME Team 13.11.2017 Reply

      Dobrý deň,
      ďakujeme za podnet.

      Bohužiaľ je Vami popísaná situácia známy bug v rozhraní OpenHAB 2.
      https://community.openhab.org/t/not-sure-if-habmin-works-right/24339

      Nakoľko toto rozhranie je open-source, oprava bugov aktualizáciou je otázka na developerov.

      Na tvorenie pravidiel, skriptov a scén, odporúčame vytvárať nasledovne (potrebná znalosť Linux-u a programovania):
      http://docs.openhab.org/tutorials/beginner/rules.html

      Prajeme príjemný deň.
  • Tibor

    Tibor 22.05.2017 Reply

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

Leave a CommentLeave a Reply

Blog search

Latest Comments

Recently Viewed

No products

Menu

Compare 0