New Jeelink Openhab2 Binding

Hello all
could somebody explain me how to perform a battery change on that sensors?
I just changed the battery, did a search in paperUI, deleted the new found thing and inserted the ID of that found thing in my already existing one.

Unfortunately, it seems that the internal ID stays the same, see this log entries:

'jeelink:lacrosse:236' changed from ONLINE to OFFLINE
2018-01-13 14:56:50.446 [home.event.InboxAddedEvent] - Discovery Result with UID 'jeelink:lacrosse:64' has been added.
==> /var/log/openhab2/openhab.log <==
2018-01-13 14:56:50.448 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'jeelink:lacrosse:64' to inbox.
==> /var/log/openhab2/events.log <==
2018-01-13 14:57:24.939 [me.event.InboxRemovedEvent] - Discovery Result with UID 'jeelink:lacrosse:64' has been removed.
2018-01-13 14:57:36.304 [me.event.ThingUpdatedEvent] - Thing 'jeelink:lacrosse:236' has been updated.
2018-01-13 14:57:36.313 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:236' changed from OFFLINE to UNKNOWN
2018-01-13 14:57:38.542 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:236' changed from UNKNOWN to ONLINE

The thing is still called jeelink:lacrosse:236
This is very confusing…

Furthermore it seems that the configured Update intervale does not work any more after the battery change.

The update intervale is set tu 60 seconds, but see the following log entries regarding this thing:

2018-01-13 15:03:10.486 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 49 to 41
2018-01-13 15:03:10.490 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from ON to OFF
2018-01-13 15:03:15.638 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 41 to 45
2018-01-13 15:03:36.423 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.4 to 21.5
2018-01-13 15:03:36.436 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 45 to 47
2018-01-13 15:03:36.447 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from OFF to ON
2018-01-13 15:04:02.116 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.5 to 21.6
2018-01-13 15:04:02.119 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 47 to 49
2018-01-13 15:04:10.482 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.6 to 21.4
2018-01-13 15:04:10.492 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from ON to OFF
2018-01-13 15:04:10.499 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 49 to 41
2018-01-13 15:04:15.603 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorBadezimmer_Luftfeuchtigkeit changed from 42 to 41
2018-01-13 15:04:15.671 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 41 to 45
2018-01-13 15:04:36.449 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 45 to 47
2018-01-13 15:04:36.454 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.4 to 21.5
2018-01-13 15:04:36.459 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from OFF to ON
2018-01-13 15:05:02.123 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.5 to 21.6
2018-01-13 15:05:02.125 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 47 to 49
2018-01-13 15:05:10.479 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.6 to 21.4
2018-01-13 15:05:10.488 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 49 to 41
2018-01-13 15:05:10.501 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from ON to OFF
2018-01-13 15:05:15.703 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 41 to 45
2018-01-13 15:05:36.471 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 45 to 47
2018-01-13 15:05:36.477 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from OFF to ON
2018-01-13 15:06:02.127 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.4 to 21.6
2018-01-13 15:06:02.132 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 47 to 49
2018-01-13 15:06:10.494 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.6 to 21.4
2018-01-13 15:06:10.499 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 49 to 41
2018-01-13 15:06:10.502 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from ON to OFF
2018-01-13 15:06:15.736 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 41 to 45
2018-01-13 15:06:36.489 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 45 to 47
2018-01-13 15:06:36.494 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from OFF to ON
2018-01-13 15:07:02.130 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.4 to 21.6
2018-01-13 15:07:02.133 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 47 to 49
2018-01-13 15:07:10.487 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Temperatur changed from 21.6 to 21.4
2018-01-13 15:07:10.500 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_Luftfeuchtigkeit changed from 49 to 41
2018-01-13 15:07:10.512 [vent.ItemStateChangedEvent] - LaCrosseTemperatureSensorWohnzimmer_BatteryNeu changed from ON to OFF

It looks like every status change is recognized by openhub.
I have some of these sensors but only this one is doing like this, since the first battery change.
Any hints are highly welcome.
Thank you in advance.

Matthias

The thing id does never change for an existing sensor, otherwise you would have to update all your item definitions every time you replace batteries, as these are linked to the thing ids.

Regarding the update interval, did you make any other configuration changes, e.g. buffer size?

Or you might be affected by a bug in the binding where values are published several times after configuration change. Does the problem persist if you restart openhab?

Otherwise enable trace logging and paste a part of your openhab.log showing a few updates.

Thank you for your fast reply, Volker.
In deed, a restart of openhab stopped it.
:slight_smile:

Thanks,
Matthias

You are welcome. The bug is already fixed in 2.3.0-snapshot. So if you want to avoid this problem in the future, you can upgrade the binding.

Use this one:
https://github.com/vbier/openhab2-addons/raw/jars/addons/binding/org.openhab.binding.jeelink/org.openhab.binding.jeelink-2.3.0-SNAPSHOT.jar

Hello!

Thanks for developing this awesome Binding! I am using the version (binding-jeelink - 2.2.0) of the jeelink binding since it has been released and i am experiencing a confusing behaviour.

