Need low level access to Semantic Model

  • Platform information:
    • Hardware: i686
    • OS: Debian 12
    • Java Runtime Environment: openjdk version “17.0.8” 2023-07-18
    • openHAB version: 4.0.1
  • Need low level access to Semantic Model

So I was trying to get the openWeatherMap widget happening and I was having problems getting the semantic model to add one of the OWM Things.

I was able to create the thing, but when Adding Equipemt From Thing, it would not come up in the list of things.

That’s fine (it’s not, but I worked onwards anyway) this isn’t my question.

So I removed all the items from the existing OWM Thing that did get connected a few days ago. This isn’t my question either.

And then I started removing All references to OWM Things from the Semantic Model. They removed ok - so this also isn’t my question.

The items didn’t removed immediately from the display, but I’m used to this. (A question for another day perhaps)

Long story short. I did everything from a cache clear to literally slashing and burning the contents of my /var/lib/openhab/jsondb/ directory and while everything is gone (incluiding the f’ing Speedtest Widget I spent the last 2 days building), you know what? My model still shows the OWM entries.

I attempt to remove them through the UI and I get told they can’t be removed because they don’t exist.

All I want to do is get rid of these entries and I can start with them again fresh.

I read somewhere that the model is put together dynamically, but I’m telling you it is not. Even after a reboot the whole model is still there. The things and items it refers to are gone, but the model cannot be moved.

I’ve grepped the entire /var/lib/openhab directory for the id I used for the OWM group and nothing comes back.

Can someone tell me please, how do I manipulate my model when the UI loses cohesion? The UI is still unstable enough that we need lower level access.

Are you using firefox to view the UI?

1 Like

or Safari on Mac?

Sounds familiar to me, when I use original safari from Ventura and is completely away if I use chrome.

1 Like

This definitely seems to be a UI issue. But I wanted to make something clear.

The semantic model is 100% implemented by Items. There is no low level to access. If you create a Group and apply a location tag to it, boom! you now have a Location in your semantic model. If you have a Group and apply an equipment tag to it and make it a member of the Location Group, boom! you now have an Equipment situated in that Location in your semantic model.

I think you get the idea. It’s all driven by Items, tags and Group membership. So if there is a low level interface, it’s the Settings → Items page.

If the Model view is showing stuff that doesn’t appear in the Settings → Items page, that’s definitely a UI issue. There have been some reports of strange behavior like this with Firefox. I believe there is an issue open.

I assume you mean here it doesn’t show up in the Model view?

Tread with caution. When something basic like that doesn’t work you are likely heading down the wrong path and setting yourself up for frustration.

Did you remove the Links too? I think most of these have been fixed but weird things can happen if you have orphaned Links including situations where OH still things the Item is still around. There is a command you can run from the karaf console to detect and remove orphaned links. Runtime Commands | openHAB. I think these have been added to openhab-cli as well.

If you didn’t delete the contents of the jsondb/backups your widget might still be there. There is also a weird behavior (I filed an issue on this once upon a time) where if an expected jsondb file doesn’t exist, OH will automatically start using the most recent backup.

1 Like

Thanks for the advice.

I did find the automatic restorations happening and renamed jsondb to jsondb.old before manually creating a new empty jsondb directory, so fortunately I got my page and widgets back by restoring from there. :slight_smile:

I’ll have a look further at the Firefox issue and see what sense I can make of that.

You’ve convinced me the problem probably is there.

Thanks again :slight_smile:

Yes, Firefox for the UI.

Is there anything you can advise on there?

Firefox on Ubuntu for settings, etc.

Chromium on Ubuntu for my dashboard, but that machine is so slow it’s really only good for display.

It’s looking like the problem is probabably in the Mozilla code so I’m going to investigate in that direction.

Can confirm I’ve gone into the model in Chrome on my phone and the mess I made last night is showing perfectly.

Firefox is probably the issue.

Imagine my face if I’d gone so far as to wipe the Openhab machine and reinstall everything and found the same model when I went back in. Lol

I’ve seen a couple of reports on things like this now. Firefox is apparently caching full js environments on pages now which is causing all sorts of issues with changes in the UI not showing up. Closing the firefox tab and re-opening I think is sufficient, but it’s not clear.

I wonder if there’s something that OH can do on our side to suppress this function.

1 Like