Skip to content

Configure connection to HA

Kees Schollaart edited this page Nov 3, 2019 · 1 revision

After installation, this extension needs your...

  • Home Assistant Root URL and a
  • Long Lived Access Token

...to be able to connect to your Home Assistant Server.

There are 2 ways to get this done:

  1. Via the default VS Code Settings UI

    Set the values with the default settings editor of VS Code: to open the VS Code settings, go to (cmd+shift+p) 'Preferences: Open Settings (UI)', then go to 'Extensions' and then 'Home Assistant'. Please note the difference between 'User Settings' and 'Workspace Settings', by default the extension sets them on User-level but they can be overridden at workspace level.

  2. Via Environment Variables

    Set the HASS_SERVER and HASS_TOKEN Environment Variables. This is convenient when you're using both this extension and the Home Assistant CLI. The extension will only use these Environment Variables when you have not set any setting in VS Code.

    Remember the scope of your environment variables differs per OS. Usually for this to work, you need to start VS Code from the from the prompt where the environment variables are set.

Clone this wiki locally