Mios binding setup

I am new to openhab so any help is greatly appreciated. I’m trying to get the mios binding to work in openhab 1.8.0. I was following the tutorial under the mios binding page. I am using a vera edge controller. I named the controller “house”.

I copied the mios binding file into the addons folder. I also put all of the mios map files in the transform folder.

in my config file I put:

mios:house.host=192.168.2.22

I used the item generator to generate a list of items. Here is one of the item codes it generated:

String KitchenLightDeviceStatus “Kitchen Light Device Status [MAP(miosDeviceStatusUI.map):%s]” (GDevices) {mios=“unit:house,device:25/status”}

when I look at the mios log I get this:

2016-02-22 21:54:22.916 [DEBUG] [.b.mios.internal.MiosActivator] - MiOS binding has been started
2016-02-22 21:54:22.929 [DEBUG] [.o.b.mios.internal.MiosBinding] - MiosBinding activate()
2016-02-22 21:54:22.974 [TRACE] [.o.b.mios.internal.MiosBinding] - MiosBinding updated()
2016-02-22 21:54:22.975 [DEBUG] [.o.b.mios.internal.MiosBinding] - updated: Created Unit 'house’
2016-02-22 21:54:22.976 [DEBUG] [.o.b.mios.internal.MiosBinding] - registerAllWatches: start

To test and see if everything was working in my sitemap I put this:

Text item=KitchenLightDeviceStatus

I get this in the runtime:

2016-02-22 22:06:30.782 [WARN ] [t.i.s.MapTransformationService] - Could not find a mapping for ‘-’ in the file ‘miosDeviceStatusUI.map’.

Which I’m guessing is because it’s not actually connected to my veraedge. Any idea’s on what I did wrong in my setup?

There’s usually some wrapper text around that line in a sitemap file.

I’d expect to see something like:

sitemap test label="House Menu" {
    Frame label="Frequently Used" {
        Text     item=WeatherTemperatureCurrentTemperature 
    }   
}

and if this is in a file like test.sitemap, then you’d call it something like:

http://<openHAB-IP>:8080/openhab.app?sitemap=test

When you see something like ‘-’ as a value, it means there’s no value. By default, once the MiOS Binding has fully loaded, it’ll populate the values of any MiOS-Bound items.

Initially that can take a few seconds, but you’ll see evidence of that activity in logs/openhab.log, and in logs/events.log. It’s a lot quicker to check those logs to see if its functioning correctly. Once it is, you’ll find it easier to build out the Sitemap, and then onto Persistence.

Have you setup any form of Persistence? (configurations/persistence)? If you do this, it’ll cover the gaps between when openHAB starts, and the MiOS Binding starts.

I use mapdb.persist there, since it’s the most like Vera/MiOS Persistence. (one value, one value only). My starter version of this file looks something like:

// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
	// for mapdb charts, we need a cron strategy
	everyMinute : "0 * * * * ?"
	everyDay : "0 0 23 * * ?"
}

Items {
	GPersist* : strategy = everyChange, restoreOnStartup
	GTemperature* : strategy = everyChange, restoreOnStartup
}

obviously change the group names to match your own.

Thanks for your reply. I wasn’t very clear in my first post.

I did have a wrapper text around the line in my sitemap I just didn’t include it in my post.

I’ve checked the “openhab” log and “event” log and there is nothing about mios in them. I setup the “mios” log as the binding instructed and when I start the openhab runtime I get this.

2016-02-22 21:54:22.916 [DEBUG] [.b.mios.internal.MiosActivator] - MiOS binding has been started 2016-02-22 21:54:22.929 [DEBUG] [.o.b.mios.internal.MiosBinding] - MiosBinding activate() 2016-02-22 21:54:22.974 [TRACE] [.o.b.mios.internal.MiosBinding] - MiosBinding updated() 2016-02-22 21:54:22.975 [DEBUG] [.o.b.mios.internal.MiosBinding] - updated: Created Unit 'house' 2016-02-22 21:54:22.976 [DEBUG] [.o.b.mios.internal.MiosBinding] - registerAllWatches: start

According to the mios binding page you should get something like this

