[SOLVED] How to add veralite in openHAB

Hi All

I want to use veralite with openHAB, I have installed openHAB on Linux and I can open the console, I also have installed HABmin. My veralite is also switched on and connected to network and I can use it with my couple of modules. Now I want to add veralite into openHAB. This is where I am stuck.

In order to add z wave controller, you need the serial port for the same, under port configuration. (in HABmin) Now if I go to veralite console by typing 192.168.1.113(my veralite ip) and navigate to setup -> z wave settings, there I see port “/dev/ttyS0” BUT if I enter the same under HABmin it says serial error port /dev/ttyS0 does not exists …please guide me how to add veralite to HABmin. My controller is working fine as I can switch on and off the lights via veralite console and mobile app.

Please help
regards
Sammy

Hi Sammy,

as far as I know, you can only use HABmin if you have an attached zwave stick. Aeon and Razberry for example.

Since you do use vera(MiOS) and not a usb/serial attached controller, you can’t use the zwave-binding. You have to use the MiOS binding. You can find instructions on the openhab1 wiki. The Item configuration is still the same and all scripts provided in the wiki worked for me.

Please notice that the configuration of items has changed since OH1. To configure the MiOS binding you have to create a file named mios.cfg inside the folder services which you can find in the root directory of your openhab installation.

Put the following content in the file:

################################ MiOS Binding #######################################
#
# MiOS Binding Configuration settings allow for multiple MiOS Units,
# and take the form:
#
#   <unit>.<parameter>=<value>
#
# Where:
# * <unit> = a friendly, alpha-numeric, MiOS Unit name used in Item Definitions.
# * <parameter> is a named parameter, outlined below.
#
# The only required parameter is <host>, all others default.  The <unit> name in the
# example below defaults to "house", but can be any value.
#
# IP Address/DNS Name of the MiOS Unit (required, no default)
house.host=192.168.100.99

# TCP Port (optional, defaults to 3480)
#house.port=3480

# Timeout time (ms) used to compute MiOS Unit timeouts (optional, defaults to 60000)
#house.timeout=60000

# Wait time (ms) for MiOS Unit to bundle changes together (optional, defaults to 0)
#house.minimumDelay=0

# Number of incremental cycles before a full cycle occurs. (optional, defaults to 0)
#house.refreshCount=0

# Number of communication errors to force a full cycle load (optional, defaults to 1)
#house.errorCount=1

Where 192.168.100.99 is the IP of my veraEdge. Replace it with 192.168.1.113

OK ,… I edited the mios.cfg file as per instructions and then tried to install the MiOS binding, but now I cannot see the MiOS binding installed anywhere?? If I go to Bindings->extensions and scroll down, I can see MiOS installed (it says uninstall infront, so I assume its installed) BUT if I go to Installed Bindings, I do not see it installed (i see the default Astro, HUE, NTP etc, but no MiOS).
As a precaution I did restart the openHAB services, but no gain. How am i suppose to configure MiOS?

PLease assist.

looks like I am alone in this battle, Anyway, after much googling, I realized that MiOS binding is removed from openHAB2 for what ever reasons, and now you manually have to install the same. For that, you have to run openHAB2 Item file Generator, which is basically to tun 3 scripts in order to get you started. Now if I download the script, save it on my linux server and run it, it gives me an error, below is what I get .

sam9s@homeserver:/etc/openhab2/tools$ bash ./miosLoad.sh 192.168.1.131
./miosLoad.sh: line 2: $’\r’: command not found
./miosLoad.sh: line 22: syntax error near unexpected token fi' ./miosLoad.sh: line 22:fi’
sam9s@homeserver:/etc/openhab2/tools$

I dont thinkI can believe that the script can be corrupt after all this is what all the people are using, hence I have no idea what is wrong here, please can someone assist???

Below is the url I am getting the script from …

PLEASEEEE assist, someone

Regards
Sammy

I’m in a similar boat trying to get Openhab / MIOS working although I did get a little further than you. When I ran the MiosLoad.sh it worked fine:

ubuntu@pine64:~/mios$ bash ./miosLoad.sh 192.168.1.4
Loading MiOS Unit Metadata from 192.168.1.4...
Metadata Loaded into user_data.xml!

From there I was able to create a .items file but now I’m stuck.

How did you download the MiosLoad.sh script? It seems like you may have some extra characters in the script itself. Did you happen to download it first on one OS and move it to another? I used wget directly to download the script.

OK some support …and whew!! I thought I was the only one in this cyclone …lol,…ok so the story is…
I managed to move ahead, looks like I was wrongly saving the .sh file. I had to click on the file then click raw, copy the url from there, use the curl command to download the same on to my server. Once that was done …bash ./miosLoad.sh 192.168.1.131 …worked perfectly!! and so did the rest 2 as well. Next I copied the generated Items file and place it into the /etc/openhab2/items folder. I then installed the MiOS transformation files by below command …

sudo apt-get install subversion
svn checkout https://github.com/openhab/openhab/trunk/features/openhab-addons-external/src/main/resources/transform/
…BUT NOW WHAT??? lolzzz…

