VS Code openHAB Extension!

Hello, I have many problems with VS Code (V.1.28.2) and openhab after reinstalling.

file not fount //etc/…/xxx.rule
no rest-api (no items and things)
rest-api works in the browser
no karaf-console

my vs-code user.settings:

    {
    "openhab.host": "192.168.178.120",
    "openhab.port": 8080,
    "openhab.lspPort": 5007,
    "openhab.lspEnabled": true,
    "workbench.iconTheme": "openhab",
    "openhab.karafCommand": "ssh openhab@192.168.178.120 -p 8101 -t 'log:tail'",
    "git.ignoreLegacyWarning": true,
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
}

What’s the problem?

PS.
VS-Code on a windows 10 pc (64bit)
openhab (actual snapshot) on a rpi3
openhab-conf via samba-share
vs-code openHAB-extension 0.4.0

1 Like

Did you ever get to the bottom of this?
I’ve the same issue - it’s basically check the server path, rather than mapping back to the locally accessible version…

Hi Josar,
Would your method with private key also work if openhab installation was in a docker container?

Just a newbie question:
Why are some items names in the item files displayed in white, wheras the majority is displayed in a different color (some sort of blue)?

The first capital letter

I have “white” items where the first letter is a capital

Strange, pass the line I try on my VS

DateTime ABF1_DATE { http="<[http://127.0.0.1:8080/static/ICAL/...:360000:JS(abfall_naechste_abholung_datum.js)]" }

ABF1_DATE is white in my VS

Two consecutive capital letters at the beginning of an Item name does the same for me.

For me the letters all have to be capitalized to show the label in white color:

grafik

You’re right… I didn’t test this enough. Adding a single lower case letter changed it to cyan.

In my VS it seems that all items with a mixture of lower and capital letters are in cyan color, while items with only lower case letters or only capital letters are in white color.
I raised this questions because i wanted to understand the rationale behind that. If it is simply that. Im fine but i thought there would be more.

Nope. There’s not more and there is already an issue opened for this behavior.

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