VS Code openHAB Extension!

Definitely. Unfortunately, I just spent another half an hour without any success. I am really lost on all those Microsoft developer websites - I guess I will have to contact support their support…

Any progress on getting the extension in the public Marketplace?

I would spend some spare time to help you out on this, since i would highly appreciate a marketplace listed extension.

So if i can help out in any way on this topic fell free to contact me @Kai or @kubawolanin. :slight_smile:

1 Like

It’s live! :beers:

Now you can download the extension directly from the VisualStudio Code Marketplace!

Here you go:
https://marketplace.visualstudio.com/items?itemName=openhab.openhab

14 Likes

Excellent!!!

Love it, looks and works great. Thanks!

Just found out about this now, sounds really good! I never liked ESHD so currently I’m developing all my rules in nano directly on my oh server.

One question though, just to be clear: I’ve already got Visual Studio installed since I use it in my everyday job. But if I understand things correctly Visual Studio and Visual Studio Code are completely different beasts so I’d need to install Visual Studio Code as well to use this, right?

That’s correct :slight_smile: VSC is a lightweight editor written completely in TypeScript and wrapped in Electron.
Visual Studio is a complete IDE.

1 Like

Hello.
I constantly have the error (even just while navigating through opened files) “Error while connecting: Error: getaddrinfo ENOTFOUND openhabianpi openhabianpi:8080”, whereas as far as i can tell i’ve correctly configured my VSCode settings (moreover, the sitemap preview is working for example - but not the ctrl+space completion).

Any ideas ?
VSCode : 1.16.1
Openhab extension : 0.1.0

Configuration :

Error :

Are you on openHABian?

If not, you will have to edit your settings like:

{
    "openhab.host": "ip_of_your_server",
    "openhab.port": "8080"
}

No, i’m not on openHABian (docker image on linux host).
The attached screenshot in my previous post was showing my VSCode configuration, with the two settings you’re speaking about …

In VSC, you have “User settings” and “Workspace” settings:

I applied the above settings to the “User” settings and that works fine.

Not for me, i have the same behaviour if openhab.host is configured in the .vscode/settings.json “user” preferences (“Settings defined on this scope override the user scope.”).

So still no luck for me.

Started using the plugin, works perfectly - however i can’t find the “auto complete” function - shouldn’t by itself suggest items when i start writing them?

Hi there all,
I like so much the VS but I take an error when I want to save the files.

If I make a new folder in windows explorer I can make it… so I can write to the openhab folder.
But if I want to write from the VS… give me "operation not permited"
Anybody can help me please ?

Thanks in advance
Denis

You need to provide more details. How are you accessing your config files? Via samba share? Then you have a permission issue probably.
What operating system are you using? Do you access your config files locally or remote?

Thanks Sihui,
I use openhabian os for the raspberry
and windows 10 on my PC
I just make a network drive folder Y:\ with the conf folder of my openhab and I conected with thw openhabian user

From windows explorer I can write… but from VS i cannot :frowning:

Thanks again
Denis

That means you can just install samba and do the config via openHABian config menu.

Basically correct, make sure you are mapping the share from your samba service provided through openHABian to that drive letter.

VSC connects by default to the hostname openhabianpi, so make sure you did not change that.

I understand the problem :slight_smile:
The files was makeed using root… I just chgown-ed to openhabian user and now it’s work

Thanks a lot.
Denis

1 Like

Hallo and great work . I am not a programmer but I use openHAB as hobby .
I install openHAB extension on visual studio code vie extension tab . Everything run perfect but I have one question .
What exactly settings must set to have some syntax help in writing code in rules, sitemaps and items . Because when I use eclipse , it pointe me error like duplicate item names , if “}” missing and others …
( sorry for my english )