BasicUI not updating items after migration to Aeon zstick Gen5

Hi,

I have RaspberryPi2 with Aeon z-stick. I use OpenHabian, installed the latest testing 2.4.0 Milestone build. Recently I’ve migrate from S2 to Gen5. Initially I manage to add the new Gen5 into the network as secondary controller, but after some playing around with Zentools I managed to reset somehow the S2. So I’ve decided to start from scratch with Gen5. I added all the zwave things, but kept the existing sitemap with the items names inside. When adding the new things I’ve created items with same names as before. I have influxdb persistence that restores items on reboot

Items {
* : strategy = everyChange, everyHour, restoreOnStartup
}

So now I have this problem that sensor data items like Temperature, Humidity, Luminosity, Battery, etc are not updated on the UI. The place where it’s supposed to have the number stays blank. Only switches are updated. In the karaf console when I list the items everything looks good, data is there and items are updated.

I’ve cleaned the cache couple of times, restart the raspberry, openhab, but nothing helps. Interestingly when I create item with another name on a channel with already assigned item and I add the new item in BasicUI then I see the new item is getting the updates. So is there some kind of cache of BasicUI?

Any ideas …?

Edit
To summarize the root cause and the remedy:
Problem was that when deleting the old things not all old items were deleted. I did that using Habmin and it seemed that when you delete a thing all associated items get deleted also. Seems this is not the case.
Then I created new things and items with same name to preserve already defined sitemap. That created a mess in jsondb where items are stored. So at the end I had two items with same name pointing to different z-wave nodes. One item left orphaned for non existing thing and the other attached to a newly added thing. May be ESH reads jsondb sequentially and for some of the things it gets items that point to another (non existing) node resulting into no value shown/updated in BasicUI.

So remedy was to stop OH and delete all problematic items from userdata/jsondb/org.eclipse.smarthome.core.thing.link.ItemChannelLink file.

Did you delete your old items? I think you must have, since you wouldn’t be able to create new ones with the same names if you hadn’t. If you look at your new Things in Habmin or Paper UI, do they show as linked (blue circle with a white dot in the middle)?

Are all of your Things and Items managed (not in files)?

Since you updated to the M4, you now have the new Z-Wave binding, so maybe your channels have changed. Which version did you upgrade from?

I’ve deleted the old things and corresponding items were automatically deleted. Then I started adding new things on the Gen5 stick. Things are linked, just checked in PaperUI. As I mentoned in karaf console when I list items values are there

openhab> items list Kitchen*
KitchenWashingMachinePower (Type=NumberItem, State=0, Label=Консумирана мощност (W), Category=Energy)
KitchenCounterTop (Type=SwitchItem, State=OFF, Label=Countertop, Category=Light)
KitchenWashingMachineEnergy (Type=NumberItem, State=1.31, Label=Energy(KWh), Category=Energy)
KitchenTemperature1 (Type=NumberItem, State=23.1, Label=Temperature, Category=Temperature)
KitchenSensorBattery (Type=NumberItem, State=100.0, Label=Battery, Category=Battery)
KitchenTemperature (Type=NumberItem, State=23.1, Label=Temperature, Category=Temperature)
KitchenGasAlarm (Type=SwitchItem, State=NULL, Label=Gas alarm, Category=Door)
KitchenMotionAlarm (Type=SwitchItem, State=OFF, Label=motion sensor, Category=Motion)
KitchenWashingMachine (Type=SwitchItem, State=ON, Label=WMachine, Category=Switch)
KitchenIlluminance (Type=NumberItem, State=0.0, Label=Illuminance, Category=DimmableLight)
KitchenMainLight (Type=SwitchItem, State=OFF, Label=Main Light, Category=Light)
KitchenWashingMachineVoltage (Type=NumberItem, State=230.16, Label=Voltage (V), Category=Energy)
openhab>

Here I’ve added KitchenTemperature1 that is the same as KitchenTemperature, but as new item it started immidiately showing value on BasicUI

Everything apart the sitemap is in ESH. To upgrade to M4 (as you reffer to it) I used openhabian_config tool. I see that z-wave binding version is binding-zwave - 2.4.0.M3

