I just noticed that you have a trailing comma after true:
“openhab.useRestApi”: true,
I’m not sure if that is causing any problem, but just in case I would remove it.
Then I found the following comment after I couldn’t get it to work myself (I’m using the official Docker container as well):
So you first need to open an .items file or a .sitemap file then in the left vertical icon bar you should see a new icon appearing. This icon is the openHAB logo. Click on it and you should see your items and things.
(It’s very well possible that it worked all the time for me but that I just didn’t notice the openHAB icon in the left bar)
First teh basic stuff:
WHich version of the extension are you using?
So there are things visible in that tree view sidebar but the items area is completely empty?
Could you provide a screenshot for a better imagination?
This could indeed be reasoned to your lsp settings or reasoned in a not forwarded lsp port.
you could try/check the restCompletionssetting and set this to true, which should use the rest api for autocompletion.
if it is working with this et to true, we should focus on the lsp settings.
i installed the docker container new, but with the original ports inside the container. i disabled the network host setting and forwarded the ports manually.
i tried all the other stuff you and all other forum posts recommended but nothing helped… , or not… lsp port, useRESTApi true or empty… nothing worked.
i guess so…it was a pretty fresh installation of openhab before, nothing configured much. now its also a complete fresh installation but i didnt configured anything port wise.
i also checked if my server got any traffic on the other used ports from openhab but thats not the case.
the mysterious thing is, that it was working via browser but the VSC cant open the REST Api.
RestAPI, Code validation etc., items / things in sidebar, everything works fine since weeks
After playing around with weather Bindings, installing and uninstalling them several time suddenly the items don’t appear any more in the sidebar. Everything else works fine.
I cleared the cache and tmp file, reinstalled VSC, tried several PC, still unsuccessful.
I can see a blue clock over the extension logo (screenshot) and that remains there for hours.
I would start by trying to determine where the source of the problem is by using a normal browser and opening the following URL: http://192.168.2.34:8080/rest/items
If this returns your items, then openHAB is working correctly and the problem must be on the Visual Code side. If it doesn’t return your items then the problem is in openHAB, Docker, or your Synology.
Opening that link I retrieve my items, no problems on that side. It is weird, that , if the problem is coming from Visual Studio, it is neither working on my Mac Book nor on a Linux PC.
Just reinstalled the docker container again, but still in host mode. Problem is still there.
Maybe I’ll try the bridge mode next.
export HOSTNAME
export OH_VERSION="2.4.0"
docker-compose -f openhab-compose.yml up -d
note: you should have a /datavol/openhab-2.4.0 directory existing on you server
to just make an additional note: It works like a charm. Openhab runs on a RPI3.
In the past I had a lot of performance issues. Now completition is almost instantly.
To display the items, only access to the REST API is required. I don’t know what the little clock on the openHAB icon means in Visual Code, but I can imagine that it means something like a timeout or that it is attempting to connect and that it is retrying this.
Could you try with the following config to see if the items show up?