Home Assistant Community Add-on: Visual Studio Code

Not sure if this is the best place to post this question.
I use VS code for most of my file edits for yaml, config, ESPHome, etc.
But for my dashboards, I use the UI instead of yaml, with the occasional raw configuration editor.
So all my lovelace dashboards are in the hidden directory which does not show up in VSCode.

My question is, is there a way to force the hidden folders to show up in VSCode?

Thanks,
H-

1 Like

Has anyone noticed that the Visual Studio Code isnā€™t showing up in the add-on storeā€¦I also donā€™t see Wireguard either.

Are you looking in the ā€œCommunity Add-onā€™sā€ section? They are there for me.

I really enjoy editing my config since I ā€œdiscoveredā€ the CS code addon and especially after configuring git properly.

The only thing which really bugs me: Some time after VS code auto saved a file, undo (Ctrl-z) doesnā€™t work anymore. Accoding to most of what I read about undo history issues, undo should work, even after a file was saved. And if it doesnā€™t, this is mostly related to a problem with an installed extension.

I have four extensions installed, but deactivating them doesnā€™t solve the issue:

  • C/C++
  • German language Pack
  • GitLens
  • Nano Themes

Actually, undo is still working immediately after auto save as long as I stay in the editor. But when I leave the VS code UI, f.e. for checking the config, reloading scripts etc. and returning some moments later, I canā€™t undo anything anymore.

Is this working for you or do you have the same issue?

Thanks for the help. Somehow the repository had been removed from my setup. Iā€™ve readded it and can see everything now.

Is there any way to turn off the auto-indenting? Itā€™s driving me absolutely bonkers, and Iā€™ve tried turning it to ā€œNoneā€ in User, Remote, and Workspace, but itā€™s still doing it!

Thanks!

1 Like

Visual Studio code will constantly crash my home assistant. If Iā€™m coding in Visual Studio Code, at least 3 to 4o time sa day Iā€™ll get trying to reconnect. If I disregard then home assistant freezes and I need to turn it off then back on. If I stop using Visual Studio Code then no crashes all day.
Am I the only one?

Could this have anything to do with it? https://medium.com/good-robot/use-visual-studio-code-remote-ssh-sftp-without-crashing-your-server-a1dc2ef0936d

Hi Paul - Iā€™ve got the same issue running VS on an older PI3 with an SD card. The moment I try to use VS, it will crash or freeze HASS. Sometimes I can recover by clicking a different page, but while VS is installed, I noticed that even going to Supervisor will some make things freeze up.

The moment I uninstall VS code, everything works fine again. My next test is to run HASS.io on an SSD to see itā€™s maybe an issue with running HASS.io on a crapy SD card. It might be a PI3 thing. Havenā€™t had this issue on a PI4.

I am currently struggling with configuring Github in Visual Studio Code. Iā€™m able to access my Github repository through the git command on the command line (git push --set-upstream https://[username]:[token]@github.com/[username]/[repository].git master
But how and where do I configure Git Username and Oauth Token in VS Code? When trying to commit through VS Code, the authentication fails and ends in an 404 error.

Update: Solved!

Solution:
Generate an Personal Access Token in Github
In VS Code call ā€œGithub: Set Personal Access Tokenā€ and set the Token

I am having the same problem.
@thorschtn Can you elaborate how you got it to work?

When trying to synchronize github from within VSCODE addon I get

I have created token using ssh-keygen and ssh-add and created the relevant token in github website.

ssh -T seems to work

ssh -vT also sees to work

Update:
I solved it by creating a key without a passphrase

scrolling in the home assistant mac app is not possibleā€¦

1 Like

Is there a trick configuring github for this addon? I set user name and email and add the remote repo for my files. When I am trying to push changes Iā€™ll get a message box to allow access to github. A 2nd tab opens where I am able to grant access to the addon. But then github wants to redirect to the vs code instance and this ends in an error 404. I tried from local ip and using my duckdns domain but with no success.

Guys/Gals,

What am I missing here? I donā€™t see the ā€œVisual Studio Codeā€ when searching the addons page? Iā€™ve watched a couple of youtube clips where the VSC is found and installed. Iā€™m running the the ODROID N+ with HA OS.

Cheers!


Fresh install of Home Assistant on a brand new ODROID N2+, first add-on installed is vscode and Iā€™m getting these vertical lines in every file I open! Very annoying to try and code with. :frowning:

Has anyone experienced these? Theyā€™re there in both light and dark themes and not present on the Get Started page, just every file I open.

Any help would be appreciated!

Thank you,
Feld

@drcoolzic and another post got me headed in the right direction as I started my HA journey on a RPi4 Ubuntu arm64 node.

Unfortunately was sitting getting errors - for anyone still struggling (Iā€™m doing everything locally, not externally - yet), I had to adjust my Ubuntu firewall

Instead of:

ufw allow from <subnet>/<mask> to any port 8123

Using this cleared it right up:

ufw allow from any to any port 8123

As Iā€™m using a manual supervisor install (thus docker), I believe the chatter was being cut off. I plan to dig a bit deeper to determine what is being called/used so I can lock down a bit tighter but hoping this helps others.

Itā€™s now called Studio Code Server

1 Like

Today i updated Studio Code Server to 4.1.0. Now i get a bunch of errorsā€¦ i have a folder ā€œsensorsā€ where i have yaml files and there my sensors. after update each template sensor shows an errorsā€¦
whatā€™s the catch? I mean - what i must change in order to remove those errors? Is it related to VSC or is it just announcement for future HA update uncompatibility?

EDIT: going back to 4.0.0 and all errors are goneā€¦

I shoud say that these sensors DO work, even with these errors. So, is it VSCā€™s fault?


1 Like

Same thing here.

2 Likes

I see no errors at all.

Hello. Same problem after update.