[SOLVED] Jeelink: strange behavior

I am running OH 2.2 with a Jeelink USB and two sensors, TX 29 DTH, recognized as LaCrosse Temperature sensors. I have had them working, but now I want to tinker with the update interval and the buffersize. When I do, the readings starts to switch between an old reading and new ones. From the even log:
2018-01-03 20:07:06.439 [vent.ItemStateChangedEvent] - Temperature_LR61 changed from 17.8 to 22.9
2018-01-03 20:08:01.358 [vent.ItemStateChangedEvent] - Temperature_LR61 changed from 22.9 to 17.8
2018-01-03 20:08:09.112 [vent.ItemStateChangedEvent] - Temperature_LR61 changed from 17.8 to 22.9
2018-01-03 20:09:01.369 [vent.ItemStateChangedEvent] - Temperature_LR61 changed from 22.9 to 17.8
2018-01-03 20:09:02.841 [vent.ItemStateChangedEvent] - Temperature_LR61 changed from 17.8 to 22.9

The 17.8 is the reading on the device. It doesn’t matter if I set the configuration back, the switching behavior continues.

Also, for one of my sensors when I reset it by taking out the batteries it changes ID, which means the Thing I have added goes offline, and a new device appears in the Inbox if I search for it. But this does not happen for my other sensor.

Does anybody else experience this kind of behavior?

The configuration, is that done to the sensors themselves or are they passive devices in the sense that they can only send data and not receive any?

Sensors will just look for an unused ID when batteries are inserted, and then take that. AFAIK, there is no way to configure the sensors from outside.
I have not yet changed batteries, but I would expect that your described behavior can happen and is nothing to worry about.

Regarding the readings, can you enable trace logging for the binding and paste a part of the log that contains toggling temperatures? From which config values (buffer size, update interval) have you changed to which to get the problem?

I have changed Update Interval to 5 and Buffer Size to 0. I tinkered a little so it was not straight from default. That produced the following TRACE:

2018-01-04 18:58:52.286 [TRACE] [.LaCrosseTemperatureReadingConverter] - Creating reading from: OK 9 56 129 5 58 38
2018-01-04 18:58:52.294 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=33.8 (33.8), humidity=38, batteryNew=true, batteryLow=false
2018-01-04 18:58:52.610 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=22.2 (22.215014), humidity=54, batteryNew=true, batteryLow=false
2018-01-04 18:58:53.656 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 9 12 1 4 154 64
2018-01-04 18:58:53.657 [TRACE] [.LaCrosseTemperatureReadingConverter] - Creating reading from: OK 9 12 1 4 154 64
2018-01-04 18:58:53.659 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=17.8 (17.8), humidity=64, batteryNew=false, batteryLow=false
2018-01-04 18:58:55.071 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=17.8 (17.800001), humidity=64, batteryNew=false, batteryLow=false
2018-01-04 18:58:56.724 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 9 56 129 5 58 38
2018-01-04 18:58:56.727 [TRACE] [.LaCrosseTemperatureReadingConverter] - Creating reading from: OK 9 56 129 5 58 38
2018-01-04 18:58:56.730 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=33.8 (33.8), humidity=38, batteryNew=true, batteryLow=false
2018-01-04 18:58:57.231 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=17.8 (17.8), humidity=64, batteryNew=false, batteryLow=false
2018-01-04 18:58:57.619 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=22.2 (22.215014), humidity=54, batteryNew=true, batteryLow=false
2018-01-04 18:59:00.083 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=17.8 (17.800001), humidity=64, batteryNew=false, batteryLow=false
2018-01-04 18:59:01.152 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 9 56 129 5 59 38
2018-01-04 18:59:01.155 [TRACE] [.LaCrosseTemperatureReadingConverter] - Creating reading from: OK 9 56 129 5 59 38
2018-01-04 18:59:01.160 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=33.9 (33.9), humidity=38, batteryNew=true, batteryLow=false
2018-01-04 18:59:01.274 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=22.9 (22.91499), humidity=53, batteryNew=true, batteryLow=false
2018-01-04 18:59:01.840 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 9 12 1 4 154 64
2018-01-04 18:59:01.841 [TRACE] [.LaCrosseTemperatureReadingConverter] - Creating reading from: OK 9 12 1 4 154 64
2018-01-04 18:59:01.843 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=17.8 (17.8), humidity=64, batteryNew=false, batteryLow=false
2018-01-04 18:59:02.243 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=17.8 (17.8), humidity=64, batteryNew=false, batteryLow=false
2018-01-04 18:59:02.625 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=22.2 (22.215014), humidity=54, batteryNew=true, batteryLow=false
2018-01-04 18:59:05.098 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=17.8 (17.800001), humidity=64, batteryNew=false, batteryLow=false
2018-01-04 18:59:05.595 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 9 56 129 5 59 37
2018-01-04 18:59:05.598 [TRACE] [.LaCrosseTemperatureReadingConverter] - Creating reading from: OK 9 56 129 5 59 37
2018-01-04 18:59:05.601 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=33.9 (33.9), humidity=37, batteryNew=true, batteryLow=false
2018-01-04 18:59:07.255 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=17.8 (17.8), humidity=64, batteryNew=false, batteryLow=false
2018-01-04 18:59:07.635 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=22.2 (22.215014), humidity=54, batteryNew=true, batteryLow=false

