The ultimate companion for Home Assistant YAML in Visual Studio Code: Home Assistant Config Helper

Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.

Microsoft's Visual Studio Code is a hot favourite for tinkering with Home Assistant YAML code. Even though YAML is gradually being phased out, there are still a good number of integrations that haven't made the transition to the UI. So, as long as we're stuck with YAML, we might as well make the editing process as sleek and streamlined as possible with the Home Assistant Config Helper.

A Microsoft tool beloved by all?

Microsoft has had its fair share of missteps. It's been called out for monopolistic antics and anticompetitive manoeuvres, not to mention the occasional whispers about security vulnerabilities and performance hiccups. But amidst this roller coaster ride, it's a pleasant shocker that they managed to nail one product just right.

Microsoft's Visual Studio Code has been flying high, leaving a trail of happy users in its wake. Free to use and open-source, it's become the go-to source-code editor of choice, as evidenced by the Stack Overflow 2019 Developer Survey, and this is just four years post-launch.

How to Install the Home Assistant Config Helper for Visual Studio Code

With Visual Studio Code open, hit Ctrl+Shift+X on your keyboard or click on the extensions icon in the left-hand menu. Then just type Home Assistant into the search box, and voilà, the first result should be the Home Assistant Config Helper. Click on the extension and hit "install". You'll then be nudged to configure the extension.

Installing the Home Assistant Config Helper
Configuring the Home Assistant Config Helper

Setting Up the Home Assistant Config Helper

Once you've got the settings panel open, hunt down the Home Assistant Config Helper under Extensions. Then, key in the URL of your Home Assistant host. This can either be the internal or public address.

Setting up Home Assistant in the Home Assistant Config Helper settings
Creating a long-lived access token in Home Assistant

Next, open Home Assistant and click on your username in the main menu. Scroll down until you spot the Long-Lived Access Tokens section. Create a new token by clicking on create token. Name this token (something like Visual Studio Code would work) and click OK. You'll then be given the token. Copy and paste this token into the Visual Studio Code settings. Remember, this code is for your eyes only. If it ever falls into the wrong hands, make sure you immediately delete it in Home Assistant. You may need to restart Visual Studio Code for the settings to take effect.

Using the Home Assistant Config Helper

To start using the Home Assistant Config Helper, change the language in Visual Studio Code to Home Assistant in the bottom bar.

Setting the Visual Studio Code language to Home Assistant

The Wonders of the Home Assistant Config Helper for Visual Studio Code

The Home Assistant Config Helper is like your personal assistant, accelerating your editing process. Let me walk you through a couple of its standout features. For a full list of features, feel free to visit the project's GitHub page.

Completion for entity IDs, services, scenes, and triggers

Imagine you're crafting a new automation or setting up a binary sensor for room occupancy. Instead of wasting precious time hunting for the correct IDs of the entities you want to include, the Home Assistant Config Helper offers a list of all available entities for you to pick from. This also applies to scenes, triggers, and services.

Using the Home Assistant Config Helper

Autocomplete and validation for configuration and Lovelace schema

Properties, values, and enums are auto-completed, and most schemes that Home Assistant uses are validated, making your job a whole lot easier.

Easy navigation for includes

As someone who uses a whole bunch of includes in my configuration, I, personally, adore this feature. By highlighting an include and hitting F12, you can easily jump between files. If you're already using the Visual Studio Code add-on, then it's your lucky day, as there's nothing left for you to install. This extension is already part of the package.

Using the Home Assistant Config Helper
A portrait photo oif Liam Alexander Colman, the author, creator, and owner of Home Assistant Guide wearing a suit.

About Liam Alexander Colman

is an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container.
With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.

Leave a comment

Share to...