VS Code openHAB Extension!

Ah then we are talking about the same Thing.
This will be fixed in the next Release and is one of the reasons I want to push that as fast as possible. :slight_smile:

1 Like

Hey Folks,

first, thank you very much for this awesome Add-On, its really easy and stylish to use!

One Issue: I’ve installed it on my PC and it worked out of the box. Then I installed Visual Code and downloaded the plugin the same way like on my PC (hostname still openhabianpi). On the PC (Windows 7) it worked with BasicUI integration in VS Code but on my Laptop (W10) there comes a notification “unable to open ‘ohpi’: resource is not available.”
I thought its a Windows 10 Problem and as long as it would work on the PC I thought its ok for me. But after a few hours now I tried it again at my PC and the same error occurs.
I connected the openHAB-conf network-folder to a drive-letter on both computers an opened the conf-folders in VS Code. I couldnt find this error on the webs, does someone has the same problem or any solution?

Thanks in advance
S.

Since last Update to openHAB-plugin 0.4.0 I always get an error notification:

Paper UI kann nicht geöffnet werden: resource is not available

Needless to say, that Paper UI is available through the browser…

Could you help me reproduce the bug by providing exact steps?
Submitting an issue would be very helpful. I’m sure we can fix it! :wink:

Here’s the changelog for the reference, it may help tracking the root cause.

Cheers

Sorry, forgot to mention, that I tried to open an item or a thing through the item/thing list. There is no difference between any of the items/things…

step1

step1a

step2

(Well, Error will be slightly different… different name of item/thing…)

1 Like

Dang, it looks we’re using deprecated vscode.previewHtml now :frowning:

I will work on a fix this week.

For a workaround you can set:

"openhab.paperInBrowser": true,

but looks like the BasicUI preview is broken too.

Ah, didn’t try this yet. At least it’s reproducible :wink:

Yes it is. I thought it was something specific to the Mac. But I just tried on Windows and I get that error when opening Basic UI.

Me too facing the same problem… Can’t load the paper or Basic UI. Is there nay solution…?

Hi Chewie,

Did you fix this? I’m getting the same thing and couldn’t find a solution in the thread.

I’m using:

openHAB 2.2.0-1 (Release Build)

Thanks!

FYI, OpenHab 2.3.0-1 (Release Build) and using Linux Mint 18.3 (soon to be 19 :sunglasses: ) with same issue. No loading of Basic or Paper UI.

Are there any solutions for opening the Basis UI or Paper UI via the VS Code editor?

I also get no syntax errors in VS Code. Is there any solution for it?

Not at the moment. There is an open issue for that, and I guess the patch will be merged when there is an update for the VSCode openHAB plugin

I have been using the extension without trouble until just recently. The THINGS and ITEMS are no longer populating on the left side menu. Not sure what I did…

I’m using extension v0.4.0. Sintax highlighting is working fine and I get the items and things lists working fine. Autocompletion… could be better but is almost fine. The problem is with the LSP, I can’t get “Problems” window working.

I realised there is always a cope of errors in the output window whenever I open VS Code
[Error - 5:58:39 PM] Connection to server is erroring. Shutting down server.
[Error - 5:58:39 PM] Connection to server is erroring. Shutting down server.

But LSP is enabled and working in the RaspPi running OpenHAB 2.3 Release on a non-raspbian OS

In the openHAB VS Code Extension documentation I read this:

Configuration example (macOS)

{
    "openhab.host": "openhabianpi.local",
    "openhab.port": 8080
}

but I access my openhab through localhost, and localhost:8080 is where my OpenHAB is accesible from my Mac… In fact before 0.4.0 sitemap view used to work fine from VSCode. What would be the proper setting for Mac to get LSF working?

Well, in question of Sitemap and Paper UI access, there is an open issue for that.
LSP:

  • lspPort has to be set correctly (default ist 5007 - same port has to be set in OH2.3 +)
  • lspEnabled has to be set to true (should be default option anyway)

If you can reach openHAB via localhost, I guess you should set openhab.host to localhost or 127.0.0.1

Wow, this setting finally makes VS Code work now with all features on my windows machine, thank you very much @Udo_Hartmann !
Where is that port (5007) documented ? Could not find that info in the docs?

In fact, you shouldn’t need to set the port, if not other than 5007. Maybe VSCode / the plugin has a hickup :wink:

I don’t know why but I had port 8080 in my cfg file…anyhow with 5007 it works.