I changed configuration on both of my sensors, but it is most obvious for sensor ID 56, since I placed it on top of my heater afterwards.
As a side note I am not allowed to set Update Interval to 0, which should enable live mode.

The fact that you can not set the update interval to 0 is a bug in the binding. I will fix that.

That you get the alternating values seems to be a problem with left-over resources when the thing configuration is changed. It looks like the old handler is still in memory, i will have to investigate this.

I have found the bug and created a pull request:

Just as a side note: having an update interval with a buffer size of 0 does not make much sense. I have also updated the configuration description to show that.

Edit: unfortunately, the addons build is currently broken. Once it is fixed, you should be able to get an updated binding from here:
https://openhab.jfrog.io/openhab/libs-snapshot/org/openhab/binding/org.openhab.binding.jeelink/2.3.0-SNAPSHOT/

This has to be at least from today to contain the fix.

Wow, that was fast. Very nice. I will be keeping an eye out for a new build. Thank you very much for your help.

For a future update: As the ID is dynamic, I think it would be better not to have it part of the thing name that is used to link to items (jeelink:lacrosse:56). I couldn’t find a way to change it, so I’m guessing the name is created when discovered.

You can leave the name as is and simply adapt the channel in the thing configuration.

So when your sensor gets a new id, discover it and note the channel from the new thing id. Delete the sensor from the inbox, adapt the channel of your offline sensor and you are ready to go.

Yes, I did that already. It was more of a user friendliness thing to not confuse sensors which is named with one ID but actually has another. It is no big deal.

I found a new build from late last night. I am running that now and everything works so again thank you very much.

I have one more question. I have had a few abnormal values, even though my setting “Maximum allowed Temperature Difference” is set to default (2):
events.log:
2018-01-10 09:56:49.835 [vent.ItemStateChangedEvent] - Temperature_1 changed from 20.6 to -12.1

2018-01-10 09:56:58.796 [vent.ItemStateChangedEvent] - Temperature_1 changed from -12.1 to 20.6
openhab.log:
2018-01-10 09:56:49.809 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 9 56 129 3 111 234
2018-01-10 09:56:49.812 [TRACE] [.LaCrosseTemperatureReadingConverter] - Creating reading from: OK 9 56 129 3 111 234
2018-01-10 09:56:49.819 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=-12.1 (-12.1), humidity=106, batteryNew=true, batteryLow=true

2018-01-10 09:56:58.775 [TRACE] [connection.AbstractJeeLinkConnection] - Read line from port /dev/ttyUSB0: OK 9 56 1 4 182 47
2018-01-10 09:56:58.777 [TRACE] [.LaCrosseTemperatureReadingConverter] - Creating reading from: OK 9 56 1 4 182 47
2018-01-10 09:56:58.780 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (56): temp=20.6 (20.6), humidity=47, batteryNew=false, batteryLow=false

Is this because I have set it to “live” updates and a buffer size of 1?

I am afraid you found another bug. Shame on me.

Pull request has been created:

With these turn around times there is no issue at all, and then I can feel a bit useful too :slight_smile:

Thx again