I have 4 temperature sensors bound and everything works until i reboot the system.
After the reboot (or openhab service restart) the temperature, humidity, and battery new channel loose their channel links. But this happens only with one of those four sensors… the other remaining three seem to be unaffected by the channel link losses.

As a matter of fact that means for me that my temperature control is not working until i rellink the channels again through the paper ui (pretty easy to do - but you have to be aware about that problem - so its really annoying).

Release = Raspbian GNU/Linux 8 (jessie)
Kernel = Linux 4.9.35-v7+
Platform = Raspberry Pi 3 Model B Rev 1.2
openHAB 2.2.0-1 (Release Build)
binding-jeelink - 2.2.0
I use the simple Item Linking Mode
The openhab.log only mentions rule and sitemap errors. But those are subsequent faults of the lost channel links of this sensor.

Is it possible that this problem could be related to this? https://community.openhab.org/t/mysensors-binding-channel-names-disappearing-in-paperui-control-page-after-reboot/35706
There is a mention for a fix for binding developers --> I tried the workarounds, they are not working for me.

As you can see in the attached screenshot i have to relink the other channels. After that my rules and sitemaps work as they should again. This error is completely reproducible. It happens after each reboot!

Do you have an idea why this is happening? Is there a solution, a simple fix? Is it possible to make a rule to relink the channels after reboot?

With best regards and thanks in advance
Walter

Whether channels are linked or not is not part of the binding’s responsibility. This seems to be a bug in the openHAB code. I have used paper UI to link items only for a few days and then setup items files. Have you tried that?

The PCA301 code got merged into the 2.3 branch yesterday. :champagne:

I have another change in the pipeline that should make sure that the init commands are sent correctly.
Previously, the init commands have been sent when the first reading was received. This did obvioulsy not work if you needed an init command to change the datarate in order to receive readings.
Therefore I have now changed the code to send the init commands after the first reading has been received or a configurable timeout has occurred. The timeout is 15s by default and can be changed in the stick configuration.
Together with the changes that have been merged, this should now make LGWs work. I have destroyed some parts with my soldering iron in the process of building a LGW. But now that I got it working I have tested the binding code and everything looks good so far.
I have connected LaCrosse and PCA301 sensors and both are working fine.

It would be nice if some of you could test the updated binding before I create a pull request:
https://github.com/vbier/openhab2-addons/raw/jars/addons/binding/org.openhab.binding.jeelink/org.openhab.binding.jeelink-2.3.0-SNAPSHOT.jar

Hallo Volker,
nach meinem Umzug und gecrashtem NUC samt FHEM wollt ich das optisch viel ansprechende Openhab testen.
Einfache Sachen wie Hue, AVR, TV… laufen top.
Im FHEM hatte ich zwei Jeelinks, einer für meine PCA301 der andere für TFA Dostmann.
Beide liefen unter FHEM, muss da nun ein neuer Sketch drauf?
Hab eben deiner News bzgl. der PCA301 gelesen aber bekomm die einfach nicht zum laufen.

Gibt es etwas ähnliches wie das Wiki im FHEM für alle Aktoren für Openhab?
Sowas ist echt einfacher für Noobs.

Gruß Stefan

Step by step:

  • you download the jar, put it into the openHAB addons folder
  • you wait for the add-on to be shown in the paper UI
  • you make sure the serial device can be seen by openHAB (only if connected directly via usb)
  • you create a Jeelink thing manually in the paper UI inbox
  • you scan for sensors using the paper UI inbox
  • you create items file(s) linking the channels to items (if paper UI simple mode is disabled)
  • you see updates and can control things in the paper UI
  • you use a UI of your choice and use the items
  • you write a blog or wiki article on how you have set everything up and link it here for other noobs

Google the steps to get detailed information.
If this fails, write detailed information on what you have tried and what did not work as expected

  • I pluged in the pca301 flashed Jeelink attached to ttyUSB0
  • create the Jeelink in the paper ui inbox

2018-03-07 19:08:09.038 [hingStatusInfoChangedEvent] - ‘jeelink:jeelinkUsb:0ecb16f4’ changed from UNINITIALIZED to INITIALIZING

2018-03-07 19:08:09.048 [hingStatusInfoChangedEvent] - ‘jeelink:jeelinkUsb:0ecb16f4’ changed from INITIALIZING to ONLINE

But after scan nothing happens.
When I push the button on the pca301 device the Jeelink´s blue led flash´s, but nothin to see in the event log.

Ist the socket paired to the stick? Die you press the button while discovery was in progress?
It is essential that the stick receives a reading while discovery is running.
If that does not help, enable trace logging in the console and paste the relevant part (discovery with button press) of the openhab.log file.

Yes the socket was/is paired with the stick (from previous fhem setup).
Yes I pressed the button in discovery mode an the led flash´s

You meen this?

