New Jeelink Openhab2 Binding

Jeelink Binding not working anymore with OpenHAB2 because of change BridgeHandler interface

I updated to the latest OpenHAB2 distribution snapshot which incorporated the new folder structure out-of-the-box without me tuning the paths to the new locations. I could install it from the local apt-repo and start without problems.

Only the openhab-binding-jeelink addons won’t install anymore. There’s a change in the interface BridgeHandler of the main code. If I try to compile the openhab-binding-jeelink I get an error:

[ERROR] public void bridgeHandlerDisposed(ThingHandler thingHandler, Bridge bridge) {
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The method bridgeHandlerDisposed(ThingHandler, Bridge) of type JeeLinkSensorHandler<R> must override or implement a supertype method
[ERROR] 1 problem (1 error)

I’m sure it’s not a big deal to get it working again, but I just can’t to promise that I have the time to fix it myself, so I just give hereby a notice of the problem.

Greetings,

Greenoid

I have updated the binding, it does now only work with a current snapshot of openhab2.

Jeelink binding is now working again with the current snapshot of openhab2.
Thanks for your fast fix.

Do you have an example for textual configuration of the jeelink bindings of LaCrosse sensors?
I have my old openHAB v1 setup, but I’m new to the configuration of openHAB v2.
Perhaps with rrd4j persitences?

I am not so sure what you mean, because I have never used openhab1. I have an items file containing

Number Humidity_WZ "Wohnzimmer" <humidity> (gLaCrosse, gLaCrosseHumChart) {channel="jeelink:lacrosse:1475927280866:humidity"}
Number Temperature_WZ "Wohnzimmer" <temperature> (gLaCrosse, gLaCrosseTempChart) {channel="jeelink:lacrosse:1475927280866:temperature"}
Contact Battery_Low_WZ "Batterie Leer WZ" (gLaCrosse) {channel="jeelink:lacrosse:1475927280866:batteryLow"}
String TempHum_WZ "Wohnzimmer [%s]" <temperature> (gLaCrosse)

and a rules file

import java.util.Date

var lastEmailWZTime = -1L

rule "WZSensor"
when
   Item Temperature_WZ received update or
   Item Humidty_WZ received update or
   Item Battery_Low_WZ received update
then
      var newVal = Temperature_WZ.state.toString + " °C / " + Humidity_WZ.state.toString + "%"
      if (Battery_Low_WZ.state == OpenClosedType.CLOSED) {
      	 newVal = newVal + " ↯"
      	 
      	 if (lastEmailWZTime == -1L || new Date().time - lastEmailWZTime > 360000 * 24) {
            sendMail("<recipient>", "Batterie schwach", "Batterie des Temperatur Sensors im Wohnzimmer ist schwach!")
            lastEmailWZTime = new Date().time
      	 }
      }
      
      logDebug("jeelink", "Setze TempHum_WZ: " + newVal)
      postUpdate(TempHum_WZ, newVal)
end

and a sitemap file containing

Text item=TempHum_WZ valuecolor=[Battery_Low_WZ==ON="orange"]

This should effectively create a text item with a combined temp/humidity value that additionally has an indicator for low battery. When the low battery flag is set, it sends an email every 24h alerting me to change the battery. I will see if it works as soon as the first battery is empty. :wink:

I am not sure if this is the preferred way to do this (and if this is what you meant), as my Openhab2 knowledge is very limited. I started with openhab a week before I wrote the binding and do not spend much time on this.

I have not yet had the time to look into rrd4j, I still use MySql persistence as I already had the server running and still have some rusty sql knowledge.

1 Like

The Jeelink binding only works after installing the openhab-transport-serial feature.
The way proposed is to load it through the OSGI console:
feature:install openhab-transport-serial
Since OSGI is all about modules and dependency declaration and managemenrt, is there a configuration based way to load the openhab-transport-serial feature?
Could for example the Jeelink binding declare a dependency to openhab-transport-serial and the container would load it automatically?
It would make the life easier for ‘normal’ users and prevent many questions or bug reports.

Thanks for your configuration advice.

It looks like dependencies on other features can only be specified in feature.xml (which is not part of the binding itself, but of the addons repo). I have added it there, but as I have understood things, this will only be taken into account once the binding is part of the official distribution (and is installed from there).
In case I am wrong, please point me into the correct direction and I will add the dependency.

Hi,

I installed openhab2 beta4, openhab-transport-serial and the current binding jar on a Raspi 3 with rasbian. After adding (manually) my new JeeLink v3c I got this error:

Status: UNINITIALIZED - HANDLER_REGISTERING_ERROR
Created handler of bridge ’ jeelink:jeelink:75c9abfb’ must implement the BridgeHandler interface.

Any ideas what I can do or check?

Thanks in advance

As I wrote a few posts above, the current version of the binding only works with a current snapshot of openhab2. If you still use beta 4, you have to use the jar file from Oct 30th. This should still be downloadable from github.

Thank you for your quick reply.

I tried the jar file from 30 October with the same result. My installed version of openhab is: opemhab2-online/now 2.0.0-20161129184738. The JeeLink is the newest version, bought last week (JeeLink v3c RFM69cw).

I’m new to openhab, are there any log files I can check for further information about the error?

Your version seems to be a snapshot version from a few days ago. This should be compatible with the newest version of the binding, unless openhab code has changed again. It did change around Nov 10, which is why I had to update the binding. I uploaded the adapted version on Nov 21. Did you by chance download the binding before then?

Can you please connect to the OpenHAB console und type in the command bundle:list. This should produce (among others) a line showing the binding version. It should look like this:
229 | Active | 80 | 2.0.0.201610111616 | JeeLink Binding

Hi,

My sensor is an TFA 30.3187.IT. It don’t get discoverd by the jeelink binding. I still receive packets via serial monitor which look like this: OK 9 23 129 5 20 106

So, the Jeelink receiver works fine but it seems that my sensor has no ID. Is there any way to bind it to OpenHAB?

Thanks

The sensor id is 23, and the reading from the serial port looks like it should be recognized by the binding. Did the discovery find the jeelink (as long as the jeelink is not configured, no sensors will be found)? If not, have you installed openhab-transport-serial?

Otherwise use the OpenHAB console and enable debug logging for the binding by typing log:set DEBUG org.openhab.binding.jeelink. Start the discovery again and paste the relevant part of the log.

After some more testing I got it working.

Actually I set the jeelink binding up and configured it to connect via TCP. It went online but discovery did not work. Next I tried to connect it locally via serial:///dev/ttyUSB0. Discovery was still not working.

After that I tried to use openhab2-offline instead of the online package and confiugred it the same way as before. Suddenly the discovery works for local and TCP connections now.

I don’t know where is difference. If I have some time I will try it again with the online package.

One additional question: Is it possible to deactivate the upper and lower temperature limit?

Thank you anyway!

Deactivation of the limit is not possible, you have to set the limits to values outside of the temperature range of the sensor, e.g. -100 and +100.

Hi there!

Is the binding working with the latest openHAB version? I can not get it to work :frowning:

I installed the openhabian image (openHAB 2.0.0~20161216033235 (Build #644)) and want to connect my Intertechno TX29DTH-IT (La Crosse) sensors to it.

I copied the JAR file (https://github.com/vbier/openhab2-addons/blob/jeelink/addons/binding/org.openhab.binding.jeelink/org.openhab.binding.jeelink-2.0.0-SNAPSHOT.jar) in /usr/share/openhab2/addons

And also installed the openhab transport-serial feature by typing:
feature:install openhab-transport-serial

But bundle:list does not show any jeelink binding and also paperUI does not show the jeelink binding.

My /usr/share/openhab2/addons looks like this:

drwxrwxr-x 2 openhab openhab  4096 Dec 16 23:56 .
drwxr-xr-x 5 openhab openhab  4096 Dec 16 21:59 ..
-rw-r--r-- 1 root    root    38757 Dec 16 23:55 org.openhab.binding.jeelink-2.0.0-SNAPSHOT.jar
-rw-rw-r-- 1 openhab openhab    70 Dec 16 03:40 README

The log-file /var/log/openhab2/openhab.log shows me this:

org.apache.karaf.shell.support.MultiException: Error installing bundles:
	Unable to install bundle org.openhab.binding.jeelink
	at org.apache.karaf.shell.support.MultiException.throwIf(MultiException.java:61)
	at org.apache.karaf.bundle.command.Install.execute(Install.java:116)[39:org.apache.karaf.bundle.core:4.0.4]
	at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[54:org.apache.karaf.shell.core:4.0.4]
	at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:270)[54:org.apache.karaf.shell.core:4.0.4]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: java.lang.Exception: Unable to install bundle org.openhab.binding.jeelink
	at org.apache.karaf.bundle.command.Install.execute(Install.java:79)[39:org.apache.karaf.bundle.core:4.0.4]
	... 11 more
Caused by: org.osgi.framework.BundleException: Error reading bundle content.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.installBundle(BundleContextImpl.java:149)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
	at org.apache.karaf.bundle.command.Install.execute(Install.java:77)[39:org.apache.karaf.bundle.core:4.0.4]
	... 11 more
Caused by: java.net.MalformedURLException: no protocol: org.openhab.binding.jeelink
	at java.net.URL.<init>(URL.java:593)[:1.8.0_111]
	at java.net.URL.<init>(URL.java:490)[:1.8.0_111]
	at java.net.URL.<init>(URL.java:439)[:1.8.0_111]
	at org.eclipse.osgi.storage.Storage.createURL(Storage.java:459)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
	at org.eclipse.osgi.storage.Storage.getContentConnection(Storage.java:439)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
	at org.eclipse.osgi.storage.Storage.getContentConnection(Storage.java:415)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.installBundle(BundleContextImpl.java:145)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
	... 12 more

Can you help me to make this binding work?

Thx! Duffy6

Looks like the jar is not completely downloaded. It should be around 60k:
-rw-rw-r-- 1 volla volla 61754 Dez 17 16:23 org.openhab.binding.jeelink-2.0.0-SNAPSHOT.jar

Thank you so much! That did the trick!
But I still can not find any sensors (things).

When I try to scan for things with the “Jeelink USB Receiver LaCrosseITPlusReader” nothing is found.

But the sensors were working in FHEM …

Can someone help me out of this!

Regards
duffy6

Please use the OpenHAB console and enable debug logging for the binding by typing
log:set DEBUG org.openhab.binding.jeelink
Then start the discovery again and paste the relevant part of the log.

Hi!

This is relevant part of the log:

2016-12-18 11:42:31.297 [INFO ] [nk.discovery.JeeLinkDiscoveryService] - Stopping discovery of JeeLink USB Receivers...
2016-12-18 11:42:31.306 [INFO ] [nk.discovery.JeeLinkDiscoveryService] - Stopped discovery of JeeLink USB Receivers.
2016-12-18 11:42:31.316 [INFO ] [nk.discovery.JeeLinkDiscoveryService] - Starting discovery of JeeLink USB receivers...
2016-12-18 11:42:31.325 [DEBUG] [nk.discovery.JeeLinkDiscoveryService] - Iterating ports...
2016-12-18 11:42:31.427 [INFO ] [nk.discovery.JeeLinkDiscoveryService] - Closing all open ports...
2016-12-18 11:43:01.316 [INFO ] [nk.discovery.JeeLinkDiscoveryService] - Stopping discovery of JeeLink USB Receivers...
2016-12-18 11:43:01.329 [INFO ] [nk.discovery.JeeLinkDiscoveryService] - Stopped discovery of JeeLink USB Receivers.

Does this help? Isthe “LaCrosseITPlusReader.Gateway” right binding for my “Intertechno TX29DTH-IT (La Crosse)”?