Home Assistant Community Add-on: Visual Studio Code

Tags: #<Tag:0x00007fc407fb04c8> #<Tag:0x00007fc407fb0400>

You da man, @frenck!!! I use this program daily and to now have it available directly in hassio is going to be an amazing convenience!

Yes, you can

I don’t follow your comment. Can you elaborate?

When I enter the editor for lovelace, could it use VS?

The raw config editor? No.

The card editor?

Same difference. No.

You could use yaml-mode and then have a ui-lovelace.yaml file that you could edit as you wish in vs code

I’ve gotten used to crtl/a-v ing to VS when I get into something unruly. Just lazy, I guess.

Yeah, the UI editors have a long way to go to be a replacement to an IDE and the built-in IDE, while cool, has it’s issues. Need more frontend devs. I think we’ve derailed this thread enough for now, though. Feel free to PM me with any other questions :slight_smile:

The log shows this 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), :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”}

and also the error that @DavidFW1960 mentioned:

parse error: Expected string key before ‘:’ at line 1, column 4
[20:00:54] ERROR: Unknown HTTP error occured

Can you help?

Edit: the system log shows this:

19-03-27 18:57:59 WARNING (MainThread) [hassio.api.security] /host/info no role for a0d7b954_vscode
19-03-27 18:57:59 ERROR (MainThread) [hassio.api.security] Invalid token for access /host/info

All above error are known @Emphyrio, and will be addressed in the next release.

All error posted do not influence the add-on working.

2 Likes

Thanks. It is not working for me unfortunately. Will wait for the next release.

Well, in that case, I need more extensive descriptions on what is going on, since the upcoming release does not address an issue I don’t know about.

As said, the logs you posted are not blocking for the add-ons inner workings.

Hi @frenck fantastic work! I’m amazed by all work you do for HA. Thank you! I need to consider switching back to HASSIO

I’m using HASS with docker and see that this add-on is using codercom/code-server. I’ve added this container and successfully installed keesschollaart81/vscode-home-assistant. I’m curious what this add-on is using to view the HA yaml files? on my laptop I use SSH FS to access the HA docker directory, but SSH FS when enabled with code-server just blanks out the webpage and I have to clear my cache and refresh the page to get back to the main code-server page.

Cheers!

Hi there m8,

That is a bit off topic, nevertheless, the addon uses nothing, since it already runs inside Hassio… Everything from vscode point of view is local.

:tada: Release v0.2.0

Full Changelog

This release fixes some annoyances and fixes a couple of warnings.
It also adds HA Authentication, so the password option has been dropped.
You can now log in using your Home Assistant username & password.

Changed

  • :books: Minor Readme updates (#4) (@sinclairpaul)
  • :ambulance: Fixed Hassio API role to manager
  • :ambulance: Workaround workspaces.json warnings
  • :sparkles: Adds HA Authentication

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

3 Likes

Nice. Good change to the password.

Is there any known issue with “Preview Markdown”?
command 'markdown.showPreviewToSide' not found

As Hassio addon: v0.20.0 (and previous 0.10.0) gives repeated: “extension host terminated unexpectedly”. Trying to restart extension host, same result after a little while. Clicking “Open developer Tools” but nothing happens. Other addons work fine (IDE, Tasmotadmin, motionEye etc).

I am using default setup and have opened the port in the firewall.

Anything I can try?