2015-01-18 16:37:18.971 [DEBUG] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: BOUND {mios="unit:vera,device:1/service/urn:micasaverde-com:serviceId:ZWaveNetwork1/Role"}, value=Master SIS:NO PRI:YES, bound 1 time(s) 2015-01-18 16:37:18.971 [TRACE] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: NOT BOUND {mios="unit:vera,device:1/service/urn:micasaverde-com:serviceId:ZWaveNetwork1/LastDongleBackup"}, value=2015-01-14T23:30:57 2015-01-18 16:37:18.971 [TRACE] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: NOT BOUND {mios="unit:vera,device:1/service/urn:micasaverde-com:serviceId:ZWaveNetwork1/LastError"}, value=Poll failed 2015-01-18 16:37:18.971 [TRACE] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: NOT BOUND {mios="unit:vera,device:1/service/urn:micasaverde-com:serviceId:ZWaveNetwork1/LastHeal"}, value=2015-01-14T05:16:26 2015-01-18 16:37:18.971 [TRACE] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: NOT BOUND {mios="unit:vera,device:1/service/urn:micasaverde-com:serviceId:ZWaveNetwork1/LastRouteFailure"}, value=2015-01-14T04:11:33

I’m not sure why the binding isn’t working.

It looks like there’s no Items file to kick the ball of, or we can’t correctly “see” the Items file.

The MiOS Item Generator would have extracted/built the file, and that’ll need to be manually moved into place as:

configurations/items/<yourChoice>.items

In my case, this is called house.items, but you can use any filename you want. It should be loaded correctly as long as it ends in .items (plural), and is in the configurations/items directory.

Can you confirm it’s in-place?

Yes I ran the MiOs item generator and it built a file called house.items that I put inside the items folder.

2016-02-23 11:27:08.284 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been started (v1.8.0). 2016-02-23 11:27:09.228 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - mDNS service has been started 2016-02-23 11:27:09.291 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - Service Discovery initialization completed. 2016-02-23 11:27:10.964 [INFO ] [penhab.io.rest.RESTApplication] - Started REST API at /rest 2016-02-23 11:27:18.834 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'default.sitemap' 2016-02-23 11:27:18.938 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.sitemap' 2016-02-23 11:27:18.978 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'Home.sitemap' 2016-02-23 11:27:18.985 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'mios.sitemap' 2016-02-23 11:27:18.990 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'steph.sitemap' 2016-02-23 11:27:19.015 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.items' 2016-02-23 11:27:19.067 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'Home.items' 2016-02-23 11:27:19.124 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'house.items' 2016-02-23 11:27:19.824 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Classic UI at /classicui/openhab.app 2016-02-23 11:27:23.465 [INFO ] [.service.AbstractActiveService] - DSC Alarm Monitor Service has been started 2016-02-23 11:27:23.513 [INFO ] [.p.internal.PanasonicTVBinding] - TV registered 'livingroom_tv' with IP '192.168.2.25' 2016-02-23 11:27:29.323 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'default.rules'

Is what I get from the openhab log when I start the runtime. The other two bindings that I’ve tried are the DSC binding and panasonic binding. They both work fine without a problem. I haven’t setup persistence yet but I that shouldn’t be necessary for the binding to work correct?

Does it matter that I’m using a Vera Edge Ui7 with the latest firmware? It seems like most people like the older hardware and UI

Yours looks like this:

and mine looks more like:

19:44:57.035 DEBUG o.o.b.m.internal.MiosActivator[:36]- MiOS binding has been started
19:44:57.044 DEBUG o.o.b.m.i.MiosBindingProviderImpl[:92]- setItemRegistry: called
19:44:57.059 DEBUG o.o.b.m.i.c.MiosBindingConfig[:191]- Successfully loaded UPnP Service Aliases from 'org/openhab/binding/mios/internal/config/ServiceAliases.properties', entries '133'
19:44:57.064 DEBUG o.o.b.m.i.c.MiosBindingConfig[:208]- Successfully loaded Device Parameter defaults from 'org/openhab/binding/mios/internal/config/DeviceDefaults.properties', entries '23'
19:44:57.068 DEBUG o.o.b.m.i.MiosBindingProviderImpl[:139]- processBindingConfiguration: Adding Item 'ZWaveId' Binding 'unit:house,device:1/id', from 'house.items'
...<continued for each MiOS bound Item>
19:44:59.275 DEBUG o.o.b.m.internal.MiosBinding[:144]- allBindingsChanged: start provider 'org.openhab.binding.mios.internal.MiosBindingProviderImpl@29f3eb'
19:44:59.293 DEBUG o.o.b.m.internal.MiosBinding[:172]- registerWatch: start miosProvider 'org.openhab.binding.mios.internal.MiosBindingProviderImpl@29f3eb', itemName 'ZWaveId'
...<continued for each MiOS bound Item>
19:45:00.250 DEBUG o.o.b.m.internal.MiosBinding[:106]- MiosBinding activate()
19:45:00.259 DEBUG o.o.b.m.internal.MiosBinding[:380]- updated: Created Unit 'house'
19:45:00.260 DEBUG o.o.b.m.internal.MiosBinding[:156]- registerAllWatches: start
19:45:00.261 DEBUG o.o.b.m.internal.MiosBinding[:159]- registerAllWatches: provider 'class org.openhab.binding.mios.internal.MiosBindingProviderImpl'
19:45:00.263 DEBUG o.o.b.m.internal.MiosBinding[:172]- registerWatch: start miosProvider 'org.openhab.binding.mios.internal.MiosBindingProviderImpl@29f3eb', itemName 'GarageDeadboltDeviceStatus'
19:45:00.264 DEBUG o.o.b.m.internal.MiosBinding[:232]- Creating new MiosConnector for 'house' on 192.168.5.209
19:45:00.274 DEBUG o.o.b.m.i.MiosUnitConnector[:105]- Constructor: unit 'org.openhab.binding.mios.internal.MiosUnit@270ff', binding 'org.openhab.binding.mios.internal.MiosBinding@179b65c'

