Home Assistant Community Add-on: Visual Studio Code

thanks, that explains everything!

First of all thanks for nice addon!

Anyone managed to install PlatformIO VSCode extension? Seems that platformio binaries are not installing to docker image.

It would be really nice to move all local IoT projects to this addon.

1 Like

Not sure if this is the appropriate venue to bring this up, but I have a working example of this running as a sidecar container for the home-assistant docker image running in a kubernetes pod via a helm chart.

Here is the pending pull request to implement this feature: https://github.com/helm/charts/pull/13538

:tada: Release v0.5.0

Full Changelog

:arrow_up: This release brings major updates to the Home Assistant Config Helper extension for Visual Studio code.
@keesschollaart81 did an amazing job on extending it and now provides:

  • Auto-completion & validation on your Home Assistant configuration in general.
  • Auto-completion & validation for Lovelace.
  • Can now handle !include's and supports Go to Definition.

:ambulance: Furthermore, changes were applied to reduce the number of refreshes of the file/folder tree. This was especially annoying when trying to create or rename files/folders using the explorer.

:warning: Configuration change

This add-on comes with a VSCode configuration out of the box, which is being updated by the add-on. This auto-update mechanism stops working when you personalize/change VSCodeā€™s configuration.

In order for the new Home Assistant Config Helper extension to work, a configuration change was made. If you did not personalize your vscode configuration, the thing will just work. If you did customize it and want to reset your configuration to the new defaults:

  1. Open the Visual Studio Code editor.
  2. Click on Terminal in the top menu bar and click on New Terminal.
  3. Execute the following command in the terminal window: reset-settings.
  4. Done!

:hammer: Changes

  • :arrow_up: Upgrades add-on base image to 3.1.1
  • :arrow_up: Upgrades code-server to 1.939-vsc1.33.1
  • :hammer: Pins versions of VSCode extensions
  • :hammer: Extends file watcher exclude list
  • :hammer: Associates yaml file to Home Assistant by default
  • :sparkles: Adds vscode settings reset command
  • :arrow_up: Upgrades vscode-home-assistant to 0.5.7

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

5 Likes

Nice. This addon picked up some white space I had at the end of some lines in a lovelace file and I fixed themā€¦ (they were not causing an error but good to ā€˜fixā€™ them anyway.)

Thanks for the addon and update.

1 Like

Just switched from hasbian over to hassio and first time with vscode. I am trying to add some of the other folders like ā€œshareā€ so I can get access to my Caddyfile. I cant seem to add a new folder to the workspace ? Have I something missed or configured wrong?

Also is there any reason to go about setting this up in caddy with its own subdomain in with CADDY with the new options to place a link to vscode in the sidebar?

Thanks still acclimatizing to the changes but a good editor would be great to get up and running as one of the first things

Works hereā€¦ click under file open folderā€¦
image
You will see the share folder in the list

Just use the toggle to add to the sidebar.
image
Only reason you would create a subdomain is so you can access it outside home assistant and you need to then specify a port as well.
image

I am getting a few config errors that seem to be wrong from my configuration.yaml:

  elevation: !secret my_elevation

and

      trusted_users:
        127.0.0.1: !secret user_id
        "::1": !secret user_id
        10.90.11.0/24: !secret user_id
        "fd00::/8": !secret user_id
        !secret zerotier_iphone: !secret user_id
        !secret zerotier_ipad: !secret user_id
        !secret trusted_ipv6: !secret user_id
      allow_bypass_login: true
    - type: homeassistant

Weird because ALL of these seem to be working as intended. Certainly my zerotier trusted users are automatically logging in and working when I am on the ZeroTier One VPN so I am confident there are no errors in config and they are flagged wrongly in VScode addon.

Yes. I had cloud nine set up in hassbian this way with a sub domain. I just wondered if there was any point in doing it that way anymore with the new set up. Thanks I see I can open a folder but then it replaces the config folder? I thought I should be able to add to the workspace. Probably a vscode question rather than an add on question perse unless itā€™s a weird limitation of the add on. Thanks for answering though. I have been reading your posts for awhile on the forum and I think I kind of followed a similar path

Is there any way to add quick shortcuts within the VSCode window to 1) check all config files for errors and 2) reload / restart HASS like in the Configurator? Perhaps I missed it if those exist. #2 especially would save me some back and forth.

In the terminal window (If not already open, click ā€œTerminalā€ at the top, then ā€œNew Terminalā€), type in:
hassio homeassistant check. It will return ā€œOKā€ if all is good.

In the same terminal window as before, type in:
hassio homeassistant restart.

Word, that works for me. Thanks.

I canā€™t copy and paste within the VSCode window, I can copy outside the VSCode window and paste the clipboard contents into the VSCode window though. If I right click, I have the copy option there but its not working. Is this working for other users?

Working fine for me

Yeah, it use to work for me until I reset and reinstalled the add-on. Is there a tick box of setting somewhere for this Iā€™ve missed?

In chrome the first time I tried to copy/paste into VSCode, chrome asked me if I wanted to allow this site to access my clipboard. I agreed, and it works fine.

Maybe you accidently said no to this popup at some point?

If you go to the chrome settings, under ā€œContent settingsā€, then choose " Clipboard", it shows which sites you have allowed and blocked from clipboard access. Check there that you havent accidently blocked it.

Thanks for your help, I did check and I havenā€™t blocked any sites yet, but this is happening in ingress mode. VScode is also taking a very long time to show after clicking the name in the side panel which it never did before.

Iā€™ve been using it exclusively in ingress mode since the feature was released, so I donā€™t think itā€™s that (at least for everyone).

1 Like

I also started to get this message occasionally. not sure if this is all linked to no copy and paste and taking along time to load.

Im running on a nuc in Proxmox with nothing else running but hassio.

Any ideas please