Skip to content

temp_vs_code

Troy Prelog edited this page Dec 1, 2020 · 6 revisions

🙈 Don't look here -- This page is temporary ⚠️

version 5 in progress... this page is here so I can start making notes on things I usually don't mention.

  • If you care, feel free to open an issue with any feed back, suggestions or questions.

TODO: vs_code

  • everything
  • Home Assistant Config Helper [link]
  • SSH_FS instead of SMB
  • Suggest some other extensions
  • map a network drive
  • connect as user in the @homeassistant group on TrueNAS
  • say why network drive and not remote config [link_to_open_issue]

Using VS-Code to edit configuration

⚠️ WIP - Details on this page are incomplete and subject to change!

I've only recently started using vs-code in general. If not already installed, I might suggest the VS-Code extensions

  • ha config helper [link]
  • rainbow bracket [link]
  • few more [link]

As my Home Assistant setup remains very practical, I do not regularly edit yaml files, so I have almost no experience using the Home Assistant Config Helper [link] While possible to use, it does not offer it's full functionality when Home Assistant is running on a FreeBSD OS.

Why remote editing does not work

  • we are not using, and can not use Docker on FreeBSD
  • would only be possible through ssh using vs-code official extension
  • ssh remote editing is not supported by vs-code official extension on FreeBSD
  • There is an open issue requesting remote editing support on FreeBSD. [link]

Now that’s not to say you can not use VS-Code, but it does mean that you can not include it to the side panel of Home Assistant. In other words, you’ll need to run VS-Code on your laptop or desktop computer. To remotely access your HA configuration for editing, there still two options

  1. Share the HA configuration directory using samba, then edit files using network share.
  • HA Config helper does not work is accessing the share directly (if you get it work, let me know)
  • To use the Home Assistant Config Helper, I had to map a network drive
  1. Configure ssh on NAS or in jail, then connect with VS-Code using the SSH FS extension.
  • You need to manage access and file permissions accordingly
  • SSH FS extension is third party and not supported by HA config helper
  1. Bonus for the other KDE user, (seriously, how many of us can there be)
  • Did you know you can connect over ssh using Dolphin [link]
  • In the address bar, try fish://[email protected]/mnt/path/to/somewhere

Before any of this, I strongly recommend you have already completed the following

  • moved your configuration to an external dataset [link]
  • configured an SMB share for your configuration [link]

Windows

I'm not a Windows user, but I have at least tested (at the time of writing) that this works.

Map a network drive

From the file explorer in Windows, right-click the newly created share, select Map network drive. You will need to connect to the share with a user account that belongs to the homeassistant group on TrueNAS.

Open in VS-Code

From the file explorer in Windows, open your new network drive. Right-click the homeassistant folder and select Open with Code

Linux

I assume you're all Windows users 🙄 Let me know if I should add what I do in Linux.