Home Assistant Community Add-on: Visual Studio Code

Hello everyone, I am not a programmmer and have no knowledge on VSCode and was wondering if someone could help me here. I suddenly see untitled workspace on top of the config which I have no idea how it got there and after a brief googling, I learnt that I need to save it but when I want to save it, I have another untitled workspace. Could someone tell me, how I should proceed?

Thanks in advance

@Stoffl, Iā€™ve raised the following issue for this problem - Auto-completion for keywords and parameters not working with VS Code v5.10.0 Ā· Issue #770 Ā· hassio-addons/addon-vscode Ā· GitHub

2 Likes

Iā€™m new to HA and installed Studio code server (v 5.15.0). Iā€™m facing the same issue with autocompletion/intelisense not workingā€¦have you found of getting this working again? I was that maybe restore an older version of the addon would help.

Iā€™m new to HA and having trouble understanding how it all works in general but have a particular question about VSC.

Iā€™ve recently got a HA Green and got it running. Iā€™ve long had an emoncms system so tried to install the emoncms integration to HA, but I canā€™t tell whether it works - I canā€™t see any sign of it. To install the emoncms integration according to Emoncms - Home Assistant I need to edit configuration.yaml and add a few lines. So I installed VCS and can see the configuration.yaml file and have added the relevant lines but I canā€™t see any of my emoncms data. :frowning:

Itā€™s occurred to me that I havenā€™t saved my changes to the file, but I canā€™t see any way to save changes?? So Iā€™m guessing it autosaves? Or have I missed something in the interface?

FWIW, Iā€™m a programmer using linux and have never seen VSC before so have no idea how it works.

Yes.

Add the lines you want and reboot HA

Ah thanks; Iā€™ve rebooted now :slight_smile: (it seems a bit strange to have to reboot an entire system just to add a new component, but hey)

But itā€™s still not working :frowning: In the emoncms apache log I see:

192.168.1.44 - - [14/Mar/2024:16:41:11 +0000] "GET //feed/list.json?apikey=xxx-obfuscated-xxx HTTP/1.1" 401 334 "-" "python-requests/2.31.0"

That looks a bit different to the corresponding log entry from emoncmsā€™ own feed list display:

192.168.1.83 - - [14/Mar/2024:16:45:34 +0000] "GET /feed/list.json HTTP/1.1" 200 1915 "http://emonpi/feed/view" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox 68.0"

The most important difference is that the emoncms display gets a 200 Success code whilst HA gets a 401 Unauthorized :frowning:

Edit to ask: if I make any changes to the config data, do I need to reboot the system again, or how often does it try to access the emoncms system?

Hi, does anyone know why my Opera (my default browser) doesnā€™t seem to display VSC properly? Iā€™ve tried using Chrome and it seems to show the formatting information there okay. The VSC settings donā€™t change so Iā€™m wondering what it is that Opera is doing that Chrome isnā€™t that blocks this.

Opera:


Chrome:

I seem to have fixed this but Iā€™m not 100% sure how.

first I went into settings and changed the security settings

then into Git and down to path then clicked on edit in settings.json and clicked on ā€œgit.pathā€: ā€œā€ and suddenly it asked me to sign into github and everything came alive again. But Iā€™m not exactly sure what it was that fixed it.

I know this was a while ago. Did you ever get this solved. They are driving me nutsā€¦

Hi there.
Is there a way to configure the vs code add-on to connect to a private Git server running on my NAS instead of using GitHub?
Thanks for you help!

Atttempting to install the Microsoft Python Debugger plugin you get:

Canā€™t install ā€˜ms-python.debugpyā€™ extension because it is not compatible with the current version of code-server (version 1.85.1).

The version of code-server appears to be the latest (v4.89.1). Any ideas?

I installed this add-on, itā€™s nice, it greatly helped me to find a bug when trying to implement YAML packages.
But is there a way to disable the VScode panel for other users and only keep it visible for me ?

Thanks

Iā€™m not sure if this will work as I havenā€™t tested it, but perhaps the side panel will only show for Admin users?

Hello, the add-on is great and I really enjoy using it :slight_smile:

There is one annoying thing (which might somehow be caused by something else in my setup - but havenā€™t found anything yet) that when I have a multi-line template block where individual lines do not fit on the screen, then for some reason it seemingly automatically changes this block to a format where it adds \n to replace the original linebreaks and the visual linebreaks appear to places where they are needed to keep everything visible on the screen area.

Same time it wraps the whole template into quotes and adds " to all existing quotes. So it still works fine but it is no longer very readable. An example:

Originally there were visual linebreaks where there currently is \n and indentations (for if-blocks etc.) were there in a normal manner. Like this:

As mentioned, I havenā€™t been able to figure out what is causing this. It might not be Visual Studio Code add-on although that is the only method I currently use for editing the config files. I cannot remember this happening before I started using VSCode and while I have a few times edited the lines back to the original format, some time passess and they are back to this unreadable ā€œblockā€.

If anyone has any ideas how to prevent it (even though it would not be a VSCode related reason it happens) your help would be very much appreciated! :raised_hands:

So I brainfarted my way to resetting the ā€˜Files: Excludeā€™ setting thinking it would reset them to HA defaults, it doesnā€™t. Can someone please post the HA default list for me so that I can stop being tempted to dig around where I shouldnā€™t be? Iā€™m prone to temptation and Iā€™m likely to break somethig :roll_eyes:.

2 Likes

Thank you!

No worries. Unfortunately I didnā€™t see an easy way to grab that list as text so you ended up with a screenshot. Sorry!

No worries, I saved the sceenshot for future reference :slight_smile:

Can I connect to this addon somehow from native VSCode using itā€™s remote support?

I did check if homeassistant.local:1337 is listening and it is not.

Is there something I need to configure on a HA OS installation to expose that port for native VSCode to be able to connect to it?