Hey everybody,
this is kind of a rant, a documentation for myself that I don’t forget what I tried so far and a cry for help.
Setup is pretty easy: Intel Nuc with Home Assistant OS, pretty default setup. No ports open to the internet, as I have a VPN Server running and will first VPN into my home network and then access homeassistant via http. (Yes, no https configured!).
I now only want to easy develop and configure with autocompletion etc…
The route I went:
Setup local git repository via ssh incl. ssh key.
Visual Studio Code Community Addon
Installs easily, can see my files. Highlighting works. However, due to me not using https (only http connection) the home assistant addon for vscode for autocompletion does not work. Also cannot push to github, as the ssh_key is in the home assistant docker container, not in the vscode container (?) and therefore does not work.
Visual Studio Code Local installation at dev maschine
2a. General
Home Assistant Integration in vscode does not work
2b. Remote development extension
Does not work, as Home Assistant OS is not compatible with the remote working extension, some prerequesites are missing.
2c. SSH-FS
Does see the files, however git integration not supported
Does anybody have a similiar setup (http access only) and got visual studio code to work?
Thanks!
tom_l
January 30, 2021, 1:40pm
2
The easiest way is to use the SAMBA share addon to share your configurtion folder.
You can then open any file in /config with VSCode, or create a workspace. Either locally or via your VPN.
VSCode extensions that will assist in editing home assistant:
Thanks - SAMBA Share is worth another shot. However, the Home assistant helper still does not seem to work with http connections only…
tom_l
January 30, 2021, 1:48pm
4
Oh. I was not aware of that. No mention of it here:
Though this issue comment may be relevant:
opened 06:25PM - 23 May 20 UTC
closed 10:42PM - 16 Jun 21 UTC
bug
wontfix
I have a several errors occuring:
1. I'm sure this is root cause for the rest, … but not sure why. I have a valid cert (Positive SSL / Comodo - Domain Validation)
```
Command 'Home Assistant: Check Configuration (remote!)' resulted in an error (Request checkConfig failed with message: Error: unable to verify the first certificate)
```
2.
```
(node:1810) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded at Object.determineScalarType (/Users/roopesh/.vscode/extensions/keesschollaart.vscode-home-assistant-1.6.5/node_modules/yaml-language-server/out/server/node_modules/yaml-ast-parser-custom-tags/dist/src/scalarInference.js:71:16) at recursivelyBuildAst (/Users/roopesh/.vscode/extensions/keesschollaart.vscode-home-assistant-1.6.5/node_modules/yaml-language-server/out/server/src/languageservice/parser/yamlParser07.js:77:31) at recursivelyBuildAst (/Users/roopesh/.vscode/extensions/keesschollaart.vscode-home-assistant-1.6.5/node_modules/yaml-language-server/out/server/src/languageservice/parser/yamlParser07.js:53:50) at recursivelyBuildAst (/Users/roopesh/.vscode/extensions/keesschollaart.vscode-home-assistant-1.6.5/node_modules/yaml-language-server/out/server/src/languageservice/parser/yamlParser07.js:41:40) at recursivelyBuildAst (/Users/roopesh/.vscode/extensions/keesschollaart...
```
3.
```
(node:1810) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 593)
```
YAML: (one of many many many)
```
type: vertical-stack
title: Garage
icon: fas:garage
cards:
- type: horizontal-stack
cards:
&light_button
- type: "custom:button-card"
entity: light.garage_interior_lights
name: Wall
icon: >
[[[
if (entity.state == "on")
return "fal:lightbulb-on";
else if (entity.state == "off")
return "fas:lightbulb-slash";
else
return "fas:exclamation-triangle";
]]]
layout: icon_name
show_state: false
styles: &button_styles
icon:
- align-self: start
name:
- justify-self: start
- <<: *light_button
entity: light.garage_keypad_a_garage_wa
name: "Um, wall?"
- <<: *light_button
entity: switch.s_garage_overhead_lights
name: Overhead
- type: horizontal-stack
cards:
- <<: *light_button
entity: switch.s_garage_over_car_light
name: Over-car
- <<: *light_button
entity: switch.s_garage_over_fridge_light
name: Fridge
- <<: *light_button
entity: light.garage_xmas_lights
name: XMas
icon: fal:outlet
- type: horizontal-stack
cards:
&lock_button
- type: "custom:button-card"
entity: lock.laundry_room_door_lock_new
name: Laundry
layout: icon_name
icon: >
[[[
if (entity.state == "locked") return "fas:lock";
else if (entity.state == "unlocked") return "fal:lock-open-alt";
else return "fas:exclamation-triangle";
]]]
tap_action:
action: toggle
haptic: success
styles: *button_styles
- <<: *lock_button
entity: lock.garage_exterior_door_lock
name: Garage
- type: "custom:button-card"
entity: cover.garage_open
name: Door
layout: icon_name
icon: >
[[[
if (entity.state == "open")
return "fal:garage-car";
else if (entity.state == "closed")
return "fas:garage";
else
return "fas:exclamation-triangle";
]]]
styles: *button_styles
```
Extension runs in:
- [X] VS Code for Desktop
- [ ] Hassio Add-on
- [ ] Visual Studio Online
- [ ] Other:
I'm running VS Code on:
- [ ] Windows
- [X] Mac
- [ ] Linux
I'm accessing my files:
- [X] From local disk
- [ ] Via remote SSH
- [ ] Smb
- [ ] Other:
I subscribed to the mentioned topic… let’s see if this changes in the future…