Visual Sudio Code, the YAML extension and Home Assistant’s “!secret” option

I use Visual Studio Code to edit the YAML files of my Home Assistant installation. Works great. However, there is one annoying thing: The YAML extension treats the “!secret” option of Home Assistant as “Syntax error” and underlines it in red.

To solve this problem, open your settings.json at

C:\Users\<yourusername>\AppData\Roaming\Code\User\settings.json

On my installation it looks like this:

After I added the code…

,
    "yaml.customTags": [
        "!secret scalar"
     ]

… it looked like this…

… and the problem is gone:

Leave a Reply

Your email address will not be published. Required fields are marked *