Items visible, but Things not visible in VS Code

Hi,

I run openhabian (raspPi4) with the built as below (all per standard config).

I have installed VSC on my iMac. I have successfully connected to the Openhabian. The settings.json file on VSC looks like this currently:

{
    "workbench.iconTheme": "openhab",
    "openhab.connection.host": "192.168.178.111",   
}

It works partly. I can see the Items - see screenshot. But I cannot see the Things. Instead I get an error message:

---
    Error:
        Error while connecting to openHAB REST API.

    Message:
        Error: Request failed with status code 404
---
Usage of deprecated config => openhab.port <= detected.
Usage of deprecated config => openhab.username <= detected.
Could not reload items for Things Explorer

Do you have an idea what is wrong?

I tried already to edit the settings.json (by adding username and pwd of my administer, but that did not help either).

Thx
alex

runtimeInfo:
  version: 3.2.0
  buildString: Release Build
locale: de-AT
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 11.0.13
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.52+13-CA
  osName: Linux
  osVersion: 5.10.63-v7l+
  osArchitecture: arm
  availableProcessors: 4
  freeMemory: 89160552
  totalMemory: 194772992
bindings:
  - fronius
  - hue
  - mqtt
  - netatmo
  - zwave
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: true
    windows: false
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: macos
    pixelRatio: 2
    prefersColorScheme: light
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: N/A
    language: de-DE
    languages:
      - de-DE
    onLine: true
    platform: MacIntel
  screen:
    width: 2560
    height: 1440
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: filled
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15
    (KHTML, like Gecko) Version/15.1 Safari/605.1.15
timestamp: 2022-01-04T16:10:41.242Z

Hi @Alexollon,

The things api endpoint requires authentication.

You need to add an authToken (openhab.connection.authToken) to your settings.
(Also it would be good to add a specific port (openhab.connection.port), alltough the default one seems to work already.)

You have to generate the auth token via main ui.
See: https://www.openhab.org/docs/configuration/apitokens.html#generate-an-api-token for how to do this.

The seeting would then look like this:

{
  "workbench.iconTheme": "openhab",
  "openhab.connection.host": "192.168.178.111",
  "openhab.connection.port": 8080,
 "openhab.connection.authToken": "MY_TOKEN"
}

With MY_TOKEN = oh.TOKEN_NAME.TOKENSTRING

3 Likes

Thx a lot Jerome, you solved my problem, it works! All the best, a

1 Like