Home Assistant Community Add-on: Visual Studio Code

I am also receiving this error (when it attempts to auto-complete an entity) after upgrading to Studio Code Server 4.2.0

Running Home Assistant OS 7.5 on a VM
supervisor-2022.03.5
core-2022.3.8

Thanks, at least I know now, that I am not alone.
Only a solution is missing!

(node:789) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
    at atLeastHaVersion (/usr/local/lib/code-server/lib/vscode/extensions/keesschollaart.vscode-home-assistant-1.27.0/node_modules/home-assistant-js-websocket/dist/haws.cjs:508:49)
    at entitiesColl (/usr/local/lib/code-server/lib/vscode/extensions/keesschollaart.vscode-home-assistant-1.27.0/node_modules/home-assistant-js-websocket/dist/haws.cjs:1010:32)
    at Object.subscribeEntities (/usr/local/lib/code-server/lib/vscode/extensions/keesschollaart.vscode-home-assistant-1.27.0/node_modules/home-assistant-js-websocket/dist/haws.cjs:1013:47)
    at /usr/local/lib/code-server/lib/vscode/extensions/keesschollaart.vscode-home-assistant-1.27.0/out/language-service/src/home-assistant/haConnection.js:61:20
    at new Promise (<anonymous>)
    at HaConnection.getHassEntities (/usr/local/lib/code-server/lib/vscode/extensions/keesschollaart.vscode-home-assistant-1.27.0/out/language-service/src/home-assistant/haConnection.js:55:33)
    at async HaConnection.getEntityCompletions (/usr/local/lib/code-server/lib/vscode/extensions/keesschollaart.vscode-home-assistant-1.27.0/out/language-service/src/home-assistant/haConnection.js:165:26)
    at async HomeAssistantLanguageService.getServiceAndEntityCompletions (/usr/local/lib/code-server/lib/vscode/extensions/keesschollaart.vscode-home-assistant-1.27.0/out/language-service/src/haLanguageService.js:174:48)
    at async HomeAssistantLanguageService.onCompletion (/usr/local/lib/code-server/lib/vscode/extensions/keesschollaart.vscode-home-assistant-1.27.0/out/language-service/src/haLanguageService.js:121:43)
(Use `node --trace-warnings ...` to show where the warning was created)

so what does that mean and how can I fix this - if at all possible?

I just restored the addon to 4.1 and it works.
Luckily I made a backup before updating to 4.2

Iā€™ve been battling this for about a week and canā€™t seem to figure out why VSCODE will not connect to home assistant for auto completion of entities. Iā€™ve added the token and the host but it doesnā€™t seem to work. To be fair it doesnā€™t work on standalone vs code app either.

There are no connection errors. My best guess is iā€™m missing a configuration step that wasnā€™t provided.

Does anyone have any idea how to fix this?

1 Like

Iā€™m stuck with it not working also. Same errors as @SaltyBastard

Did you find a solution on showing .storage?

same problem - cannot get it to work again

I have the same issues you mentioned and always have when using the HA App for the MACā€¦ mine may be a little differentā€¦sometimes I can paste but when it works it pastes whatever is on the clipboard twice.

Iā€™ve quit using the APP for editing anything and switch over to the browser (Safari or FireFox) if I need to do any kind of editing in Home Assistant. This has been going on for months/years though so its noting new.

Sorry I donā€™t have a fix for you.

same hereā€¦
new blueprint config for selectors throwing errors for me as well

    exclude_entities:
      name: Exclude Entities
      description: '[OPTIONAL]'
      selector:
        entity:
          multiple: true # <-- this one right here for example throws 'property multiple not allowed'

In new v5 of studio thereā€™s ESPHome integrated, as said in changelog. Iā€™m not exactly sure what that means (how to program modulesā€¦), but in friendly uptime sensor i get an error:


Any clues why? In ESPHome addon all is ok - no error. Also - this sensor works perfectly.

In the bottom status bar, what is the difference between ā€œhome-assistantā€ and "home-assistant-jinja"

  • When selecting ā€œhome-assistantā€, the editor will not list autofill my entities, it will only list the HA entities and templates.

  • When selecting ā€œhome-assistant-jinjaā€ it will list only my entites but wonā€™t list HA entities or tmplates. and the text is not colored.

Is it just me, or did the most recent 2022.5 update kill this?
ā€œThe editor could not be opened because the file was not foundā€ when trying to edit configuration.yaml

Stopped working in my installation so I thought I just reinstall it so I uninstalled it andā€¦
I do not have it in store!

I just manually restart the VS Code add on and it started working. Iā€™ve tried full server restarts, I wonder if it starts too early and then canā€™t connect for auto complete details.

Alright guys, I figured it out. For some reason, the Home Assistant Community Add-ons repository dropped out of the add on store at some point. First, go to Add-ons, click on ADD-ON STORE button in bottom corner, then click on the 3 dots in top right corner, click Repositories. Paste in: https://github.com/hassio-addons/repository and click Add.

You should now have an update for Studio Code Server which fixed everything for me after updating.

2 Likes

Seems that Safari doesnā€™t like the new versions of VSCode. Only blank page and these console errors when selecting VSC in sidebar

[Error] Unrecognized Content-Security-Policy directive 'worker-src'.
[Error] Unhandled Promise Rejection: ReferenceError: Can't find variable: BigInt64Array
	(anonymous function) (workbench.web.main.js:70:534283)
	promiseReactionJob
[Error] Unhandled Promise Rejection: ReferenceError: Can't find variable: BigInt64Array
	k (workbench.web.main.js:70:534283)
	A (workbench.web.main.js:70:540727)
	toData (workbench.web.main.js:617:2266844)
	onLocalUserConfigurationChanged (workbench.web.main.js:2639:8054792)
	(anonymous function) (workbench.web.main.js:2639:8052203)
	asyncFunctionResume
	(anonymous function)
	promiseReactionJobWithoutPromise
	promiseReactionJob

works fine in Chrome and Firefox

1 Like

Same here, blank screen in Safari

since HA 2022.6 there is an error in VSC with regards to new mqtt settings:

irrespective if I add !include or just define the sensor

this is issue with VSC as since 2022.6 the mqtt sensors that are manually defined should be in mqtt: section

Vsc had an update today - that might have fixed it?

1 Like