2018-03-07 20:18:48.050 [DEBUG] [elink.internal.JeeLinkHandlerFactory] - creating JeeLinkHandler for thing c57ae68a...
2018-03-07 20:18:48.052 [DEBUG] [elink.internal.JeeLinkHandlerFactory] - registering sensor discovery service...
2018-03-07 20:18:48.062 [DEBUG] [org.openhab.binding.jeelink         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=321, service.bundleid=188, service.scope=singleton} - org.openhab.binding.jeelink
2018-03-07 20:18:48.070 [DEBUG] [l.connection.JeeLinkSerialConnection] - Creating serial connection for port /dev/ttyUSB0 with baud rate 57600...
2018-03-07 20:18:48.071 [DEBUG] [l.connection.JeeLinkSerialConnection] - Opening serial connection to port /dev/ttyUSB0 with baud rate 57600...

.

Yes, but with trace logging enabled. Search this thread for instructions.

Looks good ,or?

2018-03-07 20:36:26.283 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 4 4 15 166 240 1 1 143 80 38
2018-03-07 20:36:33.991 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 5 4 5 64 11 1 5 255 216 240
2018-03-07 20:36:35.532 [DEBUG] [l.connection.JeeLinkSerialConnection] - Closing serial connection to port /dev/ttyUSB0...
2018-03-07 20:36:50.402 [DEBUG] [elink.internal.JeeLinkHandlerFactory] - creating JeeLinkHandler for thing 4f579379...
2018-03-07 20:36:50.405 [DEBUG] [elink.internal.JeeLinkHandlerFactory] - registering sensor discovery service...
2018-03-07 20:36:50.422 [DEBUG] [l.connection.JeeLinkSerialConnection] - Creating serial connection for port /dev/ttyUSB0 with baud rate 57600...
2018-03-07 20:36:50.423 [DEBUG] [l.connection.JeeLinkSerialConnection] - Opening serial connection to port /dev/ttyUSB0 with baud rate 57600...
2018-03-07 20:37:00.820 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 7 5 5 64 16 1 170 170 170 170
2018-03-07 20:37:01.444 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 7 4 5 64 16 0 0 0 0 0
2018-03-07 20:37:03.155 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 7 5 5 64 16 0 170 170 170 170

But no items

The log does not show that discovery has been started?

I deleted the stick and run it again

2018-03-07 20:59:24.664 [DEBUG] [l.connection.JeeLinkSerialConnection] - Closing serial connection to port /dev/ttyUSB0...
2018-03-07 20:59:24.758 [DEBUG] [org.openhab.binding.jeelink         ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=324, service.bundleid=188, service.scope=singleton} - org.openhab.binding.jeelink
2018-03-07 20:59:34.334 [DEBUG] [core.karaf.internal.FeatureInstaller] - Running scheduled sync job
2018-03-07 20:59:52.138 [DEBUG] [elink.internal.JeeLinkHandlerFactory] - creating JeeLinkHandler for thing 70432608...
2018-03-07 20:59:52.139 [DEBUG] [elink.internal.JeeLinkHandlerFactory] - registering sensor discovery service...
2018-03-07 20:59:52.143 [DEBUG] [org.openhab.binding.jeelink         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=325, service.bundleid=188, service.scope=singleton} - org.openhab.binding.jeelink
2018-03-07 20:59:52.160 [DEBUG] [l.connection.JeeLinkSerialConnection] - Creating serial connection for port /dev/ttyUSB0 with baud rate 57600...
2018-03-07 20:59:52.163 [DEBUG] [l.connection.JeeLinkSerialConnection] - Opening serial connection to port /dev/ttyUSB0 with baud rate 57600...
2018-03-07 20:59:52.492 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 8 4 5 86 62 1 2 131 68 76
2018-03-07 20:59:52.883 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 6 4 6 200 255 1 2 4 60 154
2018-03-07 20:59:53.075 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 7 4 5 64 16 1 0 0 0 0
2018-03-07 21:00:09.369 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 7 5 5 64 16 1 170 170 170 170
2018-03-07 21:00:09.977 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 7 4 5 64 16 0 0 0 0 0
2018-03-07 21:00:11.560 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 24 7 5 5 64 16 0 170 170 170 170

Did you start discovery for the jeelink binding in the inbox of the paper ui?

Inbox > JeeLink Binding > Search

Did you paste the wrong part of the log? A discovery should look like this:

2018-03-06 19:55:49.601 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery started for bridge jeelink:jeelinkUsb:4c6d16fd
2018-03-06 19:55:50.410 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 30
2018-03-06 19:55:54.151 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 58
2018-03-06 19:55:54.642 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 30
2018-03-06 19:55:57.894 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 38
2018-03-06 19:56:02.411 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found unknown sensor of type jeelink:pca301 with id 1-160-236
2018-03-06 19:56:02.445 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘jeelink:pca301:1-160-236’ to inbox.
2018-03-06 19:56:03.059 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 58
2018-03-06 19:56:06.487 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 38
2018-03-06 19:56:11.582 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 30
2018-03-06 19:56:11.963 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 58
2018-03-06 19:56:15.082 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery for bridge jeelink:jeelinkUsb:4c6d16fd found already known sensor id 38
2018-03-06 19:56:19.600 [DEBUG] [nal.discovery.SensorDiscoveryService] - discovery stopped for bridge jeelink:jeelinkUsb:4c6d16fd

It should at least contain the discovery started and stopped messages.