VS Code openHAB Extension!

Unfortunately still not. I only get the Items and Variables. For example, no methods of “now” are displayed:

image

Me too. I only get the same.

Have you connected your network-drive with a letter ?
grafik
That helps me.

Hi Peter, yes.
But thanks to your comment, I’ve found one error!
So I had my Pi mounted as a net drive with a letter. However, that network drive never showed in Visual Studio code - apparently because I ran VS Code by default as Administrator (full explanation here.)
After removing the admin checkmark in the properties, I can find the drive letter and also use it in my VS code workspace. This also cleared the error by the VS Code extension that always popped up when I first opened a file from my Pi.

@Saracen
This also made the suggestions work!
image

Sorry for my silly question, but where are those properties to change. I didn’t find them. Pls. give a hint or better a solution :upside_down_face::wink:

Right-click on your VS Code shortcut or your Code.exe in the installation path, go to the “Compatibility” tab and make sure the checkbox is not set:

image

1 Like

Hi Chewie,
thx for this information and good to know. But as I can see, my properties looks similar to yours.

. So at the moment no change is necessary for my setup. But I can count on your hint if I have to do a new installation.

Cheers,
Peter

This shouldn’t be a problem on any fresh installation. I think I set the checkmark when I had problems with another topic in VS code. I don’t even remember if it fixed it.

Will the LSP be exposed for remote use over myopenhab.org ?
or is it wishful thinking ?

I would already be pleased, when we have a reliable solution that works locally and remote within the intranet. :smile:

But if someone is willed to add something and if there’s a benefit for some users, why not. :slightly_smiling_face:

I can’t get LSP working anymore. Not sure when it stopped working might be when I switched to openHAB 2.5.0 Build #1715 snapshot. Openhab is running in a docker on a Synology.

I get following error:

[Error - 23:41:26] Connection to server is erroring. Shutting down server.

Code completion and items with rest api are functional.
Logfile says:

[INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007

So seems to be ok.
To be safe I entered the standard lsp port in paperui (5007)

My settings.json looks like this:

{
“openhab.host”: “my openhab ip”,
“openhab.port”: my openhab port,
“openhab.remoteLspPort”: 5007,
“openhab.remoteLspEnabled”: true
}

Standard of restarting openhab including deleting cache and temp I did multiple times without success.

I am running out of ideas what to try. Any hint is highly appretiated since it was really nice to have LSP running.

NoTechi

is kind of known and not solved finally (or even partly).

See:
https://community.openhab.org/search?q=Shutting%20down%20server.%20category%3A54

LSP is on my “i have to dig into this some time” list, but its a very complex topic (at least for me currently) and we have no real support/maintenance for this currently.

Additionally i have to admit that i am working around lsp most of the time and avoid it because of its complexity and structure. (Sorry. :man_shrugging:)
I have a rough understanding of its topology but i was not really involved in the implementation in vscode side, besides some functional testing and really not involved in the server implementation on openhab-core side.

We made some progress in the repo last days/weeks and i will hopefully get to finish some of my extension to-dos in the nearer future.
So LSP could get on top of the list in the future.
Any help is welcome, if one has expierience with language servers.

1 Like

Jerome thank you for the info! I was going nuts already since I thought it is on my end. I can sleep well now and hoping for a fix somewhen :slight_smile:

NoTechi

1 Like

can i use to ip in the vsc extension ?
say one is my local ip when i am home.
and the second one is my (VPN - logmein ip ?)

No, but you can configure more than one set by using working folders (don‘t know the correct English phrase, I‘m using German localization.

@allen

I use remote dev in vscode for openhab on RPI3 b+

https://code.visualstudio.com/docs/remote/remote-overview

In editing a sitemap with VS Code, when I put in a Slider the minValue parameter is flagged as an error by the editor. You can still save the file and the sitemap works fine. Just an FYI if someone is updating the VS Code extension.

Hi to all the community!!

New user of openhab, having installed openhab in a raspberry pi 4 and trying to configure it through a Debian box.
I have also installed VS Code along with the openhab extension and I was wondering whether somebody has managed to run the extension over sshfs and edit files locally instead of samba?

I would like to avoid setting samba if possible and go with sshfs, but have to find a way to move around root permissions issue of /etc/openhab2.

Has anybody achieved this?

The ms-vscode-remote.remote-ssh extension should let you do it all over ssh.

I must thank you because after hours lost on this issue you shared the right solution for me.
:clap: :clap: :clap: