What’s new
Completely new openHAB Items Explorer view in the sidebar!
Preview all of your items thanks to the REST API
Dynamic rules from the Items Explorer view - including the current state
Ability to copy Item’s name and state
Clicking non-Group item opens it in the Paper UI by default
Note: Currently in VS Code stable Items Explorer is permanently visible. VS Code Insiders allows you to hide the tree view thanks to vscode#29436
Added Items autocompletion (with IntelliSense documentation) (#7 )
Quick search in the Community Forum
Added icon theme
Installation
This extension is not available in the Marketplace yet.
However, you can install it manually from official 0.1.0 release page .
Download openhab-0.1.0.vsix
on your hard drive
Open command line in the same folder you downloaded the extension
Type the following command:
code --install-extension openhab-0.1.0.vsix
This version will override the previous one.
Open Visual Studio Code
Open openhab configuration (openHAB-conf
) folder as your workspace
Enjoy!
17 Likes
Benjy
(Ben Clark)
July 7, 2017, 11:22pm
2
You’ve wowed me again! Nice work!! It’s becoming really simple to manage these text configs now!
Dim
(Angelos)
July 8, 2017, 6:02am
3
Excellent stuff !
I uninstalled my Eclipse Smart Home Designer
2 Likes
lubeda
(Lubeda)
July 8, 2017, 11:53am
4
i am getting this error when i configure my openhab host
Error while connecting: 500 - {“error”:{“http-code”:500,“exception”:{“class”:“java.lang.NullPointerException”}}}
Solved: PROBLEMBETWEENARMCHAIRANDDISPLAY
There was a wrong item in my files, so http://openhab:8080/rest/items did also reply with the null pointer Exception.
So now.
3 Likes
ysc
(Yannick Schaus)
July 10, 2017, 3:03pm
5
This is just great
FWIW, as an alternative to opening a commandline to install the extension, you can also use this menu:
2 Likes
halloween
(Hallo Ween)
July 27, 2017, 9:56am
6
Please can you tell me how i can access this extension if i have installed like explained?
Do i have to start it with a shell command or can i start it directly from paper UI?
Do i need some other software installed to use this or is this a extension inside Paper UI?
halloween
(Hallo Ween)
July 27, 2017, 10:17am
7
I can answer myself: I have to install VSCode first, that´s an app from microsoft.
But one more question: Default url for openhab is “openhabian” with port 8080.
How can i change this? I´ve found the location inside vscode, but i don´t know how i can change the default values and save this?
Ctrl + ,
opens VS Code user settings. You need to modify it by adding openhab.port
and openhab.host
like so:
{
"files.associations": {
"*.log": "properties"
},
"window.zoomLevel": 0,
"powermode.enabled": false,
"workbench.iconTheme": "openhab",
"openhab.host": "home",
"openhab.port": "8080"
}
gismofx
(C)
August 9, 2017, 1:23am
9
I just started with openhab2. This is a helpful plugin. Thanks!
What’s the latest status for code completion/“intellisense”? Do you have any plans to add more context based/object based code completion?
Hey Chad!
Of course, we do have plans to incorporate LSP.
But plan is not enough - we need execution
So at the moment we’re waiting for @sjka ’s Xtext upgrade to be available in eclipse smarthome .
After that’s done, we’ll need to integrate the VSCode extension with the LSP backend.
Here are some examples on how to approach this.
Cheers!
1 Like
gersilex
(SiLeX)
August 20, 2017, 8:23pm
11
Will the LSP incorporate symbols? I’d be nice if I could just press CTRL-R or use the @
command (Go To Symbol) to get an overview over all my rules in a rules file, items in items files, and so on.
gersilex
(SiLeX)
August 20, 2017, 8:25pm
12
What about peeking definitions of items, things, rules, and so on?
I will happily open issues for these feature requests, if those are not implemented through the LSP.
Dibbler42
(Thomas Bail)
October 30, 2017, 6:15pm
13
@kubawolanin How do i access the design pattern?
I really like the add on.
Thomas
DavidR
(David Read)
November 15, 2017, 4:55pm
14
If you look in https://github.com/openhab/openhab-vscode/blob/master/snippets/openhabrules.json
you’ll find all the shortcuts there, the design pattern is towards the end of the file.
So in a rule file, just type “dp time” (without the quotes) and return.
1 Like
How would I use it with myopenhab.org when I am not running the instance locally?
I entered
"openhab.host": "https://myopenhab.org/",
"openhab.username": "asdf",
"openhab.password": "asdf"
but it seems not to work.
Shouldn’t it be port 443?
I have access to the file system because I sync them via cloud service to the target device. The target device is accessable through myopenhab.org .
All I want is proper syntax highlighting but it seems not to work without the rest API.