Home Assistant Community Add-on: Visual Studio Code

This add-on is provided by the Home Assistant Community Add-ons project.

GitHub Release GitLab CI Project Stage Project Maintenance

Supports armhf Architecture Supports armv7 Architecture Supports aarch64 Architecture Supports amd64 Architecture Supports i386 Architecture

Visual Studio Code, accessible through the browser.

About


This add-on runs Visual Studio Code, allowing you to edit your Home Assistant configuration straight from the web browser and can be embedded straight into the Home Assistant frontend UI.

Visual Studio Code runs as a remote server using code-server, and is a fully-fledged VSCode experience.

The add-on has the Home Assistant and MDI icons extensions pre-installed and pre-configured right out of the box. This means that autocompletion works instantly, without the need for configuring anything.

Installation


The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on.

  1. Search for the “Visual Studio Code” add-on in the add-on store and install it.
  2. Start the “Visual Studio Code” add-on.
  3. Check the logs of the “Visual Studio Code” add-on to see if everything went well.
  4. Click the “OPEN WEB UI” button to open Visual Studio Code.

:books: Please read the documentation for more information about the use and configuration of this add-on.

Support


You can always try to get support from the community here at the Home Assistant community forums, join the conversation!

Questions? You have several options to get them answered:

You could also open an issue on GitHub, in case you ran into a bug, or maybe you have an idea on improving the addon:

:information_source: At this moment our Home Assistant Community Add-ons Discord chat server and GitHub are our only official support channels. All others rely on community effort.

Repository on GitHub


Looking for more add-ons?


The primary goal of our add-ons project is to provide you (as a Home Assistant user) with additional, high quality, add-ons that allow you to take your automated home to the next level.

Check out some of our other add-ons in our Home Assistant Community Add-ons project.

50 Likes

About the author of this add-on

Hi there!

I am Franck Nijhof, and I have 30 years of programming experience, in many languages. I am using this experience to work on the Home Assistant project by giving back my knowledge and time to the open source community.

The add-on you are currently looking at right now was developed/packaged by me. It is not the only add-on I have created; there are many many more :wink:

However, I have a problem… I am an addict. A :coffee: addict that is. Lucky for you, I turn that C8H10N4O2 (caffeine molecule) into code (and add-ons)!

If you want to show your appreciation, consider supporting me for buying a cup of high octane wakey juice via one of the platforms below! :heart:

Sponsor Frenck via GitHub Sponsors

Support Frenck on Patreon

Enjoy your add-on, while I enjoy the brain juice. :coffee:

Thanks for all the :two_hearts:

…/Frenck

Join our Discord server Follow me on Twitter Flollow me on Instragram Follow me on GitHub Follow me on YouTube Follow me on Twitch patreon-icon

P.S.: In case you want to ask me a question: AMA (Ask Me Anything). Most of the time I am online at the Discord chat. (I go by @Frenck in there as well).

6 Likes

AWESOME! :tada:
This is the best ting to hassio since hassio itself :tada:
Good job!!! :tada:

5 Likes

What’s the difference between this addon and the cloud9 ide?
Is it just another tool with the same functionality or are there any benefits in this addon?

I do not even know where to start on answering this question. If your system can run this add-on, I would say, just try it. VSCode vs Cloud9 IDE is miles apart…

2 Likes

I can’t run this on my Pi Zero?!? :turtle:

Looking forward to loading it on the x230 next week :grin:

3 Likes

Not sure if this is a problem with me not setting something up right, or an issue with the addon.
I used git on Cloud9 and VSCode picked it up just fine, but when I go to push the changes I get the following error:
Git: fatal: cannot run /src/packages/server/build/extensions/git/dist/askpass.sh: No such file or directory

But if I run git push from the terminal inside the VSCode addon it works just fine.

If anyone else is seeing this, let me know so I know it’s not just me and I can open an issue for it, or let me know what I’m doing wrong lol.

It would be doubly cool if lovelace would call it

1 Like

I’m on a Pi 3B but seeing, the following, will this platform be supported in a future release?

image

Does it work on same port as HA ?

parse error: Expected string key before ':' at line 1, column 4
[18:31:52] ERROR: Unknown HTTP error occured
 System:   (amd64 / qemux86-64)
 Home Assistant version: 0.90.2
 Supervisor version: 150
.
.
.
.
.
ERROR Failed to parse cookies {"error":{}}
ERROR Failed to parse cookies {"error":{}}
ERROR Failed to parse cookies {"error":{}}
ERROR Failed to parse cookies {"error":{}}
ERROR SHARED stderr {"data":"Uncaught Exception:  Error: ENOENT: no such file or directory, open '/data/vscode/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/data/vscode/Backups/workspaces.json'\n    at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/usr/local/bin/code-server:468:27625), <anonymous>:56921:31)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)\n"}
ERROR Failed to parse cookies {"error":{}}
ERROR Failed to parse cookies {"error":{}}
ERROR Failed to parse cookies {"error":{}}
ERROR Failed to parse cookies {"error":{}}

Just using default config with a !secret password…

image

Also tried switching protection mode off…

1 Like

No it does not, but default is uses port 1337, but can be changed to anything you like in the Hass.io panel.

Thanks David,

This is a known issue, we are currently looking to the cause. This is part of the startup sequence and does not affect the working of the add-on and can be safely ignored.

Do you have any special characters in your password causing this? If so, could you try removing some and see if it helps?

This add-on does not use any features that require you to turn that off… so just leave it on.

I have an @ and a % - could they cause it??

EDIT: That fixed it. How odd…

Thanks for letting me know @DavidFW1960. I will look into this, sorry for the inconvenience.

1 Like

I get the same error when i try to push it to github, but i really dont know what i’m doing so that might be the case :slight_smile:
Now 14 min later i see on my github that the change have been pushed anyway.
So maybe some of my other “clicking around” might have pushed it?

Can I use this instead of the configuration add-on?

Thank you for this addon @frenck!! Works really nice.

Found one issue;
ctrl+click on a link doesn’t work. It opens a new tab, but it’s a blank tab.

Thanks for this addon!