Can you PM me a copy of your house.items file, or a link to it?

The only time I’ve seen it behave like this is when there was a syntax error in the file (where-upon, it silently skips the rest of the file!).

It’s possible that there’s either a mistake in my MiOS Item Generator code, or there’s a special character (eg. i18n) that I’m not handling correctly.

I can run it up in my machine to ensure it’s syntax is correct (and no Windows BOM chars etc). Still odd that you’re not getting the setItemRegistry call either.

Separately, are there any lines with ERROR in them in logs/openhab.log?

I tried installing a fresh version of openhab to see if that changed anything. Nothing changed. Although I did find one error in the items file. One of my vera scenes has a “” in it and that caused an error. However I deleted it and still didn’t work.

I think my problem may be in the configuration file. I tried changing the ip that I put for the mios to the wrong ip to see if I get an error and I still didn’t get any errors. It seems like it’s not reading my config file. The weird thing is my other bindings work fine.

[CODE] #mqtt:.lwt=

#######################################################################################

Binding configurations

#######################################################################################

mios:house.host=192.168.2.22

################################ KNX Binding ##########################################

KNX gateway IP address

(optional, if serialPort or connection type ‘ROUTER’ is specified)

#knx:ip= [/CODE]

That’s a copy of what my config file looks like.

Also, to answer your question there aren’t any lines with errors in them in the log file

Thanks for the config file you provided via PM, it helped a lot.

I did a clean-slate install on an new Ubuntu 15.x VM, using the apt-get instructions from here:

and then I installed the MiOS Binding from the same Bintray, using:

apt-get install openhab-addon-binding-mios

and copied over your house.items file, and inserted the openhab.cfg entry for mios:house.host=192.168.x.x and it came up completely. Of course, I don’t have your specific combo on my Vera, so the Binding is moaning a little about some of those mismatches.

At this point, I have two theories that could cause the issue you’re seeing in your environment:

  1. A Problem in the 1.8.0 version that’s been fixed in the 1.8.1 version that’s now on Bintray
  2. Some sort of mismatch in the Oracle JDK Version being used.

We’ve definitely seen issues with (2), when folks have used the OpenJDK (or similar variants) so it’s possible that’s the key. I have this version of Oracle’s Java running on the Ubuntu VM (its very similar to what I’m running on my ODroid also):

java version "1.8.0_72"
Java(TM) SE Runtime Environment (build 1.8.0_72-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode)

Can you validate your JVM environment?

That’s the version of Java that I’m running.

I’m running things off of OS X 10.11.3 right now and I was going to transfer the config files over to a raspberry pi when I had everything running how I wanted it to run. I may go ahead and get the raspberry pi configured and see if that makes a difference since it will be in a different environment.

Thanks again for all of your help.

Double check, from the command line/Terminal, that java -version Is also reporting the same version… Or the version used by start.sh is the same (if there are any shell overrides to older versions)

My main machine is a Mac, and I’ve seen cases where different versions are installed/used, depending upon how things are launched.

Apart from that, the only significant other difference would be the 1.8.1 version, which I sourced from the standard bintray repo.

Other than that I’m a little stumped.

Wow! I feel like an idiot. I’m away from my computer but before I left checked and my runtime was version 1.6. When I get home I’ll update…

It never even crossed my mind that the developer version of Java was different.

1 Like

Great stuff! I’m just glad we got to the bottom of it. Thanks for sticking in there with me during the diag.

1 Like

It works! Thanks again for all of your help. I’m sure I’ll be asking more questions later.

1 Like