VS Code openHAB Extension!

syntax
ide
vscode
Tags: #<Tag:0x00007f6ce5d60458> #<Tag:0x00007f6ce5d60318> #<Tag:0x00007f6ce5d600e8>

(Kai Kreuzer) #81

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…


(Robert) #82

Any progress on getting the extension in the public Marketplace?


(Jerome) #83

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:


(Kuba Wolanin) #84

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


(Kai Kreuzer) #85

Excellent!!!


(dalibor) #86

Love it, looks and works great. Thanks!


(Daniel Malmgren) #87

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?


(Kuba Wolanin) #88

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


(SRG) #89

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 :


(SiHui) #90

Are you on openHABian?

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

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

(SRG) #91

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 …


(SiHui) #92

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

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


(SRG) #93

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.


(Rasmus Balle) #94

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?


(denis) #95

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


(SiHui) #96

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?


(denis) #97

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


(SiHui) #99

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.


(denis) #100

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


(david) #101

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 )