VS Code Extension With openHAB 3

Hi all,

Since questions are being asked repeatedly i wanted to share a quick Thread.
It can be used as a short FAQ when questions come up.
I will add important changes and culprits here when needed.

My Rest API doesn’t work any longer

This should mostly be related to our api security update in openHAB 3.
openHAB 3 introduces an authentication layer to the api.

Basic Auth configuration

You have to configure your openHAB instance proper and add some configuration to the openHAB extension.

on openHAB-Side

Make sure to activate Allow Basic Authentication in the API Security settings.

on VS Code Extension config

Add your user credentials (from your openHAB Admin User) to the extension settings.
The needed settings are:


When your openhab.host and openhab.port settings didn’t change since you installed/upgraded, everything should work again on the api connection.

What about token based authentication? Can i use that?

Yes you can use it with a generated token.
Generate a custom api in the user window of Main UI and copy it in the Username setting for the vscode extension.
Make sure to leave the password setting empty!

"openhab.username": "MY_GENERATED_TOKEN",
"openhab.password": "",

I am using openHAB with https enabled and it still doesn’t work

The code we are using for accessing the api has problems with https. That’s a known problem.
So you would currently have to allow http requests to the api to get it running.



Thank! A! Lot! :blush:

1 Like