VS Code openHAB Extension!

syntax
ide
vscode
Tags: #<Tag:0x00007f51f8057188> #<Tag:0x00007f51f8057048> #<Tag:0x00007f51f8056cb0>

(Jerome Luckenbach) #263

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:


(Eike Fo) #264

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.


(Udo Hartmann) #265

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…


(Kuba Wolanin) #266

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


(Udo Hartmann) #267

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…)


Vs code openHAB extension + Apache2 reverse proxy with self signed certificate
(Kuba Wolanin) #268

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.


[SOLVED] VS Code: "Resource is not available"
(Udo Hartmann) #269

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


(Mark) #270

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.


(Jacob Kuriakose) #271

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


(SiHui) #272

(Tom) #273

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!


(CM6.5 H102) #274

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.


(Eric Geiger) #275

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?


(Udo Hartmann) #276

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


(Michael Cumming) #277

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…


(Carlos Roa) #278

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?


(Udo Hartmann) #279

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


(vossivossi) #280

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?


(Udo Hartmann) #281

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


(vossivossi) #282

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