Yesterday my new Synology DS920+ arrived on which I installed OH 3 in a Docker container.
Everythings working fine, i transferred all my things, items etc. from OH 2.5.2, needed some adjustmest but now everythings listed and reachable in OH3 GUI.
But…
I just cant to get Visual Studio Code running. I edited the json.xml (which I also edited to use the prior 2.5.2. which worked).
I changed the openhab.host and openhab.port (as its not running on 8080 as the old installation) and the OpenHAB plugin does list all Items correctly.
But in the “things” tab theres only the blue slider moving from left to right and I’m getting the error message “Error while connecting to openHAB REST API”.
How can there be a difference between Things and Items where Items work via REST, things not?
Misc: I tried to get all things and items in the OH 3 GUI Developer REST API tool. There i get all things and items.
If you need any further information, be free to ask.
Yes i am. Via the rest api from the GUI - Developer Tools, i can get all things and items.
Also i can control all items via rest (using my Streamdeck e.g.)
I don’t know if this is what you’re running into, but the OH3 things endpoint now requires authentication. I’m not sure if VS Code is set up to do that yet.
I’m not sure exactly when this changed in the API, nor what version of OH3 you’re running.
I installed a new docker image of 3.0.0M5, imported my files, same behaviour.
Items are displayed in vs code, things are not and stillt the error message.
Do you know if there’s a way to get a more detailed error message from vs code? The “error while conecting to openhab rest api” does not say much…
For this you would have to enable basic auth in the rest api.
This can be configured in the new main ui.
Basic auth should be supported so far and work with the username and password setztings in the extension.
But we definetely have to add native auth support in the extension in the nearer future.
Wow, well I think i have missed the “Allow Basic Auth” setting in the gui.
As soon as I activated it, set username and password in vs Code, restarted vsc, the Things gets loaded.
Im not that pleased that i have to enter my password in clear text in the settings.json, but it would work that way. have to think about it
If theres a tutorial how to get the token and where to place the token, that would be awesome! Maybe someone who develops the vs code extension reads this thread =)
Well, good to know und Hut ab, the extension is already awesome.
I disabled the LSP “feature” as i always get tons of errors in the openhab.log and vs code output while editing rule. But otherwise its superb