@cpuram wrote:
I am running my home-assistant (not HassIO) as a docker container and wanted to install vscode. Here is what I did.
- create local folders to hold vscode config data
mkdir /config
mkdir /config/working_folder
install docker container
docker run --name vscode --restart unless-stopped -p 8443:8443 -itd -v /config:/config -v /path_to_hass_config:/config/working_folder -e ‘TZ=Australia/Adelaide’ -e PASSWORD=xxx -e SUDO_PASSWORD=xxx linuxserver/code-serverlog into vscode web-ui on http://ip:8443. on the welcome page under Start, click “Add workspace folder…” and select /config/working_folder. you should be able to see all your hass config files. At this point, we have a working code editor.
However to make it similar to hassio extension, with all those autofill bells and whistles, we need to install a few extensions. I fetched the list from the official addon here.
emilast.LogFileHighlighter
ESPHome.esphome-vscode
keesschollaart.vscode-home-assistant
lukas-tr.materialdesignicons-intellisense
oderwat.indent-rainbow
redhat.vscode-yaml
usernamehw.errorlens
vscode-icons-team.vscode-iconsfor some reason I am unable to search for them with in vscode web-ui. so I downloaded vsix files and install them manually. here is how I did it.
a) goto vscode marker place and search for the above extensions, one at a time, and download them.
b) move those vsix files to vscode config folder
c) In the vscode web-ui, click on hamburger icon (top left) > view > extensions
d) in the extensions side bar click the 3 dots (’…’) and click “install from vsix”. under /config select and install the extensions, one by one.
- close the vscode web-ui (browser) and reopen it.
- In order to provide home-assistant access to vscode, in the settings, search for home assistant and provide url (http://ip:8123) and a long lived token.
- similarly you need to provide esphome url (http://ip:6052) as well.
hope this helps someone.
Posts: 1
Participants: 1