[SOLVED] VS Code openhab connection

For me the savest way of setting configuration was always the global settings file reachable via the menu button on the bottom left.

I think we have some caching problems sometimes, since this problem occurs regularly.
But the settings are implemented completely native in our extension and we don’t have any influence in which setting Variant is taken. That should be handled via Vscode.
So I would suggest to try editing the global settings.

2 Likes

Where?:smiley:

Just search for openHAB in the search bar. Or have a look at the extension category on the left.

Also I would switch to json view.
There is a button in the top right corner.

Hi I’m having the same problem, I can follow the tutorial up to the moment you click setings and {} because there is no {} button on my top left to click on???
if I click on the other button it opens a folder settings. json not user settings like in the tutorial, how can I edit the Host, the file is empty???

Hi @sergioserrao

Welcome to our community and sorry for the dealy.
Since there are multiople questions for this topic i have checked the complete workflow agaion and it seems that vscode changed their icons?!

Anyway i have made a new give on how to access the user settings which should work (and are doing so for me for a long period now).

The buttons tooltip should show something like “Open settings (JSON)”.
I don’t know if it is written like this everywhere and it also depends on the slected language. :slight_smile:

1 Like

Hi Confectrician:
Thank you for your answer and guide, something is not the same as yours,
There is no default settings window, I can see the items and things on my server, but if I try to link to insert into a sitemap, I get this ERROR:
Error running command openhab.command.items.addToSitemap: Running the contributed command: ‘openhab.command.items.addToSitemap’ failed… This is likely caused by the extension that contributes openhab.command.items.addToSitemap.

This sounds more like something different is going wrong here.

Is this the complete error message or can you expand it siomehow?
It reads like it was cut off at some point.

Yes I think so, there is another warning that can give a clue:
No editor is active

So what i see here is:

  1. Extension seems to be working basically :white_check_mark:
  2. Extension has a valid connection because it is able to show items and things :white_check_mark:
  3. You have no sitemap file opened. (which i think is the cause for your error.)

Without opening a sitemap file vscode and the extension don’t know where you want to add something.
We determine this with the active texteditor, because it is possible to have multiple sitemap/item/rule files.

Could you try to

  • open your openHAB config folder with vscode
  • open the sitemap file where you want to add something
    and then try the function again?
1 Like

can you help? i cant access openHAB config folder