OK, then you’re not on the latest, which includes a major Z-Wave binding update…

Strange! The items have the data, but Basic UI does not display some values. A newly created item linked to the same Thing displays properly. Clear browser cache? Which version of OH did you update from? Does the Paper UI> Control also have missing data?

I think that I’ve upgraded from last stable, that was 2.3.0. That was what openhabian brought. I’ve cleared the browser’s cache several times already.

That’s why I thought that BasicUI app could have something like local cache (server side) of the content it displays.

z-wave binding shouldn’t be a problem here, right? I mean karaf shows proper values, it’s just that the UI for some reason is not showing them. As if it thinks that they’re already up-to-date…
cheers,
Vladimir

Have you cleared the OH cache too? This should be done after a major update.

No, not if you have data. Looks to be a UI issue.

I’ve cleared the OH cache may be couple of times. Last it was this morning.

How I could debug such problem with the UI? Any idea.

First thing I’d do is look in the browser developer tools (usually f12). but doubt this would help. Maybe there are some errors in the logs? Since you’re already on a milestone build, try upgrading to the latest, just be aware of the Z-Wave binding changes. Maybe something was fixed?

This doesn’t sound right. When Things are deleted, the Links will be removed, but the Items should stay.

Hmm is it possible that old items were not deleted and I’ve created new ones with same names? And now on the UI are the old ones that are not attached to the new things? Quite weird scenario…but karaf should show me such doubling of items, if at all possible, right?

Is an item name unique…or they have something like UUID assigned that’s uniquie?

Yes, so if you don’t see them, then they must have been removed.

The item names are unique. The item labels do not need to be.

It’s the third time I’ve asked, but does the Paper UI> Control also have missing data?

Could you post the portion of your sitemap with these items? I’ve looked through the ESH issues and I didn’t spot anything close to what you’re experiencing, but you may want to take a look.

To be frank I’ve never paid attention to PaperUI > Control as it always was empty. I see now that I needed to wait like 10sec to see what it had to offer. everything is there, no missing data.

here it’s the items file

sitemap home label=“Home control”
{
Frame label=“corridor” {
Slider item=CorridorNewDimmer
Text item=CorridorMotionAlarm
Text item=CorridorTemperature
Text item=CorridorSensorBattery
Text item=CorridorIlluminance
}

    Frame label="kitchen" {
            Switch item=KitchenCounterTop
            Switch item=KitchenMainLight
            Text item=KitchenMotionAlarm
            Text item=KitchenTemperature1
            Text item=KitchenTemperature
            Text item=KitchenSensorBattery
            Text item=KitchenIlluminance
            Default item=KitchenGasAlarm
            Default item=FloodSensor
            Default item=FloodSensorBattery
            Text item=KitchenWashingMachine {
                    Default item=KitchenWashingMachine
                    Default item=KitchenWashingMachineVoltage
                    Default item=KitchenWashingMachineEnergy
                    Default item=KitchenWashingMachinePower
            }
    }


    Frame label="Bedroom" {
            Switch item=BedroomMainLight
            Switch item=BedroomSpot
            Switch item=BedroomCeilingR
            Switch item=BedroomArcR
            Switch item=BedroomCeiling
            Switch item=BedroomArc
            Switch item=BedroomAllLights
    }

    Frame label="living room" {
            Switch item=LivingRoomWall
            Switch item=LivingRoomEntrance
            Switch item=LivingRoomTVLight
            Text item=LivingRoomTV {
                    Default item=LivingRoomTV
                    Default item=LivingRoomTVVoltage
                    Default item=LivingRoomTVPower
                    Default item=LivingRoomTVEnergy
            }
    }

    Frame label="Bathroom" {
            Default item=BathroomTemperature
            Default item=BathroomHumidity
            Default item=BathroomBattery
    }

    Frame label="Temp inside" {
            Chart item=CorridorTemperature refresh=1800000 period=2D  service="influxdb"
    }

}

One more thing that I’ve just recalled. When I was adding the new things I had several occasions where I defined Items in Habmin, using the ‘+’ button available per channel. Then at some point I realized that some of the items were missing and I had to do the same action again. I did this for at least 6-7 items…but I thought it’s just buggy Habmin UI and moved on without investigating the issue.

