VSCode tips

Hi all,

I am just trying out VSCode on my mac (not running within Home Assistant). but I’m struggling with it a little.

I have installed the Home Assistant Config Helper, but it doesn’t seem to be auto populating at all.

Is there anything else that I need to set up? This is my Home Assistant config page within VSCode.

I unchecked ‘Ignore Certificates’, disabled and enabled the extension and it worked for me.

3 Likes

I’m also struggling with this. I’ve never used VSCode before, so I’m probably missing something simple!
Ive installed Home Assistant Extension to VSCode, (on my mac), added host url (https://192.xxx.xxx.xxx:8123), and Long Lived Access Token to User Settings. I’ve then unchecked ‘Ignore Certificates’, disabled and re-enabled the extension.
Where should I be seeing my Home Assistant files so I can edit them?

This extension is only for code completition with ha entities.

I’m not using vscode to view the files direclty. I use samba to see the files in my os, then just open them in vscode.

When editing a file, it now autopopulates with home Assistant entities etc.

Ah… I get it now - thanks for explaining!

As an alternative to this I’ve used a sftp extension is vscode to replicate the files on the RPi on OSX and edit them there. The extension takes care of syncing the changes back to the RPi.
Also means I have another backup of the files…

1 Like

For those that want some tips on using the Home Assistant config add-on for VSCode, I made a video about that.

3 Likes

Thanks @xbmcnut I just watched your Youtube and it was perfect.
I did have trouble with the extention at first none of the auto entity_id where coming up.
Found the problem with that on is because i had a spell checker extenion installed, took that out and all works.

The other thing i can get working is when you select “- service: script.all_lights_on” and right click the mouse ‘Go to definition’ it does not find the script which is in the same file… And says “No definition found for service”.

I am using all my yaml files in packages.

Any help on this thanks.

Awesome. Check you have the language set https://github.com/keesschollaart81/vscode-home-assistant/wiki/Troubleshooting

Yes the language is Home Assistant.

Maybe there is a requirement to have a scripts: !include scripts... in config?

I think i found the problem i am using a network drive for my mac and it says it should be a local folder.

Thanks anyway and sorry to trouble you.

I work on many PCs/Macs so thats why i have these problems.

Good to know. :slight_smile:

Hello I need some help I have this error when I check te configuration.yaml Home Assistant Configuration check resulted in an error: undefined

There is another update to VSCode this morning. Reload VSCode and try again.

I have 1.47 version…it´s not the last that??..

The VSCode add-on https://github.com/keesschollaart81/vscode-home-assistant/releases/tag/v1.7.2

I don’t understand it very well, the version that I have of vscode in hassio is 2.3.0. And the version of Home Assistant Config Helper on my Vscode is 1.7.2. You need to have the Vscode addons in hassio too?