My question is basic. Something to obvious, that nobody asked before…
I am on my PC with Linux Mint. I have openHAB2 on Raspberry Pi. Pi is in my local network. I have Visual Studio Code with OpenHAB plugin installed.
I don’t understand what is REST API. I have ssh connection to Pi. I used nano and mcedit to manage my OpenHAB in past. Now I want to use this great tool VSC.
How to start editing items, sitemaps and all other in Visual Studio Code?
Do I have to access files on Pi via ssh?
I added Pi’s IP address to settings in VSC/openHAB, but no window appeared. How to start the OpenHAB plugin? How to navigate to OpenHAB folders (which are on Pi)?
Please give me some hints.
I already have experience with OpenHAB, but never used REST API and Visual Studio Code.
First you have to use a samba share (or nfs, but if using openHABian, the samba share is already configured)
Then you can use this share to access Raspberry Pi’s /etc/openhab2/ with "open folder"
openHAB2 has a RESTful API which can be accessed through http://openhab-ip:8080/rest, VSCode openHAB2 extension makes use of this API
Furthermore current openhAB2.3 builds make use of LSP to support autoCompletion and code correction. This is done through port 5007 by default.
openHABian should use /etc/openhab2/as configuration folder.
Maybe this folder is remounted (with mount -bind) to be in both folders. This mount will fail if the mount folder is not empty.
Which extensions should I install in order to debug my openhab configs: rules, sitemaps, items ?
I have pointed to openhab2 - conf folder already. When selecting start debug I being asked to select environment.
Selecting Node.js giving me this error.
Choosing option “More” asking me to select extension to install.
The only extension needed is openHAB, though there might be other helpful extensions, for example jsonpath statusbar, which helps to analyze json files and to find the correct path to a value.
You’ll have to configure the openHAB extension to get access to your openHAB server (not only a samba share for configuration files but also ip and port for LSP server and rest api to provide autocompletion and error highlighting.