Different behaviour of items from items-file and those created by using an UI

Short summary:

An item A on Thing T (that is definied within an items file) was not receiving updates. Then I defined a second item B on thing T using Paper-UI or Habmin (I tried both) with the result that A is getting updates. When I delete item B, item A is not getting updates anymore. This behaviour is reproducable! For details: read on.

Since the topic changed a bit, I decided to create a new topic instead of adding this new information to the other thread so that other community members who have the same problem become aware of this thread.

  • Platform information:
    • Hardware: Raspberry Pi 3 Model B Rev 1.2
    • OS: openHABian / Raspbian GNU/Linux 8 (jessie)
    • Java Runtime Environment: openjdk version “1.8.0_152”
    • openHAB version: 2.5.0~S1479-1 (Build #1479)
    • binding-zwave: 2.5.0.SNAPSHOT

Detailed description:

As stated in my last posted topic ([SOLVED] Some Z-Wave battery devices are not updating battery level) I had a problem with items that were not being updated. While I tried to get to the bottom of the problem with the support of the community members @chris, @HomeAutomation and @mstormi (see that thread), I recognized that a part of the solution was found by adding a new item by using Paper-UI or Habmin beside the existent ones I defined within an items file (see my last comment in that thread: [SOLVED] Some Z-Wave battery devices are not updating battery level). The strange thing is that the item that was defined within the items file is then getting updates - as long as the new item (created within the UI) is existent. As soon as I delete that new item, the old one is not getting updates anymore. So it looks as if the new item makes the old one working as long as it exists.

My configuration:

items file:

Number   klingelsensor_batterylevel        "Klingelsensor/Batterie [%s %%]"      <battery>      { channel="zwave:device:71a23be9:node14:battery-level" }
Contact  doorbell                          "Klingel betätigt"                    <contact>      { channel="zwave:device:71a23be9:node14:sensor_door" }
DateTime klingelsensor_batterylevel_update "Klingelsensor-Batterie / Letzte Akt.: [%1$td.%1$tm.%1$tY, %1$tH:%1$tM Uhr]" <time>

rules file:

rule "Klingelsensor Battery-Level updated"
when Item klingelsensor_batterylevel received update
     val lastUpdate = klingelsensor_batterylevel_update.state
     klingelsensor_batterylevel_update.postUpdate( new DateTimeType() )
     logInfo("Rules", "Klingelsensor last update timestamp updated. Previous value: " + lastUpdate.toString )

Here’s my test:

As long as the “UI”-item exists, the items-file item works fine as you can see from the rules log file:

2019-01-15 11:44:54.210 [INFO ] [eclipse.smarthome.model.script.Rules] - Klingelsensor last update timestamp updated. Previous value: 2019-01-15T00:00:28.408+0100
2019-01-15 17:36:52.102 [INFO ] [eclipse.smarthome.model.script.Rules] - Klingelsensor last update timestamp updated. Previous value: 2019-01-15T11:44:54.200+0100
2019-01-15 23:28:56.693 [INFO ] [eclipse.smarthome.model.script.Rules] - Klingelsensor last update timestamp updated. Previous value: 2019-01-15T17:36:52.093+0100
2019-01-16 11:15:06.337 [INFO ] [eclipse.smarthome.model.script.Rules] - Klingelsensor last update timestamp updated. Previous value: 2019-01-15T23:28:56.684+0100

Then I deleted the item that I created within the UI on 2019-01-16 14:09:51.853. From then on, no updates are received (no entries and no exceptions in the log file!)

On 2019-01-19 I created a new item beside the existent one again by using the UI.

2019-01-19 09:58:56.877 [INFO ] [eclipse.smarthome.model.script.Rules] - Klingelsensor last update timestamp updated. Previous value: 2019-01-16T11:15:06.325+0100
2019-01-19 15:50:45.229 [INFO ] [eclipse.smarthome.model.script.Rules] - Klingelsensor last update timestamp updated. Previous value: 2019-01-19T09:58:56.858+0100
2019-01-19 21:45:54.094 [INFO ] [eclipse.smarthome.model.script.Rules] - Klingelsensor last update timestamp updated. Previous value: 2019-01-19T15:50:45.211+0100
2019-01-20 03:38:16.427 [INFO ] [eclipse.smarthome.model.script.Rules] - Klingelsensor last update timestamp updated. Previous value: 2019-01-19T21:45:54.079+0100

As you can see, the updates are incoming again. With the first update you can see that nothing happened between since it’s referencing the last action on the 16th of January.

During that test, I did not change anything else within the configuration! And there were no exceptions in the logfile!

I wouldn’t put my hand on the fire for that, but I don’t think I’ve configured anything wrong here. Instead, I’m assuming a bug.

Are there other users who have recognized a similar behaviour? Should I file a bug for this or did I make something wrong?

Thank you in advance for your support!

You say A was not receiving updates right in the beginning so it probably never was defined correctly.
Either way, your problem is you’re mixing files and UI to define items. DON’T.
Only use files as recommended here. Or use any UI for ALL items, but never mix. Mixing is not supported.

I am completely on your side, @mstormi, but it seems you misunderstood my description: It did NOT work correctly as long as I did the configuration only in files. While trying to get to the bottom of the problem, I configured a second/duplicate item on base of the same thing/channel in the UI and with this change, the original (that means: file based) item started to work correctly (and I did not applying any changes to this item!). Therefore the configuration within the items file seems to be correct. Additionally this behaviour is completely reproducable: when the duplicated item exists, the original item works fine (thus: receiving updates over the configured channel), when not, it is not updated!

@Kai: should I file a bug for this topic?

You need to be more specific what items you’re talking about. Because the way I read it is: You duplicated item klingelsensor_batterylevel in the ui and then item klingelsensor_batterylevel_update started to get updates (via the rule). Which make sense and could very well be expected behavior if the channel in item klingelsensor_batterylevel is not correct in some way. In that case the item in the file would never get an update and therefore never trigger the rule. Therefore can you double check or tell more about the specific items and/or thing configurations you made in files and UI.