what I mean is that I define the items for a Thing, then save it and then move on. Later I realize that some of the items that I already defined were missing…or some were doubled per channel. Really weird

Some of your items are missing their labels… maybe they are also the ones missing data? You don’t have labels in the sitemap, which is fine, but if you don’t have one for the item, maybe this could cause an issue. I’m guessing…

Yes, I intentionally tried to have minimalist definition in the sitemap so I can do the definitions via Habmin. every item has label. In Habmin when you create new item you have default label, which usually I change

Lol… my eyes are getting tired… I looked back at your post and the labels are all there. Thought for sure some were missing the first time I looked!

Hmmm. Have you tried deleting the items that are missing data and recreating them again in Paper UI? I don’t see how this would help, but could eliminate any possibility.

I’m out of ideas :thinking:

Thanks a lot for your help! I’ll continue to dig…
What I see now when BasicUI loads is that every item is some kind of UI widget with following HTML construct

The ones that are missing values in the UI are with this flag
data-has-value="false"
so the BasicUI servlet or whatever is there server side is telling the browser that there will be no updates for this widget. Any idea where is the source code of BasicUI?

You are very welcome!

Where do you see this… in the browser developer tools?

This is the master branch, so it is a little newer than what you have…

yes dev tools HTML part of the BasicUI

I’ve seen something like this before. I think if you delete an Item without first removing the link to the Channel, the Link sticks around and OH gets confused thinking there are two instances of that Item still.

@v_velinov, I’d recommend removing all your Links, stop OH, then open userdata/jsondb/org.eclipse.smarthome.core.thing.link.ItemChannelLink and remove all the sections that reference the Items that you are having problems with.

This will at least clear up the potential that OH thinks it has two Items with the same name hanging around.

@rlkoshak Bingo! Thanks for the hint. Indeed it was mess up from old items and current one with same name, distinguishable only by the node ID. What a mess inside the Items table of jsondb and Karaf runtime seems to be unaware of this. That’s why neither PaperUI nor Habmin could show anything wrong. May be if debug level for logs would show some signs

For instance, wrong ones:

“BathroomTemperature -\u003e zwave:device:df40a6ca:node21:sensor_temperature”: {
“class”: “org.eclipse.smarthome.core.thing.link.ItemChannelLink”,
“value”: {
“channelUID”: {
“segments”: [
“zwave”,
“device”,
“df40a6ca”,
“node21”,
“sensor_temperature”
]
},
“configuration”: {
“properties”: {}
},
“itemName”: “BathroomTemperature”
}
},

“BathroomHumidity -\u003e zwave:device:df40a6ca:node21:sensor_relhumidity”: {
“class”: “org.eclipse.smarthome.core.thing.link.ItemChannelLink”,
“value”: {
“channelUID”: {
“segments”: [
“zwave”,
“device”,
“df40a6ca”,
“node21”,
“sensor_relhumidity”
]
},
“configuration”: {
“properties”: {}
},
“itemName”: “BathroomHumidity”
}

Correct ones:

“BathroomHumidity -\u003e zwave:device:df40a6ca:node9:sensor_relhumidity”: {
“class”: “org.eclipse.smarthome.core.thing.link.ItemChannelLink”,
“value”: {
“channelUID”: {
“segments”: [
“zwave”,
“device”,
“df40a6ca”,
“node9”,
“sensor_relhumidity”
]
},
“configuration”: {
“properties”: {}
},
“itemName”: “BathroomHumidity”
}
},
“BathroomTemperature -\u003e zwave:device:df40a6ca:node9:sensor_temperature”: {
“class”: “org.eclipse.smarthome.core.thing.link.ItemChannelLink”,
“value”: {
“channelUID”: {
“segments”: [
“zwave”,
“device”,
“df40a6ca”,
“node9”,
“sensor_temperature”
]
},
“configuration”: {
“properties”: {}
},
“itemName”: “BathroomTemperature”

As I mentioned I spotted the old node IDs that were higher due to experiments over time, nothing else was different.
Again thanks a lot. Also to @5iver that gave a hand. Lost one day, but eventually worth the effort since learned some more of the internals oh OH2 :):wink: