VS Code openHAB Extension!

Tags: #<Tag:0x00007f6ce9ff1b78> #<Tag:0x00007f6ce9ff19c0> #<Tag:0x00007f6ce9ff1830>

(Ingo) #163

After spending 4+ hours on this, I gave up and went back to trying to get it to work on Linux in a VNC session. The benefit there is that I can reconnect to the same session from any PC, rather than having to set up every PC individually with VS Code.

The problem I had running it in VNC was that backspace and the 6 key weren’t working at all. It turned out to be an easy fix, I just had to change the keyboard.dispatch value from code to keyCode and it suddenly seems to work properly even in RealVNC.

“keyboard.dispatch”: “keyCode”,

(Andrew Bovingdon) #164

Just upgraded to 2.2 and loving the openHAB VS Code extension… just struggling with one thing… I cannot save over an existing file. Save as shows that the file owner is nobody and the group is nogroup… I have the config set as the username and password used to login to the Raspberry Pi? What dumb thing am I missing?

(wolf_from_the_north) #165

to answer i restarted the whole application VScode.
you just need to open the config map.
then program the user settings and work settings to the correct values.
my openhab runs on a Synology and i access this with my windows 10 machine without issue’s.
to connect to the terminal you need to open the security keys -> look in the manual

(Carlos Roa) #166

Thanks a lot for this extension!! It’s great to be able to update my config files from a full fledged editor instead of vi or nano.
I use it from the Mac by using Cyberduck and Mountain Duck to mount the remote filesystem as local volume, so I edit directly the remote files over SFTP directly from Visual Studio Code. It is so great!!!

(Can also be done with Fuse and SSHFS)

(Mike) #167

I don;t even have this in PaperUI (all I have remotely similar is REST API Documentation).

I’ve tried setting the hostname and port in both the user and workspace settings, no luck so far.

Would be nice to have a comprehensive guide on how to install this, I haven’t found one so far.

(Jerome) #168

This is not needed anymore, when you are running the stable version.

openHAB 2.2 since build #1084 has LSP feature enabled in the runtime, so there are no additional steps for you to make it work.

Did you try to configure along https://github.com/openhab/openhab-vscode/blob/master/README.md#configuration ?
If yes:
Which information is missing there?
What could be improved?

(Mike) #169

OK, it does seem to be behaving now, I was using an old setting configuration with an [openhab] tag, using the one from your post and restarting the server seems to have solved it for me (even though I am using 2.1 stable).
I’ll try upgrading now and see it continues to behave.
Thanks again.

(Jerome) #170

You’re welcome. :slight_smile:
If there is anything misbehaving just throw it in here.

Readme was ok to read or something confusing there?
If think we should maybe separate the readme (which is used for the marketplace description too) from the usage and instructional things for the future.

(Mike) #171

Funny you should offer, now I can’t access my openhab, the ‘habopen’ password is not working anymore.
This is what I have in my users.properties

openhab = {CRYPT}4F61A0FD056BC0FD8231899EC4D9F9CA06AF0DEC895B2A3B0773F6FBC1C99776{CRYPT},
_g_\:admingroup = group,admin,manager,viewer,systembundles

Its very strange. Can anyone confirm this is the correct hash?

(Jerome) #172

I have never heard of settings in the extension affecting the access in your openHAB environment.
That’s really strange.
@kubawolanin, you?

(Mike) #173

This is baffling, I have even tried to reset the password as per the docs, tried a different password, I just cannot get past authentication.

On a positive note, the VS Code seems to be working flawlessly. However, I would trade that in a heartbeat to be able to tail the logs like I used to be able to.

I’ll start a new thread, maybe others have had this problem.

(SiHui) #174

If you did upgrade from 2.1 to 2.2

you should take a look at the 2.2 release notes and the breaking changes, although I can’t remember any problems with the karaf login …

Package-based Installations

For package based installations, you may be asked to replace some configuration files in /var/lib/openhab2. For best results select yes at each of these prompts. Old configurations can be found in the same place, but with dpkg-old appended to it.


Breaking Changes that Require Manual Interaction after the Upgrade

at the bottom.

(Fabi) #175

Is it possible to change files without using a smb share? Maybe there is another vs code extension which can transfer local file to OH server via scp after every save - like other editors can do?

(Mike) #176

I selected no, as recommended, can I rerun the upgrades and select yes instead?

It does seem weird that the login wont even work.

(SiHui) #177

Mine is slightly different:

openhab = {CRYPT}4F61A0FD056BC0FD8231899EC4D9F9CA06AF0DEC895B2A3B0773F6FBC1C99776{CRYPT},_g_:admingroup
_g_\:admingroup = group,admin,manager,viewer,systembundles

(Kuba Wolanin) #178

Would love to help you @psych but that didn’t happen to me neither.
The only thing I know that certainly happens is that I need to expose openHAB Console to the outside world each time I upgrade openHAB on openHABian.

If you’re on openHABian, maybe try “Fix permissions” option? (sudo openhabian-config then Apply Improvements > Fix Permissions)


(Mike) #179

Looks the same to me, although I only compared a few blocks by scrolling up and down.

Me:  4F61A0FD056BC0FD8231899EC4D9F9CA06AF0DEC895B2A3B0773F6FBC1C99776
You: 4F61A0FD056BC0FD8231899EC4D9F9CA06AF0DEC895B2A3B0773F6FBC1C99776

(SiHui) #180

I meant this part:


{CRYPT},_g_:admingroup_g_\:admingroup =


{CRYPT},_g_\:admingroup =

(Mike) #181

Well, well, well. I copied your whole line exactly and replaced mine and BOOM, I am in!!

How strange is that?

I will update my other post to reflect what worked.


(Mike) #182

After all that excitement, it would seen the new karaf console is flawed, at least for me, I can’t log:tail anymore, the console just hangs until I press CTRL-C.

Might have to just do a clean reinstall, OS, OH, MQTT, everything. It’s really annoying since I have shared folder set-ups, etc.