VSCode Extension - 0.5.1 update available

So my certificate chain is already done like in the Nginx documentation:

Nginx log:

IP - - [21/May/2019:21:13:16 +0200] "GET /rest/items/ HTTP/1.1" 400 271 "-" "-"
IP - user [21/May/2019:21:13:19 +0200] "GET /rest/things HTTP/1.1" 400 271 "-" "-"
IP - user [21/May/2019:21:13:19 +0200] "GET /rest/items HTTP/1.1" 400 271 "-" "-"

This is exactly my issue:

To allow the IP of my PC in the firewall would be a workaround, but not really satisfying.

Thanks for the additional information. :+1:

You can’t use https with the VSC extension for the LSP, I have tried. I think the issue is that it composes the address for the LSP like http://{openhab.host}:{openhab.remoteLspPort}. You can’t run it through Nginx because you would need to setup a sub directory and proxy it to 5007, so you would need to have the VSC extension try to access it via https://openhab.local/lsp for your example. However, consider the dangers, if you are connecting locally to your server then you shouldn’t need https because we should be able to assume that your local network is secure.

In order to be able to use the VSC extension through Nginx we would need the extension to allow setting the full address for each service. This would add complexity to the extension and its settings, which the developers might be against since most people are not running their OH behind Nginx.

As @David_Graeff mentioned in another thread - VSCode now has remote development capabilities. I don’t know if it would help in this case (and I haven’t tried with my setup yet) but you may want to google it (https://code.visualstudio.com/docs/remote/remote-overview)

The port 5007 is not running through Nginx, it is open in my firewall.
The issue is, that the host url ist used for connecting to LSP. Normally there should be only the IP used, so a regex to cut away the https:// part would be enogh

Oh I see, I misunderstood what you were trying to do. You are correct, the extension should take the protocol for http(s) as an additional setting, or as part of the uri and strip it for connecting to the LSP because it is not an http tunneled service.

Correct, the question is, who could implement that?

That shouldn’t be a big task at all, but I am not sure in which places it is used in the extension so we will have to identify the locations first.

Maybe I can spend some time next week to dig into that.

2 Likes

Maybe it was easier as thought.

I have added a PR and uploaded a packaged extension with the PR changes included.
Would be nice if you could test that @MriX.

See:

I still get this error message and the LSP does not work.

[Error - 3:15:55 PM] Connection to server is erroring. Shutting down server.

Also the basic ui preview of sitemaps is still just empty.

After I installed this extension I got a once-off “URI ERROR” dump each time I opened VScode.

Was able to find a solution see post.

Posted here for cross reference. Hope it is helpful.

Hello community,
I am new here and newcomers to OpenHAB.

I’ve already posted in another thread before I discovered this right one.

I put my system on a Raspi 4.
Openhabian installed as an image and currently use the homematic binding. That works perfect!
Now I wanted to set up the VS code. I have mounted the folder openHAB-conf as a network drive
and can see the folders in VS code.

If I want to synchronize the things now, I get the following error:
command ‘openhab.command.refreshEntry’ not found

I’ve already tried to uninstall the VS code and reinstalled, but to no avail.

Since I am absolutely new to the field, I hope someone can help me.
Thank you so much!
violine

Welcome to openHAB, please check this solution:

Hi,
yes, I have already done the settings mentioned in the post. The error remains.

First @violine was able to solve his problem.

Second i would add the possible fix to the extension now.
I think the connection error has a different source than the https connection.
So its a smell step forward.

LSP in general is another problem.

I have merged this possible LSP fix and did some small cleanup.
I have also added a new feature (as PR currently).

Hover over Items will then return some live data from the rest api:

Single Item:
vscodeHoverSingleItem

Group Item:
vscodeHoverGroupItem

4 Likes

Hi,

I follow almost all posts here but still I have the same error with self-signed certificate.

image