Visual Studio code error for "openHAB Language Server": "getaddrinfo ENOTFOUND openhabianpi"

I think I read all the documentation I can find, but I’m still encountering an error. Let’s start with setting the scene: I’ve made some changes to settings.json:

{
    "openhab.connection.basicAuth.password": "myAPItoken, which I didn't include here",
    "openhab.connection.host": "192.168.1.9",
    "openhab.connection.port": 8080
}

Setting openhab.connection.host to 192.168.1.9 finally made openHAB extension work. Figuring this out took me some time. :slight_smile:

But now the openHAB Language Server still trips over openhabianpi, which I don’t really understand. Where does it get that from…? This is the error:

Error: getaddrinfo ENOTFOUND openhabianpi
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'openhabianpi'
}

I searched package.json, found here (https://github.com/openhab/openhab-vscode/blob/main/package.json) for openhabianpi, and only found it under openhab.host So I tried adding it to settings.json:

{
    "openhab.connection.basicAuth.password": "myAPItoken, which I didn't include here",
    "openhab.connection.host": "192.168.1.9",
    "openhab.host": "192.168.1.9",
    "openhab.connection.port": 8080
}

But then Visual Studio compains about “deprecated config values”:

My initial reaction was “so what”, but then it turns out, the openHAB Language Server is no longer in the dropdown menu (which I assume means it’s not being loaded):
image

The actual problem
In order to escape any ‘XY problem’, this is what I want: I want to write rules in Visual Studio (on my Windows 11 pc) directly to M:\, which is \\192.168.1.9\openHAB-conf. From my understanding, that’s how it should be setup? (192.168.1.9 is a Linux pc, and I installed via apt, so no Openhabian, if that matters.)

But without openHAB Language Server (I at least assume that’s the missing piece), there’s no visualisation of the code (for example: “rules.JSRULe” is not in colors, as I would expect it):

(I also don’t understand what’s supposed to be wrong with line 1, but that’s another matter (or is it because openHAB Language Server isn’t loaded?):


)

Hi.

I’ve had a similar problem for a long while.

This is my configuration:

{
    "openhab.connection.host": "XX.XX.XX.XX",
    "openhab.connection.port": 8080,
    "openhab.consoleCommand": "ssh openhab@%openhabhost% -p 8101",
    "openhab.connection.authToken": "oh.VisualStudioC...............",
  

My openHAB runs on CentOS 8 on a Raspberry Pi, not openHABian.

Yet, I get the same error message you do on the console, but I can see the openHAB Language Server option in the dropdown menu.

Although, I’m not sure if your problem with the rules is because only DSL is supported:

My configuration is also not openHABian. And it’s either the error, or not having the language server in the drop down, apparently.

But maybe someone has a solution? :wink:

I don’t have a solution but the exact same problem :wink:

Setup:

  • openHABian on a RPI 4
  • openHAB 4.1.1
  • VSCode running on Windows11

VS Code or Visual Studio ? Thi makes a great difference….

Sorry

I use Visual Studio Code. What’s the difference?

Our addons have been written for VS Code and will not work properly with Visual Studio. This should be documented.

Good to know. I don’t remember if I ever used VS Code but everything used to work with Visual Studio.
Thanks for the info, @hmerk!

Now you are confusing me :wink:
VS Code = Visual Studio Code
Visual Studio is something completely different.

You’re right, I was confusing it :smiley: I’d forgotten the VS for .NET development. No, I USE Visual Studio Code. That’s where I face the issue.

1 Like