Can you guide me whats the next step …???

If I go to HABmin webpage, I see nothing that has changed, no MiOS binding still there?, what are we suppose to do next … boy this openHAB2 for getvera devices is complicated …:slight_smile:

Please hold on. I will explain it to you, but give me 5 more minutes.

2 Likes

So after the svn checkout I copied the files that were downloaded to /etc/openhab2/transform . After that I moved the .items file that was created to /etc/openhab2/items and restarted OH2. From there via the PaperUI I can see the items (but they are individual fields not actual “things”). This is where Im stuck.

I was not using paperUI I am using HABmin, none the less I went in to paperUI, but I dont see anything?, where exactly are you seeing the items?

Even I have copied items file that was created to /etc/openhab2/items. The name of the item file is house,item

I see it under Configuration | Items (if Items isn’t an option go into Configuration | System and turn off simple linking).

1 Like

To download the scripts:

  1. Navigate to github
  2. Click the RAW button in the upper right corner.
  3. Copy URL text from the navigation bar of your browser.
  4. Run following command in Ubuntu/Raspbian/Whatever: wget “https://raw.githubusercontent.com/openhab/openhab1-addons/master/bundles/binding/org.openhab.binding.mios/examples/scripts/miosTransform.sh
  5. Please replace the url with the one you copied.

Transformation:
You do only have to create the files in the directory transform of your openhab installation. They came there when I installed MiOS from the paperUI. Please make sure, that you did the same. Otherwise you can get my files from here:
https://www.file-upload.net/download-12447316/transform.zip.html
Please use the correct download button, as there are many ads. Sorry for that.
Unzip the archive into your transform directory and restart openhab.

Item generation:
First run ./miosLoad.sh 192.168.100.99
Second run ./miosTransform.sh house

You will get a file called “house.items”. Place this in your items directory of your openhab installation

Hi DayDay1,

all that is done I have a file called house.items under my items directory. What next, whats the next step?

Ok Frank yes now I see items listed, and interesting thing is, if I scroll down, I can see one of my z-wave plug F-101 also listed there, even though I am not sure what am I suppose to do with it there!!

You can handle Items a lot easier than things in my opinion. For example, install habpanel, add a dashboard, add a switch. Then edit the switch and select your switch item which handles your Z-Wave switch on your Vera controller.
I did not figure out how to place items inside the paper.

You could use the basic UI as well. Works great. Create a sitemap file called “house.sitemap” inside your sitemaps directory. Put the following contents in it:

sitemap house label="Main Menu" {
    Frame label="This is a test" {
        Default item=youritemhere
    }

Replace “youritemhere” with your item from your house.items file. For example if you do have a motion sensor, it could be JoernBewegungTripped from my house.items file:

Contact  JoernBewegungTripped "Joern Bewegung Tripped [MAP(en.map):%s]" <contact> (GDevices) {mios="unit:house,device:7/service/SecuritySensor1/Tripped"}

For debugging you can use the events file from openhab. If you installed openhab2 from the reposity you can use the following command:

tail -f /var/log/openhab2/events.log

This will give you a live feed of all items.

Yea, that’s where I’m pretty much stuck, I have a ton of items but how to turn that into usable “things” I’m not so sure about.

You don’t need things. Items are just fine. Please check out this page it explains how you can use the basic UI with items.

Forgot to mention: If you really want to use basic UI, you have to set the default sitemap file. Navigate to paper ui, select services on the left side and click on configure button on the “Basic UI” Card. On the right bottom you’ll find a field called “Default Sitemap”. Just enter the Value from your sitemap file. For example:

sitemap testing label="Main Menu" {

It would be “testing” without the quotes.

EDIT: For habpanel, check out this page. It looks awesome and feels so great. Even if it takes some time.

Yepppieeee!!..THAT is exactly the steps I needed, was able to switch on and off my LED (TEST) lamp that was on z-wave f-101 module.

Now will dig more into this and see where it takes me … Thanks for all the help … DayDay1… You are the one!! …:slight_smile: … Please do keep a check on this thread, as I am sure as I dig into more into this I will require some assistance for the same, once again really really thankful to you for the time and assistance.

Just one quick question, as and when I add more “items” devices, what all steps I have to re do in order to have them show in the “items” in habpanel ???

No problem sammy, that’s what the community forum is for.
To answer your question: You just need to recreate the house.items file:
First, add you Z-Wave device to vera. After that you have to recreate the items file:

./miosLoad.sh 192.168.100.99
./miosTransform.sh house

Copy house.items to your items directory and there you go.

1 Like

@dayday1 So if I understand correctly. Things are used by the Paper UI, sitemaps are needed for the basic UI but just the items for the HABPanel?

My two goals are to create a consolidated dashboard of both my zwave devices and some handmade “iot” devices (Raspberry Pis, ESP8266, etc) and do some automation? Given that should I just focus on items and not things?

One last question - one of my items from the zwave controller is a motion detector, how in the HABPanel can I show a visual indicator if the motion detector is open or closed and show the last time it was tripped?